fanavaran car body and third_party lookup codings applied

This commit is contained in:
2026-09-06 10:45:40 +03:30
parent 5f714e1456
commit 02edd0b2ca
5 changed files with 160 additions and 2 deletions

View File

@@ -58,6 +58,7 @@ describe("LookupsService.findLastProcessedCarPolicy", () => {
}),
),
getRemoteLookup: jest.fn().mockResolvedValue([]),
customerById: jest.fn().mockResolvedValue(null),
};
const service = createService(lookup);
@@ -68,10 +69,15 @@ describe("LookupsService.findLastProcessedCarPolicy", () => {
expect(result.policyId).toBe(20);
expect(result.product).toBe("third-party");
expect(result.insuranceLine).toBe("THIRD_PARTY");
expect(result.insuranceLineId).toBe(5);
expect(result.vehicle).toEqual({
Id: 500,
VIN: "IRNKAEK4150012345",
color: null,
vehicleKind: null,
used: null,
plaque: null,
});
expect(lookup.thirdPartyPolicyById).toHaveBeenCalled();
expect(lookup.myPolicies.mock.calls[0][2]).toBe(5);
@@ -103,6 +109,7 @@ describe("LookupsService.findLastProcessedCarPolicy", () => {
PlaqueSerial: "67",
}),
getRemoteLookup: jest.fn().mockResolvedValue([]),
customerById: jest.fn().mockResolvedValue(null),
};
const service = createService(lookup);
@@ -116,6 +123,13 @@ describe("LookupsService.findLastProcessedCarPolicy", () => {
expect(result.policyId).toBe(44);
expect(result.product).toBe("car-body");
expect(result.insuranceLine).toBe("CAR_BODY");
expect(result.vehicle?.plaque).toEqual({
leftTwoDigits: "12",
serialLetter: "ب",
threeDigits: "345",
rightTwoDigits: "67",
});
expect(lookup.bodyPolicyById).toHaveBeenCalled();
expect(lookup.thirdPartyPolicyById).not.toHaveBeenCalled();
expect(lookup.inquiryByVin).not.toHaveBeenCalled();
@@ -147,6 +161,7 @@ describe("LookupsService.findLastProcessedCarPolicy", () => {
ChassisNo: "RDE07024",
}),
getRemoteLookup: jest.fn().mockResolvedValue([]),
customerById: jest.fn().mockResolvedValue(null),
};
const service = createService(lookup);