forked from Yara724/api
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { ClaimCaseStatus } from "src/Types&Enums/claim-request-management/claim-case-status.enum";
|
|
import { fanavaranClaimReferences } from "./fanavaran-claim-references";
|
|
|
|
describe("fanavaranClaimReferences", () => {
|
|
it("returns all four Fanavaran ids when the claim is completed", () => {
|
|
expect(
|
|
fanavaranClaimReferences({
|
|
status: ClaimCaseStatus.COMPLETED,
|
|
claimId: 987654,
|
|
claimNo: 123456,
|
|
dmgCaseId: 11,
|
|
expertiseId: 22,
|
|
}),
|
|
).toEqual({
|
|
claimId: 987654,
|
|
claimNo: 123456,
|
|
dmgCaseId: 11,
|
|
expertiseId: 22,
|
|
});
|
|
});
|
|
|
|
it("omits missing ids", () => {
|
|
expect(
|
|
fanavaranClaimReferences({
|
|
status: ClaimCaseStatus.COMPLETED,
|
|
claimId: 987654,
|
|
claimNo: null,
|
|
dmgCaseId: undefined,
|
|
expertiseId: 22,
|
|
}),
|
|
).toEqual({
|
|
claimId: 987654,
|
|
expertiseId: 22,
|
|
});
|
|
});
|
|
|
|
it("returns undefined before the claim is completed", () => {
|
|
expect(
|
|
fanavaranClaimReferences({
|
|
status: ClaimCaseStatus.EXPERT_REVIEWING,
|
|
claimId: 987654,
|
|
dmgCaseId: 11,
|
|
}),
|
|
).toBeUndefined();
|
|
});
|
|
});
|