From e921799580407a863157ff784ae88d4e0601e463 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 23 Sep 2026 12:30:10 +0200 Subject: [PATCH] test(roadtrip): mount the phone case of a refused way the way the phone suites do The desk helper waits for road trip mode, which never turns on at phone width, so the case timed out before it asked anything. It now waits for the drive tab, as the phone feed suites already do. --- .../src/pages/tripPlanner/useTripPlanner.roadtrip.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/pages/tripPlanner/useTripPlanner.roadtrip.test.tsx b/client/src/pages/tripPlanner/useTripPlanner.roadtrip.test.tsx index 9821b16d5..0556c25e9 100644 --- a/client/src/pages/tripPlanner/useTripPlanner.roadtrip.test.tsx +++ b/client/src/pages/tripPlanner/useTripPlanner.roadtrip.test.tsx @@ -1167,7 +1167,11 @@ describe('useTripPlanner road trip: other ways of driving a leg', () => { routedDay() openWith([detour({ hasFerry: true, avoids: 'motorway', engine: 'valhalla' })]) rt.legRoute.mockResolvedValue(answer(RAIL_LINE, { hasFerry: false })) - const { result } = await renderRoadtrip() + // Road trip MODE never turns on at phone width (the drive lives on its own tab), so + // this mounts the way the phone suites do and waits for that tab instead. + const { result } = renderHook(() => useTripPlanner(), { wrapper }) + await act(async () => { await Promise.resolve() }) + await waitFor(() => expect(result.current.TRIP_TABS.some(tab => tab.id === 'roadtrip')).toBe(true)) await act(async () => { await result.current.chooseRouteAlternative(1) })