B118 — fix mobile header e2e: sr-only h1 stays a11y-visible to Playwright

This commit is contained in:
Cursor Agent 2026-08-02 01:20:06 +00:00
parent 96d20ae8b2
commit 3b0a6afdf4
No known key found for this signature in database

View file

@ -50,7 +50,12 @@ test.describe('Municípios — list header mobile (B118)', () => {
await campaign.login(page, coordinator.email!, coordinator.password)
await page.goto(`${campaign.baseURL}/campanha/municipios`)
await expect(page.getByRole('heading', { name: 'Municípios', exact: true })).toBeHidden()
const heading = page.getByRole('heading', { name: 'Municípios', exact: true })
await expect(heading).toHaveClass(/sr-only/)
const headingBox = await heading.boundingBox()
expect(headingBox?.height ?? 0).toBeLessThanOrEqual(2)
await expect(page.locator('header p')).toBeHidden()
await expect(page.locator('[data-scope="campaign"]')).toBeHidden()
await expect(page.getByLabel('Buscar município')).toBeVisible()
await expect(page.getByText(/\d+ municípios encontrados/)).toBeVisible()
})