forked from Yara724/api
feat: route user claims by branch and align licence issue dates
Require the damaged party in user flows to select an active insurer branch and preserve branch access rules. Accept older licence issue dates, correct anniversary boundaries, and update Fanavaran audit documentation and regression coverage.
This commit is contained in:
@@ -18,19 +18,20 @@ import {
|
||||
} from "./inquiry-participant-resolver";
|
||||
|
||||
describe("inquiry participant resolver", () => {
|
||||
it("accepts a driver licence date within the ten-year window", () => {
|
||||
expect(validateDriverLicenseDate("2016-09-26", "2026-09-26")).toBe(
|
||||
"2016-09-26",
|
||||
);
|
||||
});
|
||||
it.each(["2016-09-26", "2016-09-25", "1995-01-01", "1374/01/01", 13740101])(
|
||||
"accepts a past driver licence date without a ten-year cutoff: %s",
|
||||
(date) => {
|
||||
expect(validateDriverLicenseDate(date, "2026-09-26")).toBe(String(date));
|
||||
},
|
||||
);
|
||||
|
||||
it("rejects future and older-than-ten-year driver licence dates", () => {
|
||||
it("still rejects future and malformed driver licence dates", () => {
|
||||
expect(() =>
|
||||
validateDriverLicenseDate("2026-09-27", "2026-09-26"),
|
||||
).toThrow("نمیتواند در آینده");
|
||||
expect(() =>
|
||||
validateDriverLicenseDate("2016-09-25", "2026-09-26"),
|
||||
).toThrow("بیشتر از ۱۰ سال قبل");
|
||||
validateDriverLicenseDate("invalid", "2026-09-26"),
|
||||
).toThrow("نامعتبر است");
|
||||
});
|
||||
|
||||
it("requires the date only for a licensed driver", () => {
|
||||
|
||||
Reference in New Issue
Block a user