From 2dead731d8f376683b8df1c4ddbfeccc88c81404 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Fri, 11 Sep 2026 16:58:40 -0300 Subject: [PATCH] =?UTF-8?q?test(agenda):=20fixa=20o=20rel=C3=B3gio=20do=20?= =?UTF-8?q?overlay=20no=20m=C3=AAs=20do=20fixture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O calendário abre no mês corrente e os fixtures (e o startAt submetido) são de agosto/2026: desde 01/09 o teste 'troca dia no calendário' não encontra o dia 15 de agosto e derruba a suíte unit full — que é o que o gate e o CI rodam hoje (o wrapper changed cai no full). Relógio fixo no mês do fixture torna o teste determinístico. --- tests/unit/activityOverlay.unit.spec.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/activityOverlay.unit.spec.tsx b/tests/unit/activityOverlay.unit.spec.tsx index ec5d074b..bd50be39 100644 --- a/tests/unit/activityOverlay.unit.spec.tsx +++ b/tests/unit/activityOverlay.unit.spec.tsx @@ -110,6 +110,13 @@ const openDatePicker = (label: string) => { } beforeAll(() => { + /* + * The fixtures (and the submitted `startAt`) live in August 2026 and the + * calendar picker opens on the CURRENT month: pin the clock to the fixture + * month so the day buttons stay reachable no matter when the suite runs. + */ + vi.useFakeTimers({ shouldAdvanceTime: true }) + vi.setSystemTime(new Date('2026-08-10T15:00:00.000Z')) vi.stubGlobal( 'ResizeObserver', class { @@ -121,6 +128,7 @@ beforeAll(() => { }) afterAll(() => { + vi.useRealTimers() vi.unstubAllGlobals() })