forked from Yara724/api
expert codes
This commit is contained in:
@@ -104,4 +104,29 @@ describe("Fanavaran assigned ClaimExpertId resolution", () => {
|
||||
}),
|
||||
).rejects.toBeInstanceOf(BadRequestException);
|
||||
});
|
||||
|
||||
it("preview soft-resolve returns null plus a concrete warning instead of throwing", async () => {
|
||||
const management = serviceWithStaff({});
|
||||
await expect(
|
||||
(management as any).resolveFanavaranBaseClaimExpertId(
|
||||
{
|
||||
type: BlameRequestType.THIRD_PARTY,
|
||||
expert: { assignedExpertId: "missing" },
|
||||
},
|
||||
null,
|
||||
{ required: false },
|
||||
),
|
||||
).resolves.toBeNull();
|
||||
|
||||
const soft = await (management as any).tryResolveFanavaranBaseClaimExpertId(
|
||||
{
|
||||
type: BlameRequestType.THIRD_PARTY,
|
||||
expert: { assignedExpertId: "missing" },
|
||||
},
|
||||
);
|
||||
expect(soft.claimExpertId).toBeNull();
|
||||
expect(soft.code).toBe("FANAVARAN_CLAIM_EXPERT_ID_MISSING");
|
||||
expect(soft.message).toMatch(/ThirdPartyClaimExpertId/);
|
||||
expect(soft.candidatesTried).toEqual(["missing"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user