From 9b03a710e90f4da7948091f39f57f2ef80419fa1 Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 27 Oct 2026 23:13:07 -0400 Subject: [PATCH] test: fix the day of the Reports period tests in local time (#479) resolveReportsPeriod reads the local date of the day it is given, and the fixture was noon UTC: April 15 already in UTC+12 and beyond. Harmless while the tests only read the year, it turned six of the new exact-date cases red under TZ=Pacific/Auckland (found in the self-review, replayed). The fixture is now local noon, April 14 in every time zone; the seven test files of #479 pass from UTC-11 to UTC+14. Resolves #479 Co-Authored-By: Claude Opus 5.5 --- src/hooks/useReportsPeriod.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useReportsPeriod.test.ts b/src/hooks/useReportsPeriod.test.ts index ad880f7..5fc0da8 100644 --- a/src/hooks/useReportsPeriod.test.ts +++ b/src/hooks/useReportsPeriod.test.ts @@ -3,8 +3,9 @@ import { resolveReportsPeriod, parseAccountIds, serializeAccountIds } from "./us describe("resolveReportsPeriod", () => { // A day far from the clock: a range computed from `new Date()` instead of - // the given day ends elsewhere, and these tests go red. - const fixedToday = new Date("2026-04-14T12:00:00Z"); + // the given day ends elsewhere, and these tests go red. Local noon, so it is + // April 14 in every time zone (noon UTC is already April 15 in UTC+12). + const fixedToday = new Date(2026, 3, 14, 12); /** « Cette année » on that day: January 1st to that day (#479). */ const YEAR_TO_DATE = { from: "2026-01-01", to: "2026-04-14", period: "year" };