From 60580de79cc2e639764287f4d282c1afdab5a0ba Mon Sep 17 00:00:00 2001 From: master <> Date: Fri, 20 Feb 2026 07:22:12 +0200 Subject: [PATCH] test(web-ui): cover evidence home and trust route regressions --- .../context-chips.component.spec.ts | 15 ++++++ .../evidence-audit-overview.component.spec.ts | 49 ++++++++++++++----- .../tests/e2e/critical-path.spec.ts | 6 +-- 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/src/Web/StellaOps.Web/src/app/layout/context-chips/context-chips.component.spec.ts b/src/Web/StellaOps.Web/src/app/layout/context-chips/context-chips.component.spec.ts index 130497292..6946a7425 100644 --- a/src/Web/StellaOps.Web/src/app/layout/context-chips/context-chips.component.spec.ts +++ b/src/Web/StellaOps.Web/src/app/layout/context-chips/context-chips.component.spec.ts @@ -76,4 +76,19 @@ describe('ContextChipsComponent', () => { const text = (fixture.nativeElement as HTMLElement).textContent ?? ''; expect(text).toContain('DEGRADED'); }); + + it('links evidence chip to the canonical evidence trust-signing route', () => { + const fixture = TestBed.createComponent(ContextChipsComponent); + fixture.detectChanges(); + + const links = Array.from( + (fixture.nativeElement as HTMLElement).querySelectorAll('a') + ) as HTMLAnchorElement[]; + const evidenceLink = links.find((link) => + (link.textContent ?? '').includes('Evidence:') + ); + + expect(evidenceLink).toBeTruthy(); + expect(evidenceLink?.getAttribute('href')).toContain('/evidence-audit/trust-signing'); + }); }); diff --git a/src/Web/StellaOps.Web/src/tests/evidence-audit/evidence-audit-overview.component.spec.ts b/src/Web/StellaOps.Web/src/tests/evidence-audit/evidence-audit-overview.component.spec.ts index 6926028e0..bcfba555d 100644 --- a/src/Web/StellaOps.Web/src/tests/evidence-audit/evidence-audit-overview.component.spec.ts +++ b/src/Web/StellaOps.Web/src/tests/evidence-audit/evidence-audit-overview.component.spec.ts @@ -11,26 +11,49 @@ describe('EvidenceAuditOverviewComponent (evidence-audit)', () => { }).compileComponents(); }); - it('renders evidence home entry router sections', () => { + it('renders evidence home search router controls and quick views', () => { const fixture = TestBed.createComponent(EvidenceAuditOverviewComponent); fixture.detectChanges(); const text = fixture.nativeElement.textContent as string; - expect(text).toContain('Evidence Surfaces'); - expect(text).toContain('Evidence Packs'); - expect(text).toContain('Proof Chains'); - expect(text).toContain('Replay and Verify'); - expect(text).toContain('Timeline'); - expect(text).toContain('Audit Log'); + expect(text).toContain('Find Evidence'); + expect(text).toContain('Release'); + expect(text).toContain('Bundle Version'); + expect(text).toContain('Environment'); + expect(text).toContain('Approval'); + expect(text).toContain('Digest / Verdict / Bundle ID'); + expect(text).toContain('Latest promotion evidence packs'); + expect(text).toContain('Latest sealed bundles'); + expect(text).toContain('Failed verification / replay'); + expect(text).toContain('Expiring trust/certs'); }); - it('keeps trust ownership deep-link under administration', () => { + it('keeps the 5 required pack shortcuts including trust ownership deep-link', () => { const fixture = TestBed.createComponent(EvidenceAuditOverviewComponent); fixture.detectChanges(); const links = Array.from(fixture.nativeElement.querySelectorAll('a')) as HTMLAnchorElement[]; - const trustLink = links.find((link) => link.getAttribute('href')?.includes('/administration/trust-signing')); + const trustLink = links.find((link) => + link.getAttribute('href')?.includes('/evidence-audit/trust-signing') + ); + const exportLink = links.find((link) => + link.getAttribute('href')?.includes('/evidence-audit/evidence') + ); + const bundlesLink = links.find((link) => + link.getAttribute('href')?.includes('/evidence-audit/bundles') + ); + const replayLink = links.find((link) => + link.getAttribute('href')?.includes('/evidence-audit/replay') + ); + const proofsLink = links.find((link) => + link.getAttribute('href')?.includes('/evidence-audit/proofs') + ); + expect(trustLink).toBeTruthy(); + expect(exportLink).toBeTruthy(); + expect(bundlesLink).toBeTruthy(); + expect(replayLink).toBeTruthy(); + expect(proofsLink).toBeTruthy(); }); it('supports degraded state banner', () => { @@ -48,7 +71,7 @@ describe('EvidenceAuditOverviewComponent (evidence-audit)', () => { expect((fixture.nativeElement.textContent as string)).toContain('Evidence index is degraded'); }); - it('supports deterministic empty state', () => { + it('supports deterministic empty quick views state', () => { const fixture = TestBed.createComponent(EvidenceAuditOverviewComponent); fixture.detectChanges(); @@ -61,7 +84,9 @@ describe('EvidenceAuditOverviewComponent (evidence-audit)', () => { fixture.detectChanges(); const text = fixture.nativeElement.textContent as string; - expect(text).toContain('No evidence records are available yet'); - expect(text).toContain('Open Release Control Promotions'); + expect(text).toContain('No packs in the selected window.'); + expect(text).toContain('No bundles sealed in the selected window.'); + expect(text).toContain('No failed replay jobs in the selected window.'); + expect(text).toContain('No trust certificates nearing expiration.'); }); }); diff --git a/src/Web/StellaOps.Web/tests/e2e/critical-path.spec.ts b/src/Web/StellaOps.Web/tests/e2e/critical-path.spec.ts index a8e04c388..e0c09ca66 100644 --- a/src/Web/StellaOps.Web/tests/e2e/critical-path.spec.ts +++ b/src/Web/StellaOps.Web/tests/e2e/critical-path.spec.ts @@ -331,12 +331,12 @@ test.describe('Critical path shell verification', () => { await go(page, '/evidence-audit'); await expect(page).toHaveURL(/\/evidence-audit$/); await ensureShell(page); - await expect(page.locator('body')).toContainText('Evidence Surfaces'); - await expect(page.locator('a[href="/administration/trust-signing"]').first()).toBeVisible(); + await expect(page.locator('body')).toContainText('Find Evidence'); + await expect(page.locator('a[href="/evidence-audit/trust-signing"]').first()).toBeVisible(); await go(page, '/evidence-audit/replay'); await expect(page).toHaveURL(/\/evidence-audit\/replay$/); - await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Replay / Verify'); + await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Replay & Verify'); await go(page, '/evidence-audit/timeline'); await expect(page).toHaveURL(/\/evidence-audit\/timeline$/);