forked from Yara724/api
Fix damaged vehicle identity across claim panels and price estimates
This commit is contained in:
@@ -323,6 +323,25 @@ describe("price estimate input isolation", () => {
|
||||
const safe = JSON.stringify(publicEstimateContext(input));
|
||||
expect(safe).not.toMatch(/PRIVATE|CULPRIT|WRONG-OWNER|files\/claim/);
|
||||
});
|
||||
it("does not send the unrelated 111SE variant from a conflicting FAW inquiry", () => {
|
||||
const { claim, blame } = source();
|
||||
blame.parties[1].vehicle = {
|
||||
name: "فائو ( FAW )",
|
||||
model: "111SE",
|
||||
inquiry: {
|
||||
mapped: {
|
||||
MapTypNam: "فائو ( FAW )",
|
||||
SystemField: "سايپا",
|
||||
TypeField: "111SE",
|
||||
},
|
||||
},
|
||||
};
|
||||
const input = buildEstimateContext(claim, blame, {});
|
||||
expect(input.vehicle.make).toBe("فائو ( FAW )");
|
||||
expect(input.vehicle.model).toBeNull();
|
||||
expect(input.warnings.join(" ")).toContain("همخوان نیست");
|
||||
expect(JSON.stringify(publicEstimateContext(input))).not.toContain("111SE");
|
||||
});
|
||||
it("uses body insurance FIRST, expert-approved vehicle names and supplied current market value", () => {
|
||||
const { claim, blame } = source();
|
||||
blame.type = "CAR_BODY";
|
||||
|
||||
Reference in New Issue
Block a user