forked from Yara724/api
Removed unncessary data from PDF
This commit is contained in:
@@ -324,6 +324,61 @@ describe("buildInsurerFileReport", () => {
|
||||
).toBe("1405/05/19 16:00");
|
||||
});
|
||||
|
||||
it("localizes every boolean value", () => {
|
||||
const report = buildInsurerFileReport({
|
||||
overview: { publicId: "A00015" },
|
||||
blame: {
|
||||
type: "CAR_BODY",
|
||||
parties: [
|
||||
{
|
||||
role: "FIRST",
|
||||
person: { userId: "damaged", fullName: "بیمهگذار" },
|
||||
vehicle: {
|
||||
isNew: true,
|
||||
hasEndorsement: false,
|
||||
source: "ESG_CAR_BODY_INQUIRY",
|
||||
inquiry: { source: "TEJARAT_BLOCK_INQUIRY" },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const fields = report.sections.flatMap((section) => section.fields);
|
||||
expect(fields.find((field) => field.label === "خودرو / خودرو نو")?.value).toBe(
|
||||
"بله",
|
||||
);
|
||||
expect(fields.some((field) => field.value === "خیر")).toBe(true);
|
||||
expect(fields.some((field) => field.value === "true")).toBe(false);
|
||||
expect(fields.some((field) => field.value === "false")).toBe(false);
|
||||
});
|
||||
|
||||
it("hides ESG and TEJARAT inquiry source details", () => {
|
||||
const report = buildInsurerFileReport({
|
||||
overview: { publicId: "A00016" },
|
||||
blame: {
|
||||
type: "CAR_BODY",
|
||||
parties: [
|
||||
{
|
||||
role: "FIRST",
|
||||
person: { userId: "damaged", fullName: "بیمهگذار" },
|
||||
vehicle: {
|
||||
source: "ESG_CAR_BODY_INQUIRY",
|
||||
inquiry: { source: "TEJARAT_BLOCK_INQUIRY" },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const fields = report.sections.flatMap((section) => section.fields);
|
||||
expect(fields.some((field) => String(field.value).includes("ESG"))).toBe(false);
|
||||
expect(fields.some((field) => String(field.value).includes("TEJARAT"))).toBe(
|
||||
false,
|
||||
);
|
||||
expect(fields.some((field) => field.label.includes("منبع"))).toBe(false);
|
||||
});
|
||||
|
||||
it("uses the stored V4 licence type for a driver who differs from the policyholder", () => {
|
||||
const report = buildInsurerFileReport({
|
||||
overview: { publicId: "A00011" },
|
||||
|
||||
Reference in New Issue
Block a user