mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-09 16:00:59 +00:00
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.
This commit is contained in:
parent
75047c0dfc
commit
3440923cb0
1 changed files with 19 additions and 5 deletions
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue