From 3440923cb0dd676b1949f01af43674591c4c8967 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 8 Jul 2026 12:08:46 +0100 Subject: [PATCH] Exercise the mobile settings drawer in the shell-consistency spec On mobile viewports the settings navigation sits behind the Settings drawer trigger rather than a persistent sidebar, and panel descriptions are desktop-only copy (hidden sm:block). The spec now opens the drawer before asserting the shared navigation and search on mobile projects and scopes the description assertion to desktop, instead of failing on a sidebar mobile intentionally does not show. --- .../15-settings-shell-consistency.spec.ts | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/integration/tests/15-settings-shell-consistency.spec.ts b/tests/integration/tests/15-settings-shell-consistency.spec.ts index ba7edcbaf..55d1f2894 100644 --- a/tests/integration/tests/15-settings-shell-consistency.spec.ts +++ b/tests/integration/tests/15-settings-shell-consistency.spec.ts @@ -89,22 +89,36 @@ test.describe('Settings shell consistency', () => { test.setTimeout(180_000); for (const panel of SETTINGS_SHELL_ROUTES) { - test(`uses the canonical shell on ${panel.route}`, async ({ page }) => { + test(`uses the canonical shell on ${panel.route}`, async ({ page, isMobile }) => { await page.goto(panel.route, { waitUntil: 'domcontentloaded' }); await page.waitForURL(/\/settings/, { timeout: 15_000 }); + if (isMobile) { + // Mobile keeps the settings navigation behind the Settings drawer + // trigger instead of a persistent sidebar. + await page + .getByRole('main') + .getByRole('button', { name: 'Settings', exact: true }) + .first() + .click(); + } + const navigation = page.locator('[aria-label="Settings navigation"]'); await expect(navigation, `${panel.route} should keep the shared settings navigation`).toBeVisible(); const searchInput = page.getByPlaceholder('Search settings...'); await expect(searchInput, `${panel.route} should keep the shared settings search`).toBeVisible(); + const pageHeading = page.getByRole('heading', { level: 1, name: panel.title }); await expect(pageHeading, `${panel.route} should render the canonical page-shell heading`).toBeVisible(); - await expect( - page.getByText(panel.description, { exact: true }).first(), - `${panel.route} should render the canonical page-shell description`, - ).toBeVisible(); + if (!isMobile) { + // Panel descriptions are desktop-only copy (hidden sm:block). + await expect( + page.getByText(panel.description, { exact: true }).first(), + `${panel.route} should render the canonical page-shell description`, + ).toBeVisible(); + } await expect( page.locator('h1'),