feat(platform): checkpoint current implementation state
This commit is contained in:
@@ -96,4 +96,24 @@ describe("checkDuplicateAssignment", () => {
|
||||
const result = checkDuplicateAssignment("r1", "p1", "2026-04-01", "2026-05-01", [proposed]);
|
||||
expect(result.isDuplicate).toBe(true);
|
||||
});
|
||||
|
||||
it("formats conflict dates from local-midnight Date objects without shifting the calendar day", () => {
|
||||
const localDateAssignment: ExistingAssignment = {
|
||||
...base,
|
||||
startDate: new Date(2026, 3, 6),
|
||||
endDate: new Date(2026, 3, 17),
|
||||
};
|
||||
|
||||
const result = checkDuplicateAssignment(
|
||||
"r1",
|
||||
"p1",
|
||||
new Date(2026, 3, 9),
|
||||
new Date(2026, 3, 10),
|
||||
[localDateAssignment],
|
||||
);
|
||||
|
||||
expect(result.isDuplicate).toBe(true);
|
||||
expect(result.message).toContain("2026-04-06");
|
||||
expect(result.message).toContain("2026-04-17");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user