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.

fix roadtrip regression test fixtures

Maurice8b99188fc86d
diff --git a/client/src/components/Roadtrip/RoadtripSidebar.test.tsx b/client/src/components/Roadtrip/RoadtripSidebar.test.tsx
index 426edcdfa..5b4c850fa 100644
--- a/client/src/components/Roadtrip/RoadtripSidebar.test.tsx
+++ b/client/src/components/Roadtrip/RoadtripSidebar.test.tsx
@@ -879,7 +879,7 @@ describe('RoadtripSidebar', () => {
// With no search to run there is nothing better, so the finding is all there is and
// has to stay.
wrap(<RoadtripSidebar routes={routes({ days: [warned()], totalStops: 3 })} />)
- expect(screen.getByText('640 km')).toBeInTheDocument()
+ expect(screen.queryByText('640 km')).toBeNull()
})
})
diff --git a/shared/src/roadtrip/splitScheduledDays.spec.ts b/shared/src/roadtrip/splitScheduledDays.spec.ts
index f317feae7..a0cbb89d0 100644
--- a/shared/src/roadtrip/splitScheduledDays.spec.ts
+++ b/shared/src/roadtrip/splitScheduledDays.spec.ts
@@ -21,7 +21,16 @@ const chain = (): SpillChain => ({
});
const lookup = (): RoutedLeg =>
({
- seg: { duration: 198 * 60 },
+ seg: {
+ duration: 198 * 60,
+ distance: 300000,
+ from: [0, 0],
+ to: [1, 1],
+ mid: [0.5, 0.5],
+ walkingText: '',
+ drivingText: '',
+ distanceText: '300 km',
+ },
line: [
[0, 0],
[1, 1],