@@ -41,4 +41,25 @@ describe("EventCard actions trigger", () => {
|
||||
expect(markup).toContain("10:00–11:00");
|
||||
expect(markup).not.toContain("AM");
|
||||
});
|
||||
|
||||
test("renders inline warning copy for invalid event ranges", () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
EventCard({
|
||||
event: {
|
||||
id: "evt_invalid",
|
||||
title: "Broken Event",
|
||||
start: "2026-04-09T11:00:00+00:00",
|
||||
end: "2026-04-09T10:00:00+00:00",
|
||||
allDay: false,
|
||||
},
|
||||
onEdit: () => {},
|
||||
onDelete: () => {},
|
||||
}),
|
||||
);
|
||||
|
||||
expect(markup).toContain("Warning:");
|
||||
expect(markup).toContain("end time is before start time");
|
||||
expect(markup).not.toContain("Preview");
|
||||
expect(markup).not.toContain("Ship");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user