Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(roadtrip): mount the phone case of a refused way the way the phone suites do

Mauricee92179958040
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) })