forked from Yara724/api
fix: align inquiry errors and expert review rules
This commit is contained in:
@@ -78,6 +78,34 @@ describe("RequestManagementService policyholder inquiry routing", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("propagates the mapped ESG Persian error for third-party insurance", async () => {
|
||||
const service = Object.create(RequestManagementService.prototype) as any;
|
||||
service.sandHubService = {
|
||||
getTejaratBlockInquiry: jest.fn().mockResolvedValue({
|
||||
raw: {
|
||||
success: false,
|
||||
error: {
|
||||
code: "RECORD_NOT_FOUND",
|
||||
message: "Provider request failed",
|
||||
messageFa: "رکوردی یافت نشد",
|
||||
},
|
||||
},
|
||||
mapped: { Error: { Message: "رکوردی یافت نشد" } },
|
||||
}),
|
||||
};
|
||||
const submission = service.normalizeInquiryInput(
|
||||
BlameRequestType.THIRD_PARTY,
|
||||
participantInput(BlameRequestType.THIRD_PARTY),
|
||||
);
|
||||
|
||||
await expect(
|
||||
service.getThirdPartyPlateInquiry(submission),
|
||||
).rejects.toThrow("رکوردی یافت نشد");
|
||||
expect(service.sandHubService.getTejaratBlockInquiry).toHaveBeenCalledTimes(
|
||||
1,
|
||||
);
|
||||
});
|
||||
|
||||
it("does not fall back from the current plate for car-body insurance", async () => {
|
||||
const service = Object.create(RequestManagementService.prototype) as any;
|
||||
service.sandHubService = {
|
||||
|
||||
Reference in New Issue
Block a user