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.
This commit is contained in:
Maurice
2026-09-23 12:30:10 +02:00
parent 34c1dc79b5
commit e921799580
@@ -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) })