diff --git a/packages/api/src/__tests__/assistant-tools-insights-summary.test.ts b/packages/api/src/__tests__/assistant-tools-insights-summary.test.ts index db30331..3ebfda4 100644 --- a/packages/api/src/__tests__/assistant-tools-insights-summary.test.ts +++ b/packages/api/src/__tests__/assistant-tools-insights-summary.test.ts @@ -43,26 +43,30 @@ describe("assistant insights summary tools", () => { }); it("routes insights summary reads through the insights router path", async () => { + const now = new Date(); + const daysAgo = (n: number) => new Date(now.getTime() - n * 24 * 60 * 60 * 1000); + const daysFromNow = (n: number) => new Date(now.getTime() + n * 24 * 60 * 60 * 1000); + const db = { project: { findMany: vi.fn().mockResolvedValue([ { budgetCents: 100_000, - startDate: new Date("2026-03-01T00:00:00.000Z"), - endDate: new Date("2026-03-31T00:00:00.000Z"), + startDate: daysAgo(30), + endDate: daysFromNow(30), demandRequirements: [ { headcount: 3, - startDate: new Date("2026-03-20T00:00:00.000Z"), - endDate: new Date("2026-04-05T00:00:00.000Z"), + startDate: daysAgo(5), + endDate: daysFromNow(10), _count: { assignments: 1 }, }, ], assignments: [ { resourceId: "res_1", - startDate: new Date("2026-03-01T00:00:00.000Z"), - endDate: new Date("2026-03-31T00:00:00.000Z"), + startDate: daysAgo(30), + endDate: daysFromNow(30), hoursPerDay: 8, dailyCostCents: 10_000, status: "ACTIVE",