Add integration coverage for multi-leg timeline and transfer-bar

Verifies FullRouteTimeline + TransferBar render for MultiLeg fixtures
and stay absent for Direct flights, locking in the B.5 page wiring.
This commit is contained in:
2026-04-17 02:41:31 +03:00
parent 6805b8fe4d
commit 31c6bf1788
@@ -162,6 +162,40 @@ describe("Flight details page integration", () => {
expect(screen.getByTestId("flight-leg-1")).toBeTruthy();
});
it("renders FullRouteTimeline and a TransferBar between legs for multi-leg", () => {
setupWithFlight(MULTI_LEG_FLIGHT);
render(
<OnlineBoardDetailsPage
flightId={{
carrier: "SU",
flightNumber: "0300",
date: "20250115",
}}
locale="ru"
canonicalOrigin="https://www.aeroflot.ru"
/>,
);
expect(screen.getByTestId("full-route-timeline")).toBeTruthy();
expect(screen.getAllByTestId("transfer-bar")).toHaveLength(1);
// transfer-bar should include the intermediate-landing label and a computed transfer-time
const bar = screen.getByTestId("transfer-bar");
expect(bar.textContent).toContain("SHARED.INTERMEDIATE-LANDING");
expect(bar.querySelector('[data-testid="transfer-time"]')).toBeTruthy();
});
it("does not render FullRouteTimeline or TransferBar for direct flight", () => {
setupWithFlight(DIRECT_FLIGHT);
render(
<OnlineBoardDetailsPage
flightId={FLIGHT_ID}
locale="ru"
canonicalOrigin="https://www.aeroflot.ru"
/>,
);
expect(screen.queryByTestId("full-route-timeline")).toBeNull();
expect(screen.queryByTestId("transfer-bar")).toBeNull();
});
it("renders operating carrier info", () => {
setupWithFlight();
render(