From af0738270f665c3fd3ba7b4f630e83cd7ac8ea30 Mon Sep 17 00:00:00 2001 From: Vishal Kumar Singh Date: Thu, 18 Jun 2026 10:58:32 +0530 Subject: [PATCH] test: cover settlement modal reason mapping --- tests/SettlementModal.test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/SettlementModal.test.tsx b/tests/SettlementModal.test.tsx index 1593520f..cef444ec 100644 --- a/tests/SettlementModal.test.tsx +++ b/tests/SettlementModal.test.tsx @@ -19,6 +19,17 @@ function renderSettlementModal(props: Partial { + it.each([ + [' commitment has NOT MATURED yet ', 'not_matured'], + ['Commitment has already been settled', 'already_settled'], + ['Commitment is disputed and cannot be settled', 'disputed'], + ['Commitment was closed through early exit', 'early_exit'], + ['Unexpected settlement preflight response', 'unknown'], + [undefined, 'unknown'], + ] as const)('maps %s to %s copy', (reason, category) => { + expect(getSettlementIneligibleReasonCopy(reason).category).toBe(category); + }); + it('maps a not-matured reason to a temporary layout and details CTA', () => { renderSettlementModal({ ineligibleReason: 'Commitment has not matured yet and cannot be settled.',