diff --git a/apps/frontend/tests/unit/features/projects/VulnerabilityDetailBody.test.tsx b/apps/frontend/tests/unit/features/projects/VulnerabilityDetailBody.test.tsx index 45a4953a..a23aaa0e 100644 --- a/apps/frontend/tests/unit/features/projects/VulnerabilityDetailBody.test.tsx +++ b/apps/frontend/tests/unit/features/projects/VulnerabilityDetailBody.test.tsx @@ -163,12 +163,19 @@ describe("VulnerabilityDetailBody", () => { }); it("renders the KEV badge with the inline due date for a KEV-listed finding", () => { - renderBody({ kev: true, kev_due_date: "2026-07-15" }); + // Far-future due date on purpose: this surface (VulnerabilityDetailBody) + // does NOT inject a `now` into KevBadge, so the inline text is computed + // against the real clock. A near date would flip to the relative + // "Due in n days" format (dueDateStatus imminent window is 7 days) and make + // this assertion date-dependent — the exact time bomb this replaces. The + // state-aware relative/absolute formatting is covered deterministically in + // KevBadge.test.tsx via its injected `now`. + renderBody({ kev: true, kev_due_date: "2099-12-31" }); const badge = screen.getByTestId("kev-badge"); expect(badge.textContent).toContain("KEV"); // Drawer surface renders the CISA remediation due date inline. expect(screen.getByTestId("kev-badge-due-date").textContent).toContain( - "2026-07-15", + "2099-12-31", ); });