From 1968ba210c2f66552725c3bd392802cd3edaede3 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 12 Jul 2026 03:18:07 +0100 Subject: [PATCH] test(frontend): de-brittle actionAudit verified-outcome assertion The 'trusted action review workspace' change (e13abf84f) reworked the verified verification-outcome copy, breaking a branchcov2 assertion that hard-coded the old label/detail. Assert 'VERIFIED' normalises to the canonical 'verified' result instead of exact copy, so the test stays focused on the toLowerCase branch. --- .../actionAuditPresentation.branchcov2.test.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts index 3c3f3a017..8b0d2e6c5 100644 --- a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts +++ b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts @@ -252,17 +252,19 @@ describe('actionAuditPresentation branch coverage (supplemental)', () => { }); it('normalises uppercase status to the canonical map key via toLowerCase()', () => { + // 'VERIFIED' must lowercase to the canonical 'verified' key and resolve to + // the same presentation. Asserting equality against the canonical result + // (rather than hard-coded copy) keeps this focused on the normalisation + // branch and robust to label/detail wording changes. + const canonical = getActionAuditVerificationOutcomePresentation({ + verificationOutcome: { status: 'verified' }, + }); + expect(canonical).toBeDefined(); expect( getActionAuditVerificationOutcomePresentation({ verificationOutcome: { status: 'VERIFIED' }, }), - ).toStrictEqual({ - label: 'Verification confirmed', - detail: 'Pulse confirmed the intended state after execution.', - evidenceSummary: undefined, - className: - 'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300', - }); + ).toStrictEqual(canonical); }); it('collapses a whitespace-only evidenceSummary to undefined', () => {