diff --git a/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx b/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx index 7a135aa..ba652d0 100644 --- a/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx +++ b/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx @@ -72,6 +72,9 @@ function renderEvents(accountId: string, searches: string[]) { } describe("Upcoming event date filters", () => { + afterEach(() => { + vi.useRealTimers(); + }); beforeEach(() => { // Pin "today": the test picks today + 10 days, which must be inside the visible calendar grid. // Real dates can push it beyond the grid (e.g. 2026-10-23 -> 2 November). @@ -235,6 +238,10 @@ describe("Upcoming event date filters", () => { it.each(["account-1", "all"])( "applies dates only on submit, restores URL dates, and resets from empty results for %s", async (accountId) => { + // Pin "today" mid-month so "today + 10 days" stays in the calendar's + // visible month regardless of the real date. + vi.useFakeTimers({ toFake: ["Date"] }); + vi.setSystemTime(new Date("2026-10-15T12:00:00+03:00")); const [defaultFrom, defaultTo] = defaultPeriod(); const searches: string[] = []; server.use(