Files
yara724-api/src/helpers/claim-v2-expert-reply-workflow.spec.ts
2026-09-01 15:03:08 +03:30

38 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ClaimCaseStatus } from "src/Types&Enums/claim-request-management/claim-case-status.enum";
import { claimCaseStatusAfterExpertReplyV2 } from "./claim-v2-expert-reply-workflow";
describe("claimCaseStatusAfterExpertReplyV2", () => {
it("keeps V1 priced-only claims in their final owner-signature state", () => {
expect(
claimCaseStatusAfterExpertReplyV2([
{ factorNeeded: false },
{ factorNeeded: false },
]),
).toBe(ClaimCaseStatus.INSURER_REVIEW_AWAITING_OWNER_SIGN);
});
it("completes a V2–V5 priced-only claim without a final owner signature", () => {
expect(
claimCaseStatusAfterExpertReplyV2(
[{ factorNeeded: false }, { factorNeeded: false }],
true,
),
).toBe(ClaimCaseStatus.COMPLETED);
});
it("keeps factor-required claims in their factor collection workflow", () => {
expect(
claimCaseStatusAfterExpertReplyV2([{ factorNeeded: true }]),
).toBe(ClaimCaseStatus.OWNER_REPAIR_FACTOR_UPLOAD_PENDING);
});
it("keeps the priced-line acceptance gate for mixed factor claims", () => {
expect(
claimCaseStatusAfterExpertReplyV2([
{ factorNeeded: false },
{ factorNeeded: true },
]),
).toBe(ClaimCaseStatus.INSURER_REVIEW_MIXED_FACTORS_PENDING);
});
});