diff --git a/src/features/schedule/components/DayGroupedFlightList.test.tsx b/src/features/schedule/components/DayGroupedFlightList.test.tsx index c54a77bd..f834e6aa 100644 --- a/src/features/schedule/components/DayGroupedFlightList.test.tsx +++ b/src/features/schedule/components/DayGroupedFlightList.test.tsx @@ -278,6 +278,32 @@ describe("schedule search results body โ€” action strip", () => { }); }); +describe("schedule search results โ€” inline buy link", () => { + it("threads buyUrlFor into grouped multi-day FlightList rows", () => { + const firstDay = makeDirectFlight({ + depLocal: "2026-05-06T08:00:00+03:00", + arrLocal: "2026-05-06T10:30:00+03:00", + }); + const secondDay = makeDirectFlight({ + depLocal: "2026-05-07T14:00:00+03:00", + arrLocal: "2026-05-07T16:30:00+03:00", + }); + + render( + `https://example.test/buy/${flight.id}`} + />, + ); + + const firstBuyLink = screen.getByTestId("flight-card-buy-link"); + expect(firstBuyLink.getAttribute("href")).toBe("https://example.test/buy/f-first-day"); + }); +}); + // --------------------------------------------------------------------------- // ยง4.1.14.3 โ€” DayGroupedFlightList grouping + day headers // --------------------------------------------------------------------------- diff --git a/src/features/schedule/components/DayGroupedFlightList.tsx b/src/features/schedule/components/DayGroupedFlightList.tsx index 0e1e6d8e..67cfc654 100644 --- a/src/features/schedule/components/DayGroupedFlightList.tsx +++ b/src/features/schedule/components/DayGroupedFlightList.tsx @@ -363,6 +363,7 @@ export const DayGroupedFlightList: FC = ({ direction="schedule" renderExpandedBody={renderScheduleBody} {...(onFlightClick ? { onFlightClick } : {})} + {...(buyUrlFor ? { buyUrlFor } : {})} {...(resolvedInitialFlightId ? { initialCurrentFlightId: resolvedInitialFlightId } : {})}