From 2a750ef91687a9fc58a0d94bd9146f23bc605669 Mon Sep 17 00:00:00 2001 From: paula-alves Date: Thu, 26 Nov 2026 14:58:41 +0000 Subject: [PATCH] fix(test): use date relative to now in ContextMenu event fixture (BIT-33405) The hardcoded startsAt 2026-11-21 fell outside EventsPanel RECENT_DAYS=4 window after 2026-11-25, collapsing the event under "Anteriores" and making the test fail on every CI run. Derive startsAt, ingestFrom and ingestUntil from Date.now() so the fixture stays inside the recent window regardless of the run date. Paperclip-Issue: BIT-33405 Paperclip-Agent: Bug Squasher (urlKey bug-squasher; id 4669adc7-6368-43ef-bf27-5a601a6b7b83) --- apps/app/src/library/ContextMenu.test.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/app/src/library/ContextMenu.test.tsx b/apps/app/src/library/ContextMenu.test.tsx index e3725dd..0911830 100644 --- a/apps/app/src/library/ContextMenu.test.tsx +++ b/apps/app/src/library/ContextMenu.test.tsx @@ -5,6 +5,10 @@ import { EventsPanel } from "./EventsPanel.js"; import { PhotoContextMenu } from "./PhotoContextMenu.js"; function event(id: string, title: string): EventSummary { + const startsAt = new Date(Date.now() - 86_400_000); + const iso = startsAt.toISOString(); + const at = (offsetMs: number) => + new Date(startsAt.getTime() + offsetMs).toISOString(); return { id, organizationId: "org", @@ -20,9 +24,9 @@ function event(id: string, title: string): EventSummary { competitionCode: null, round: null, matchNumber: null, - startsAt: "2026-11-21T10:56:00.000Z", - ingestFrom: "2026-11-21T08:56:00.000Z", - ingestUntil: "2026-11-21T14:56:00.000Z", + startsAt: iso, + ingestFrom: at(-2 * 3_600_000), + ingestUntil: at(4 * 3_600_000), iptcTemplate: {}, archivedAt: null, photographers: [], -- 2.47.3