mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
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:
@@ -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) })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user