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): pin a weekday in the opening hours inspector test so it passes on Sundays

Mauriceb6c3b899d59f
diff --git a/client/src/components/Planner/PlaceInspector.test.tsx b/client/src/components/Planner/PlaceInspector.test.tsx
index c02cfa664..194b786f7 100644
--- a/client/src/components/Planner/PlaceInspector.test.tsx
+++ b/client/src/components/Planner/PlaceInspector.test.tsx
@@ -689,6 +689,12 @@ describe('PlaceInspector', () => {
});
it('FE-PLANNER-INSPECTOR-2472: the own e-mail and hours show, the hours ahead of looked-up ones', async () => {
+ // The collapsed row shows today's hours, so on a Sunday it reads "Closed"
+ // and the button below is not found. Pin a Monday; only Date is faked so
+ // userEvent's timers keep running.
+ vi.useFakeTimers({ toFake: ['Date'] });
+ vi.setSystemTime(new Date('2026-09-28T10:00:00'));
+ onTestFinished(() => { vi.useRealTimers(); });
const user = userEvent.setup();
const week = JSON.stringify(Array.from({ length: 7 }, (_, i) => (i === 6 ? { closed: true } : { closed: false, open: '08:00', close: '12:00' })));
const p = buildPlace({ id: 302, email: '[email protected]', opening_hours: week } as any);