From 4fbb92b886a6b1c94d7f686dde5a37270e617572 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 9 Aug 2026 12:42:21 -0300 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20C95=20=E2=80=94=20grid=20asserts=20?= =?UTF-8?q?com=20first()=20(FC=20v7=20mant=C3=A9m=20grids=20antigos=20no?= =?UTF-8?q?=20DOM)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/campaignActivity.e2e.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/e2e/campaignActivity.e2e.spec.ts b/tests/e2e/campaignActivity.e2e.spec.ts index 3ccb532d..9fb06499 100644 --- a/tests/e2e/campaignActivity.e2e.spec.ts +++ b/tests/e2e/campaignActivity.e2e.spec.ts @@ -290,13 +290,14 @@ test.describe('Agenda — calendário operacional', () => { // Desktop: switch to month; the URL gains `view=month` and the calendar // actually renders the month grid (not just the selector label). The // FullCalendar v7 classic theme hashes its view classes, so the stable - // signal is the "Hoje" button's aria-label ("Este mês") plus the grid. + // signal is the "Hoje" button's aria-label ("Este mês") plus a grid. + // (`.first()`: FC keeps stale view grids in the DOM while transitioning.) await viewSelector.click() await page.getByRole('menuitemradio', { name: 'Mês', exact: true }).click() await expect(page).toHaveURL(`${campaign.baseURL}/campanha/agenda?view=month`) await expect(viewSelector).toHaveAttribute('aria-label', 'Modo de visualização: Mês') await expect(page.getByRole('button', { name: 'Este mês' })).toBeVisible({ timeout: 15_000 }) - await expect(page.locator('[role="grid"]')).toBeVisible() + await expect(page.getByRole('grid').first()).toBeVisible() // Persists across a reload (screen state lives beside the filter, on the URL). await page.reload() @@ -324,7 +325,7 @@ test.describe('Agenda — calendário operacional', () => { await expect(page).toHaveURL(`${campaign.baseURL}/campanha/agenda?view=list`) await expect(viewSelector).toHaveAttribute('aria-label', 'Modo de visualização: Lista') await expect(page.getByRole('button', { name: 'Este mês' })).toBeVisible({ timeout: 15_000 }) - await expect(page.locator('[role="grid"]')).toHaveCount(0, { timeout: 15_000 }) + await expect(page.getByRole('grid')).toHaveCount(0, { timeout: 15_000 }) // A navigation that drops the `view` param returns the calendar to the // responsive default instead of keeping an orphan view the selector no @@ -335,6 +336,6 @@ test.describe('Agenda — calendário operacional', () => { await expect(page.getByRole('button', { name: 'Hoje', exact: true })).toBeVisible({ timeout: 15_000, }) - await expect(page.locator('[role="grid"]')).toBeVisible() + await expect(page.getByRole('grid').first()).toBeVisible() }) })