forked from Yara724/api
fanavaran car body and third_party lookup codings applied
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import {
|
||||
filterPoliciesByLine,
|
||||
insuranceLineLabel,
|
||||
parseLastCarPolicyInput,
|
||||
pickVehicleId,
|
||||
plaqueLetterFromMiddleCode,
|
||||
plaqueMatchesVehicle,
|
||||
selectLastAmongCarMatches,
|
||||
toAppPlaque,
|
||||
vehicleMatchesCar,
|
||||
} from "./fanavaran-last-car-policy";
|
||||
|
||||
@@ -40,6 +43,28 @@ describe("fanavaran last car policy", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("maps insurance line ids to CAR_BODY and THIRD_PARTY", () => {
|
||||
expect(insuranceLineLabel(4)).toBe("CAR_BODY");
|
||||
expect(insuranceLineLabel(5)).toBe("THIRD_PARTY");
|
||||
});
|
||||
|
||||
it("converts PlaqueMiddleCodeId 5 to د and builds app plaque parts", () => {
|
||||
expect(plaqueLetterFromMiddleCode(5)).toBe("د");
|
||||
expect(
|
||||
toAppPlaque({
|
||||
PlaqueLeftNo: "29",
|
||||
PlaqueMiddleCodeId: 5,
|
||||
PlaqueRightNo: "782",
|
||||
PlaqueSerial: "60",
|
||||
}),
|
||||
).toEqual({
|
||||
leftTwoDigits: "29",
|
||||
serialLetter: "د",
|
||||
threeDigits: "782",
|
||||
rightTwoDigits: "60",
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps only the requested insurance line", () => {
|
||||
const rows = filterPoliciesByLine(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user