test(e2e): check scroll overflow and capability states on every route

Both loops read the route list, so activity, policies and config join the overflow check and a new page is covered without editing the spec.
This commit is contained in:
Zakk committed 2026-09-26 04:47:54 +10:00
1 parent 29327acf9d
commit ccfe56ae49
2 files changed
+10 -9

No files matched your search

+4 -6
View File
@@ -122,13 +122,11 @@ test.describe('first-release backend', () => {
await expect(page.locator('.rp-strip')).toBeVisible();
await expect(page.locator('.rp-nav')).toHaveCount(routes.length);
await expect(page.locator('.rp-nav:not([data-unavailable])')).toHaveText(['Overview', 'Activity', 'Connections', 'Settings']);
for (const route of ['overview', 'connections', 'settings'] as const) {
await page.goto(`/#/${route}`);
await expect(page.locator('.rp-nav[href="#/' + route + '"]')).toHaveAttribute('aria-current', 'page');
await expect(page.locator('.rp-content')).toBeVisible();
}
for (const route of routes.filter(r => !['activity', 'overview', 'connections', 'settings'].includes(r))) {
// Every page loads, the offered ones as the current navigation entry and the rest in their unavailable state.
const offeredPages: readonly string[] = ['activity', 'overview', 'connections', 'settings'];
for (const route of routes) {
await page.goto(`/#/${route}`);
if (offeredPages.includes(route)) await expect(page.locator('.rp-nav[href="#/' + route + '"]')).toHaveAttribute('aria-current', 'page');
await expect(page.locator('.rp-content')).toBeVisible();
}
await page.goto('/#/connections?tab=list');
+6 -3
View File
@@ -1,4 +1,5 @@
import {expect, isLive, offered, test} from './fixtures';
import {expect, isLive, offered, routes, test} from './fixtures';
import type {RoutePath} from '../src/shell/routes';
for (const width of [1024, 1280, 1440]) {
test(`desktop tables fit their scrollports at ${width}px`, async ({page}) => {
@@ -63,12 +64,14 @@ test('narrow tables retain readable columns and stop scrolling after a desktop r
});
// A scroll container that overflows by a pixel grows a scrollbar; every palette family is held to zero overflow.
// Pages whose default tab holds no table are checked on the tab that does.
const tableTab: Partial<Record<RoutePath, string>> = {dns: 'cache', rules: 'list'};
for (const palette of ['glass/glass', 'rose-pine/moon', 'catppuccin/mocha']) {
test.describe(`${palette} scroll containers`, () => {
test.use({storage: {'doona-palette': palette}});
test('no scroll container overflows sideways without content that needs it', async ({page}) => {
for (const route of ['overview', 'connections', 'dns?tab=cache', 'rules?tab=list', 'nodes', 'events', 'logs', 'settings']) {
await page.goto(`/#/${route}`);
for (const route of routes) {
await page.goto(`/#/${route}${tableTab[route] ? `?tab=${tableTab[route]}` : ''}`);
await expect(page.locator('.rp-content').getByRole('heading').first()).toBeVisible();
await page.waitForFunction(() => !document.querySelector('.rp-content .rp-empty[role=status]'));
const spurious = await page.evaluate(() =>