test("renders inline warning copy for invalid event ranges",()=>{
constmarkup=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:()=>{},
}),
);
test("renders friendly shared date formatting instead of native locale strings",()=>{
constmarkup=renderToStaticMarkup(
EventCard({
event: sampleEvent,
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");
});
expect(markup).toContain("10:00–11:00");
expect(markup).not.toContain("AM");
});
test("renders inline warning copy for invalid event ranges",()=>{
constmarkup=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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.