test(planner): pin a weekday in the opening hours inspector test so it passes on Sundays

This commit is contained in:
Maurice
2026-10-04 15:52:50 +02:00
parent 5bcb377b9c
commit b6c3b899d5
@@ -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: 'hi@bakery.test', opening_hours: week } as any);