diff --git a/src/features/online-board/components/FlightsMiniList/FlightsMiniList.test.tsx b/src/features/online-board/components/FlightsMiniList/FlightsMiniList.test.tsx index 532fff3e..bc276d36 100644 --- a/src/features/online-board/components/FlightsMiniList/FlightsMiniList.test.tsx +++ b/src/features/online-board/components/FlightsMiniList/FlightsMiniList.test.tsx @@ -58,20 +58,23 @@ function makeFlight(id: string, date = "20260416"): ISimpleFlight { } describe("FlightsMiniList", () => { - it("returns null when flights array is empty", () => { + it("falls back to the current flight when the list is empty", () => { + // Angular parity: mini-list stays visible and shows the currently-viewed + // flight as a single item even when no sibling flights are available. const current = makeFlight("SU0022-20260416"); - const { container } = render( + render( , ); - expect(container.firstChild).toBeNull(); + expect(screen.getByTestId("flights-mini-list")).toBeTruthy(); + expect(screen.getByTestId("mini-list-item-SU0022-20260416")).toBeTruthy(); }); - it("returns null when flights array has only one flight", () => { + it("renders the single entry when flights array has only one flight", () => { const current = makeFlight("SU0022-20260416"); - const { container } = render( + render( , ); - expect(container.firstChild).toBeNull(); + expect(screen.getByTestId("mini-list-item-SU0022-20260416")).toBeTruthy(); }); it("renders one item per flight when multiple flights", () => { diff --git a/src/features/online-board/components/FlightsMiniList/FlightsMiniList.tsx b/src/features/online-board/components/FlightsMiniList/FlightsMiniList.tsx index 26bb459a..8c1b694d 100644 --- a/src/features/online-board/components/FlightsMiniList/FlightsMiniList.tsx +++ b/src/features/online-board/components/FlightsMiniList/FlightsMiniList.tsx @@ -23,13 +23,14 @@ export const FlightsMiniList: FC = ({ } }, [currentFlight.id]); - if (flights.length <= 1) { - return null; - } + // Angular parity: the sidebar renders even when the list is empty or + // has a single flight — it falls back to showing the current flight so + // the layout stays consistent with the stand-alone Angular details view. + const renderFlights = flights.length > 0 ? flights : [currentFlight]; return (
- {flights.map((flight) => ( + {renderFlights.map((flight) => ( { diff --git a/src/features/online-board/components/OnlineBoardDetailsPage.test.tsx b/src/features/online-board/components/OnlineBoardDetailsPage.test.tsx index a1d73174..da165b96 100644 --- a/src/features/online-board/components/OnlineBoardDetailsPage.test.tsx +++ b/src/features/online-board/components/OnlineBoardDetailsPage.test.tsx @@ -251,10 +251,12 @@ describe("OnlineBoardDetailsPage", () => { expect(screen.getByTestId("flights-mini-list")).toBeTruthy(); }); - it("does not render mini-list when only one flight is returned", () => { + it("still renders mini-list with the current flight when only one flight is returned", () => { + // Angular parity: mini-list always visible, falling back to the current + // flight as a single entry when there are no sibling flights. mockState = { flight: mockFlight, allFlights: [mockFlight], daysOfFlight: ["20250115"], loading: false, error: null }; render(); - expect(screen.queryByTestId("flights-mini-list")).toBeNull(); + expect(screen.getByTestId("flights-mini-list")).toBeTruthy(); }); it("renders inside PageLayout (has page-layout class)", () => { diff --git a/src/features/online-board/components/OnlineBoardDetailsPage.tsx b/src/features/online-board/components/OnlineBoardDetailsPage.tsx index cff29d2d..e0bdc8a6 100644 --- a/src/features/online-board/components/OnlineBoardDetailsPage.tsx +++ b/src/features/online-board/components/OnlineBoardDetailsPage.tsx @@ -11,7 +11,6 @@ import { Fragment, useCallback, useMemo, type FC } from "react"; import { useNavigate, useSearchParams } from "@modern-js/runtime/router"; import { useTranslation } from "@/i18n/provider.js"; import "./OnlineBoardDetailsPage.scss"; -import { FlightCard } from "@/ui/flights/FlightCard.js"; import { FlightListSkeleton } from "@/ui/flights/FlightListSkeleton.js"; import { SeoHead } from "@/ui/seo/SeoHead.js"; import { JsonLdRenderer } from "@/shared/seo/json-ld.js"; @@ -568,9 +567,6 @@ export const OnlineBoardDetailsPage: FC = ({ )} - {/* Summary card */} - - {/* Angular's details page conveys the operating carrier via the airline logo in the badge and, for code-share flights, via the small 'KL 123, AF 456…' line under the diff --git a/tests/integration/online-board/flight-details.test.tsx b/tests/integration/online-board/flight-details.test.tsx index d19cb2ca..dec2d714 100644 --- a/tests/integration/online-board/flight-details.test.tsx +++ b/tests/integration/online-board/flight-details.test.tsx @@ -138,11 +138,11 @@ describe("Flight details page integration", () => { canonicalOrigin="https://www.aeroflot.ru" />, ); - // FlightStatus renders STATUS_LABELS_RU in the embedded - // summary row (the leg header only renders for - // multi-leg flights now). For a direct Scheduled flight that's - // the single Russian label 'Запланирован'. - expect(screen.getAllByText("Запланирован").length).toBeGreaterThanOrEqual(1); + // After removing the duplicate FlightCard summary for Angular parity, + // the status label is rendered by the LegRoute status-text inside the + // route strip — under the test's identity i18n mock that resolves to + // the raw 'FLIGHT-STATUSES.Scheduled' key. + expect(screen.getAllByText("FLIGHT-STATUSES.Scheduled").length).toBeGreaterThanOrEqual(1); }); it("renders flight legs for direct flight", () => {