Compare commits
1
Commits
d0e51476be
...
fead7c18af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fead7c18af |
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user