Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
});

Expand Down
Loading