Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

test(frontend): de-brittle actionAudit verified-outcome assertion

rcourtman1968ba210c2f
diff --git a/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts b/frontend-modern/src/utils/__tests__/actionAuditPresentation.branchcov2.test.ts
index 3c3f3a017d..8b0d2e6c57 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', () => {