From 6f28ab78ff9884bc8a9af01c30166321ccc325b0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 02:12:43 +0000 Subject: [PATCH] fix(e2e): scope B118 header description assert to list header Avoids Playwright strict-mode flakes when more than one header p matches. --- tests/e2e/campaignMunicipalities.e2e.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index f314d893..d6756add 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -54,7 +54,10 @@ test.describe('Municípios — list header mobile (B118)', () => { await expect(heading).toHaveClass(/sr-only/) const headingBox = await heading.boundingBox() expect(headingBox?.height ?? 0).toBeLessThanOrEqual(2) - await expect(page.locator('header p')).toBeHidden() + // Scope to the list page header (description is `hidden md:block`); avoid + // strict-mode flakes if React mounts more than one matching `

`. + const pageHeader = page.locator('header').filter({ has: heading }) + await expect(pageHeader.locator('p')).toBeHidden() await expect(page.locator('[data-scope="campaign"]')).toBeHidden() // B120: mobile uses the filter combobox; desktop search stays md+ only. await expect(page.getByLabel('Filtrar municípios')).toBeVisible()