test(web-ui): cover evidence home and trust route regressions
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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$/);
|
||||
|
||||
Reference in New Issue
Block a user