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 8bb0142..7a135aa 100644 --- a/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx +++ b/src/pages/account-events/ui/AccountEventsPage/AccountEventsPage.filters.test.tsx @@ -17,7 +17,7 @@ import { useLocation, useNavigate, } from "react-router"; -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { configureAuthClient } from "@/shared/api"; import { defaultPeriod, formatDate, moscowDate } from "@/shared/lib"; @@ -73,6 +73,10 @@ function renderEvents(accountId: string, searches: string[]) { describe("Upcoming event date filters", () => { 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). + vi.useFakeTimers({ toFake: ["Date"] }); + vi.setSystemTime(new Date("2026-08-10T09:00:00Z")); configureAuthClient({ accessToken: () => "token", clear: vi.fn(), @@ -80,6 +84,8 @@ describe("Upcoming event date filters", () => { }); }); + afterEach(() => vi.useRealTimers()); + it("keeps reads and sync disabled without an account scope", async () => { const requests: string[] = []; server.use(