ui pack redo
This commit is contained in:
@@ -127,6 +127,15 @@ async function ensureShell(page: Page): Promise<void> {
|
||||
await expect(page.locator('aside.sidebar')).toHaveCount(1, { timeout: 15000 });
|
||||
}
|
||||
|
||||
async function assertMainHasContent(page: Page): Promise<void> {
|
||||
const main = page.locator('main');
|
||||
await expect(main).toHaveCount(1);
|
||||
await expect(main).toBeVisible();
|
||||
const text = ((await main.textContent()) ?? '').replace(/\s+/g, '');
|
||||
const childNodes = await main.locator('*').count();
|
||||
expect(text.length > 12 || childNodes > 4).toBe(true);
|
||||
}
|
||||
|
||||
async function openSidebarGroupRoute(
|
||||
page: Page,
|
||||
groupLabel: string,
|
||||
@@ -168,8 +177,8 @@ test.describe('Nav shell canonical domains', () => {
|
||||
const labels = [
|
||||
'Dashboard',
|
||||
'Release Control',
|
||||
'Security and Risk',
|
||||
'Evidence and Audit',
|
||||
'Security & Risk',
|
||||
'Evidence & Audit',
|
||||
'Integrations',
|
||||
'Platform Ops',
|
||||
'Administration',
|
||||
@@ -200,7 +209,7 @@ test.describe('Nav shell critical legacy redirects', () => {
|
||||
{ from: '/admin/notifications', expectedPrefix: '/administration/notifications' },
|
||||
{ from: '/release-orchestrator/releases', expectedPrefix: '/release-control/releases' },
|
||||
{ from: '/release-orchestrator/approvals', expectedPrefix: '/release-control/approvals' },
|
||||
{ from: '/release-orchestrator/environments', expectedPrefix: '/release-control/environments' },
|
||||
{ from: '/release-orchestrator/environments', expectedPrefix: '/release-control/regions' },
|
||||
{ from: '/settings/release-control', expectedPrefix: '/release-control/setup' },
|
||||
];
|
||||
|
||||
@@ -239,7 +248,7 @@ test.describe('Nav shell breadcrumbs and stability', () => {
|
||||
{ path: '/release-control/releases', expected: 'Release Control' },
|
||||
{ path: '/release-control/setup', expected: 'Setup' },
|
||||
{ path: '/security-risk/advisory-sources', expected: 'Advisory Sources' },
|
||||
{ path: '/evidence-audit/replay', expected: 'Replay / Verify' },
|
||||
{ path: '/evidence-audit/replay', expected: 'Replay & Verify' },
|
||||
{ path: '/platform-ops/data-integrity', expected: 'Data Integrity' },
|
||||
{ path: '/administration/trust-signing', expected: 'Trust & Signing' },
|
||||
];
|
||||
@@ -296,6 +305,80 @@ test.describe('Nav shell breadcrumbs and stability', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Pack route render checks', () => {
|
||||
test('release-control pack routes render non-blank content', async ({ page }) => {
|
||||
test.setTimeout(60_000);
|
||||
|
||||
const routes = [
|
||||
'/release-control/control-plane',
|
||||
'/release-control/bundles',
|
||||
'/release-control/regions',
|
||||
'/release-control/governance',
|
||||
'/release-control/hotfixes',
|
||||
];
|
||||
|
||||
for (const route of routes) {
|
||||
await go(page, route);
|
||||
await ensureShell(page);
|
||||
const finalUrl = new URL(page.url());
|
||||
expect(finalUrl.pathname.startsWith(route)).toBe(true);
|
||||
await assertMainHasContent(page);
|
||||
}
|
||||
});
|
||||
|
||||
test('security and evidence pack routes render non-blank content', async ({ page }) => {
|
||||
test.setTimeout(60_000);
|
||||
|
||||
const routes = [
|
||||
'/security-risk/findings',
|
||||
'/security-risk/vulnerabilities',
|
||||
'/security-risk/vex',
|
||||
'/security-risk/sbom-lake',
|
||||
'/security-risk/exceptions',
|
||||
'/evidence-audit/packs',
|
||||
'/evidence-audit/bundles',
|
||||
'/evidence-audit/evidence/export',
|
||||
'/evidence-audit/audit-log',
|
||||
'/evidence-audit/trust-signing',
|
||||
];
|
||||
|
||||
for (const route of routes) {
|
||||
await go(page, route);
|
||||
await ensureShell(page);
|
||||
const finalUrl = new URL(page.url());
|
||||
expect(finalUrl.pathname.startsWith(route)).toBe(true);
|
||||
await assertMainHasContent(page);
|
||||
}
|
||||
});
|
||||
|
||||
test('platform-ops and integrations routes render via sidebar navigation', async ({ page }) => {
|
||||
test.setTimeout(60_000);
|
||||
|
||||
const platformOpsRoutes = [
|
||||
'/platform-ops/data-integrity',
|
||||
'/platform-ops/orchestrator',
|
||||
'/platform-ops/health',
|
||||
'/platform-ops/quotas',
|
||||
'/platform-ops/feeds',
|
||||
];
|
||||
|
||||
for (const route of platformOpsRoutes) {
|
||||
await go(page, '/dashboard');
|
||||
await openSidebarGroupRoute(page, 'Platform Ops', route);
|
||||
await expect(page).toHaveURL(new RegExp(`${route.replace(/\//g, '\\/')}$`));
|
||||
const currentPath = new URL(page.url()).pathname;
|
||||
expect(currentPath).toBe(route);
|
||||
await assertMainHasContent(page);
|
||||
}
|
||||
|
||||
await go(page, '/dashboard');
|
||||
await openSidebarGroupRoute(page, 'Integrations', '/integrations');
|
||||
await expect(page).toHaveURL(/\/integrations$/);
|
||||
expect(new URL(page.url()).pathname).toBe('/integrations');
|
||||
await assertMainHasContent(page);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Nav shell responsive layout', () => {
|
||||
test('desktop viewport shows sidebar', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 900 });
|
||||
|
||||
Reference in New Issue
Block a user