From 4cb21576c2f4cfc6379eb13124f4802f4fd19702 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 19:46:39 +0000 Subject: [PATCH] =?UTF-8?q?B129=20=E2=80=94=20Anchor=20trend-control=20E2E?= =?UTF-8?q?=20regex=20per=20codebase=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/campaignMunicipalities.e2e.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index 17815532..c94bd825 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -154,7 +154,7 @@ test.describe('Municípios — jornadas por papel', () => { await expect(campaignPageChrome(page, 'Municípios')).toBeVisible() const trendButton = page.getByRole('button', { - name: new RegExp(`Editar tendência política em ${municipality.name}`), + name: new RegExp(`^Editar tendência política em ${municipality.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`), }) await trendButton.click() const trendPopover = page.locator('[data-slot="popover-content"]') @@ -172,7 +172,12 @@ test.describe('Municípios — jornadas por papel', () => { await page.keyboard.press('Escape') await page.reload() - await trendButton.click() + await expect(campaignPageChrome(page, 'Municípios')).toBeVisible() + await page + .getByRole('button', { + name: new RegExp(`^Editar tendência política em ${municipality.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`), + }) + .click() const reopened = page.locator('[data-slot="popover-content"]') await expect(reopened.getByLabel('Tendência', { exact: true })).toHaveValue('favoravel') await expect(reopened.getByLabel('Justificativa')).toHaveValue(note)