ui fixes
This commit is contained in:
@@ -9,6 +9,7 @@ const shellSession = {
|
||||
...policyAuthorSession.scopes,
|
||||
'ui.read',
|
||||
'admin',
|
||||
'ui.admin',
|
||||
'orch:read',
|
||||
'orch:operate',
|
||||
'orch:quota',
|
||||
@@ -23,6 +24,19 @@ const shellSession = {
|
||||
'exceptions:read',
|
||||
'exceptions:approve',
|
||||
'aoc:verify',
|
||||
'policy:read',
|
||||
'policy:author',
|
||||
'policy:review',
|
||||
'policy:approve',
|
||||
'policy:simulate',
|
||||
'policy:audit',
|
||||
'health:read',
|
||||
'notify:viewer',
|
||||
'release:read',
|
||||
'release:write',
|
||||
'release:publish',
|
||||
'sbom:read',
|
||||
'signer:read',
|
||||
]),
|
||||
],
|
||||
};
|
||||
@@ -79,184 +93,36 @@ async function setupShell(page: Page): Promise<void> {
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(mockConfig),
|
||||
})
|
||||
}),
|
||||
);
|
||||
await page.route('**/config.json', (route) =>
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(mockConfig),
|
||||
})
|
||||
}),
|
||||
);
|
||||
await page.route('**/authority/.well-known/openid-configuration', (route) =>
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(oidcConfig),
|
||||
})
|
||||
}),
|
||||
);
|
||||
await page.route('**/.well-known/openid-configuration', (route) =>
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(oidcConfig),
|
||||
})
|
||||
}),
|
||||
);
|
||||
await page.route('**/authority/.well-known/jwks.json', (route) =>
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ keys: [] }),
|
||||
})
|
||||
}),
|
||||
);
|
||||
await page.route('**/authority/connect/**', (route) =>
|
||||
route.fulfill({
|
||||
status: 400,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ error: 'not-used-in-critical-path-e2e' }),
|
||||
})
|
||||
);
|
||||
|
||||
await page.route('**/api/v1/advisory-sources**', (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
const path = url.pathname;
|
||||
|
||||
if (path === '/api/v1/advisory-sources') {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
items: [
|
||||
{
|
||||
sourceId: 'src-nvd',
|
||||
sourceKey: 'nvd',
|
||||
sourceName: 'NVD',
|
||||
sourceFamily: 'nvd',
|
||||
sourceUrl: 'https://nvd.nist.gov',
|
||||
priority: 10,
|
||||
enabled: true,
|
||||
lastSyncAt: '2026-02-19T08:00:00Z',
|
||||
lastSuccessAt: '2026-02-19T08:00:00Z',
|
||||
freshnessAgeSeconds: 1200,
|
||||
freshnessSlaSeconds: 7200,
|
||||
freshnessStatus: 'warning',
|
||||
signatureStatus: 'signed',
|
||||
lastError: null,
|
||||
syncCount: 14,
|
||||
errorCount: 0,
|
||||
totalAdvisories: 12345,
|
||||
signedAdvisories: 12300,
|
||||
unsignedAdvisories: 45,
|
||||
signatureFailureCount: 0,
|
||||
},
|
||||
],
|
||||
totalCount: 1,
|
||||
dataAsOf: '2026-02-19T08:00:00Z',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (path === '/api/v1/advisory-sources/summary') {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
totalSources: 1,
|
||||
healthySources: 1,
|
||||
warningSources: 0,
|
||||
staleSources: 0,
|
||||
unavailableSources: 0,
|
||||
disabledSources: 0,
|
||||
conflictingSources: 0,
|
||||
dataAsOf: '2026-02-19T08:00:00Z',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (path.endsWith('/impact')) {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
sourceId: 'src-nvd',
|
||||
sourceFamily: 'nvd',
|
||||
region: null,
|
||||
environment: null,
|
||||
impactedDecisionsCount: 2,
|
||||
impactSeverity: 'medium',
|
||||
lastDecisionAt: '2026-02-19T08:05:00Z',
|
||||
decisionRefs: [
|
||||
{
|
||||
decisionId: 'apr-001',
|
||||
decisionType: 'approval',
|
||||
label: 'Approval apr-001',
|
||||
route: '/release-control/approvals/apr-001',
|
||||
},
|
||||
],
|
||||
dataAsOf: '2026-02-19T08:00:00Z',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (path.endsWith('/conflicts')) {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
sourceId: 'src-nvd',
|
||||
status: 'open',
|
||||
limit: 50,
|
||||
offset: 0,
|
||||
totalCount: 0,
|
||||
items: [],
|
||||
dataAsOf: '2026-02-19T08:00:00Z',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (path.endsWith('/freshness')) {
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
source: {
|
||||
sourceId: 'src-nvd',
|
||||
sourceKey: 'nvd',
|
||||
sourceName: 'NVD',
|
||||
sourceFamily: 'nvd',
|
||||
sourceUrl: 'https://nvd.nist.gov',
|
||||
priority: 10,
|
||||
enabled: true,
|
||||
lastSyncAt: '2026-02-19T08:00:00Z',
|
||||
lastSuccessAt: '2026-02-19T08:00:00Z',
|
||||
freshnessAgeSeconds: 1200,
|
||||
freshnessSlaSeconds: 7200,
|
||||
freshnessStatus: 'warning',
|
||||
signatureStatus: 'signed',
|
||||
lastError: null,
|
||||
syncCount: 14,
|
||||
errorCount: 0,
|
||||
totalAdvisories: 12345,
|
||||
signedAdvisories: 12300,
|
||||
unsignedAdvisories: 45,
|
||||
signatureFailureCount: 0,
|
||||
},
|
||||
lastSyncAt: '2026-02-19T08:00:00Z',
|
||||
lastSuccessAt: '2026-02-19T08:00:00Z',
|
||||
lastError: null,
|
||||
syncCount: 14,
|
||||
errorCount: 0,
|
||||
dataAsOf: '2026-02-19T08:00:00Z',
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
return route.fulfill({
|
||||
status: 404,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ error: 'not mocked in critical-path e2e' }),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function go(page: Page, path: string): Promise<void> {
|
||||
@@ -268,23 +134,6 @@ async function ensureShell(page: Page): Promise<void> {
|
||||
await expect(page.locator('aside.sidebar')).toHaveCount(1, { timeout: 15000 });
|
||||
}
|
||||
|
||||
async function openSidebarGroupRoute(
|
||||
page: Page,
|
||||
groupLabel: string,
|
||||
targetHref: string
|
||||
): Promise<void> {
|
||||
const sidebar = page.locator('aside.sidebar');
|
||||
const targetLink = sidebar.locator(`a[href="${targetHref}"]`).first();
|
||||
const isVisible = await targetLink.isVisible().catch(() => false);
|
||||
|
||||
if (!isVisible) {
|
||||
await sidebar.getByRole('button', { name: groupLabel, exact: true }).click();
|
||||
}
|
||||
|
||||
await expect(targetLink).toBeVisible();
|
||||
await targetLink.click();
|
||||
}
|
||||
|
||||
test.describe.configure({ mode: 'serial' });
|
||||
|
||||
test.describe('Critical path shell verification', () => {
|
||||
@@ -292,69 +141,46 @@ test.describe('Critical path shell verification', () => {
|
||||
await setupShell(page);
|
||||
});
|
||||
|
||||
test('dashboard to release-control setup/bundles/promotions/runs renders canonical flow', async ({
|
||||
page,
|
||||
}) => {
|
||||
await go(page, '/dashboard');
|
||||
await expect(page).toHaveURL(/\/dashboard$/);
|
||||
test('mission-control to releases run flow renders canonical breadcrumbs', async ({ page }) => {
|
||||
await go(page, '/mission-control/board');
|
||||
await ensureShell(page);
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Dashboard');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Mission Board');
|
||||
|
||||
await go(page, '/release-control/setup');
|
||||
await expect(page).toHaveURL(/\/release-control\/setup$/);
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Setup');
|
||||
await go(page, '/releases/versions');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Release Versions');
|
||||
|
||||
await go(page, '/release-control/bundles');
|
||||
await expect(page).toHaveURL(/\/release-control\/bundles$/);
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Bundles');
|
||||
await go(page, '/releases/promotion-queue');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Promotion Queue');
|
||||
|
||||
await go(page, '/release-control/promotions');
|
||||
await expect(page).toHaveURL(/\/release-control\/promotions$/);
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Promotions');
|
||||
|
||||
await go(page, '/release-control/runs');
|
||||
await expect(page).toHaveURL(/\/release-control\/runs$/);
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Run Timeline');
|
||||
await go(page, '/releases/runs');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Release Runs');
|
||||
});
|
||||
|
||||
test('security advisory sources preserves ownership split links', async ({ page }) => {
|
||||
await go(page, '/security-risk/advisory-sources');
|
||||
await expect(page).toHaveURL(/\/security-risk\/advisory-sources$/);
|
||||
test('security advisories workflow remains user-reachable', async ({ page }) => {
|
||||
await go(page, '/security/advisories-vex');
|
||||
await ensureShell(page);
|
||||
await expect(page.locator('body')).toContainText('Advisory Sources');
|
||||
await expect(page.locator('a[href*="/integrations/feeds"]').first()).toBeVisible();
|
||||
await expect(page.locator('a[href*="/platform-ops/feeds"]').first()).toBeVisible();
|
||||
await expect(page.locator('a[href*="/security-risk/findings"]').first()).toBeVisible();
|
||||
await expect(page.locator('body')).toContainText(/Advisories|VEX|Disposition/i);
|
||||
});
|
||||
|
||||
test('evidence routes expose replay, timeline, proofs, and trust ownership link', async ({ page }) => {
|
||||
await go(page, '/evidence-audit');
|
||||
await expect(page).toHaveURL(/\/evidence-audit$/);
|
||||
await ensureShell(page);
|
||||
await expect(page.locator('body')).toContainText('Find Evidence');
|
||||
await expect(page.locator('a[href="/evidence-audit/trust-signing"]').first()).toBeVisible();
|
||||
test('evidence workflow exposes overview, verify/replay, and proofs', async ({ page }) => {
|
||||
await go(page, '/evidence/overview');
|
||||
await expect(page.locator('body')).toContainText(/Evidence/i);
|
||||
|
||||
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 go(page, '/evidence/verify-replay');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Verify & Replay');
|
||||
|
||||
await go(page, '/evidence-audit/timeline');
|
||||
await expect(page).toHaveURL(/\/evidence-audit\/timeline$/);
|
||||
await expect(page.getByRole('heading', { name: /Timeline/i }).first()).toBeVisible();
|
||||
|
||||
await go(page, '/evidence-audit/proofs');
|
||||
await expect(page).toHaveURL(/\/evidence-audit\/proofs$/);
|
||||
await go(page, '/evidence/proofs');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Proof Chains');
|
||||
});
|
||||
|
||||
test('integrations and platform-ops split navigation remains intact', async ({ page }) => {
|
||||
await go(page, '/dashboard');
|
||||
await ensureShell(page);
|
||||
await expect(page.locator('aside.sidebar')).toContainText('Integrations');
|
||||
test('ops and setup workspaces remain distinct', async ({ page }) => {
|
||||
await go(page, '/ops/operations/data-integrity');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Data Integrity');
|
||||
|
||||
await openSidebarGroupRoute(page, 'Platform Ops', '/platform-ops/data-integrity');
|
||||
await expect(page).toHaveURL(/\/platform-ops\/data-integrity$/);
|
||||
await expect(page.locator('body')).toContainText('Data Integrity');
|
||||
await expect(page.locator('a[href="/security-risk/advisory-sources"]').first()).toBeVisible();
|
||||
await go(page, '/ops/policy');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Policy');
|
||||
|
||||
await go(page, '/setup/topology/agents');
|
||||
await expect(page.locator('app-breadcrumb nav.breadcrumb')).toContainText('Agent Fleet');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user