forked from Yara724/api
fix claim validation and expert branch scoping
This commit is contained in:
@@ -18,9 +18,22 @@ describe("parseIranLocalDateTime", () => {
|
||||
expect(instant!.toISOString()).toBe("2025-05-16T14:58:00.000Z");
|
||||
});
|
||||
|
||||
it("applies a separately supplied time to an explicit-offset date", () => {
|
||||
const instant = parseIranLocalDateTime(
|
||||
"2025-05-16T00:00:00.000Z",
|
||||
"18:28",
|
||||
);
|
||||
expect(instant!.toISOString()).toBe("2025-05-16T14:58:00.000Z");
|
||||
});
|
||||
|
||||
it("combines Date calendar day in Iran with accidentTime", () => {
|
||||
const dateOnly = new Date("2025-05-16T00:00:00.000Z");
|
||||
const instant = parseIranLocalDateTime(dateOnly, "18:28");
|
||||
expect(instant!.toISOString()).toBe("2025-05-16T14:58:00.000Z");
|
||||
});
|
||||
|
||||
it("rejects out-of-range hours and minutes", () => {
|
||||
expect(parseIranLocalDateTime("2025-05-16", "24:00")).toBeNull();
|
||||
expect(parseIranLocalDateTime("2025-05-16", "12:60")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user