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(planner): give the page fixture the road trip state it reads

Maurice25249749ad8f
diff --git a/client/src/pages/TripPlannerPage.wiring.test.tsx b/client/src/pages/TripPlannerPage.wiring.test.tsx
index 6430106d4..d081f8ccc 100644
--- a/client/src/pages/TripPlannerPage.wiring.test.tsx
+++ b/client/src/pages/TripPlannerPage.wiring.test.tsx
@@ -141,6 +141,37 @@ function baseState(): HookState {
collabFeatures: { chat: true, notes: true, polls: true, whatsnext: true },
tripAccommodations: [],
setTripAccommodations: vi.fn(),
+ // Road trip mode off, which is the state every assertion below reads: the page keeps
+ // its ordinary map, sidebar and route wiring, and the road-trip branches stay unmounted.
+ // The shapes still have to be here, because the page reaches into routeAlternatives.open,
+ // roadtripRoutes.lines and roadtripVias.byDay before it ever checks whether the mode is on.
+ roadtripMode: false,
+ toggleRoadtripMode: vi.fn(),
+ roadtripActive: false,
+ roadtripRoutes: { lines: [], segments: [], days: [], loading: false, totalStops: 0 },
+ roadtripCorridor: { visible: [], day: null, dayId: '', setDayId: vi.fn(), categories: [], toggleCategory: vi.fn(), widthKm: 5, setWidthKm: vi.fn(), search: vi.fn(), nameFilter: '', setNameFilter: vi.fn(), insertIndexFor: vi.fn() },
+ stopDraft: null,
+ setStopDraft: vi.fn(),
+ saveStopDraft: vi.fn(async () => undefined),
+ stopDraftToForm: vi.fn(),
+ stopDraftDuplicate: null,
+ reorderRoadtripStop: vi.fn(async () => undefined),
+ roadtripVias: { byDay: {}, refresh: vi.fn(async () => undefined) },
+ addRoadtripVia: vi.fn(async () => undefined),
+ moveRoadtripVia: vi.fn(async () => undefined),
+ removeRoadtripVia: vi.fn(async () => undefined),
+ routeAlternatives: { open: null, close: vi.fn(), loading: false, ask: vi.fn(async () => undefined) },
+ askRouteAlternatives: vi.fn(async () => undefined),
+ chooseRouteAlternative: vi.fn(async () => undefined),
+ alternativeOverlays: [],
+ alternativeFocusPoints: [],
+ stayDraft: null,
+ setStayDraft: vi.fn(),
+ setRoadtripStay: vi.fn(async () => undefined),
+ highlightedAlternative: null,
+ setHighlightedAlternative: vi.fn(),
+ moveRoadtripStopToDay: vi.fn(async () => undefined),
+ dropPoiOnRoute: vi.fn(async () => undefined),
allowedFileTypes: 'pdf',
tripMembers: [],
setTripMembers: vi.fn(),