forked from Yara724/api
new person registration + car body matching accident date with endDate
This commit is contained in:
@@ -153,3 +153,35 @@ describe("Hull base-claim vehicle use from policy inquiry", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Hull preview and submission driver-role gate", () => {
|
||||
it("reports unresolved role 166 in preview without enabling registration", async () => {
|
||||
const service = previewSetup({ UsedId: 42, VehicleKindId: 8671 });
|
||||
const result = await service.previewFanavaranSubmitV2("claim", "moallem", {
|
||||
debug: true,
|
||||
});
|
||||
expect(service.enrichCarBodyHullBaseClaimPayload).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ registerMissingDriver: false }),
|
||||
);
|
||||
expect(result.previewWarnings).toContainEqual(
|
||||
expect.objectContaining({ code: "FANAVARAN_HULL_DRIVER_ROLE_REQUIRED" }),
|
||||
);
|
||||
});
|
||||
|
||||
it("blocks submission when the driver's role remains unresolved after registration", async () => {
|
||||
const service = previewSetup({ UsedId: 42, VehicleKindId: 8671 });
|
||||
await expect(
|
||||
service.previewFanavaranSubmitV2("claim", "moallem", {
|
||||
requirePolicyId: true,
|
||||
registerMissingHullDriver: true,
|
||||
}),
|
||||
).rejects.toMatchObject({
|
||||
response: expect.objectContaining({
|
||||
code: "FANAVARAN_HULL_DRIVER_ROLE_REQUIRED",
|
||||
}),
|
||||
});
|
||||
expect(service.enrichCarBodyHullBaseClaimPayload).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ registerMissingDriver: true }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user