From cd4698571a26da593700c3eab1823f41af40329f Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 9 Aug 2026 03:50:25 -0300 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20first()=20em=20asserts=20com=20dupl?= =?UTF-8?q?ica=C3=A7=C3=A3o=20transit=C3=B3ria=20de=20RSC=20pending=20(fla?= =?UTF-8?q?ke=20pr=C3=A9-existente,=20base=20reproduz)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/campaignMunicipalities.e2e.spec.ts | 3 +++ tests/e2e/campaignTerritories.e2e.spec.ts | 6 ++++-- tests/e2e/campaignWebAuthn.e2e.spec.ts | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index f8d12969..8bb83dc3 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -130,7 +130,10 @@ test.describe('Municípios — jornadas por papel', () => { await expect(page.getByText('Otimista: 5.000').nth(0)).toBeVisible() // B145: assessoria left the detail hero; it still appears on the dossiê tab. + // `.first()`: transient RSC-pending duplication also duplicates this line + // (same strict-mode flake as the "Otimista" assert above). await page.goto(`${campaign.baseURL}/campanha/municipios/${municipality.slug}?tab=dossie`) + // `.nth(0)`: same transient hydration duplicate the "Otimista: 5.000" // assertion pins — the server-composed slot briefly renders twice. await expect(page.getByText(`Assessoria: ${advisor.name}`).nth(0)).toBeVisible() diff --git a/tests/e2e/campaignTerritories.e2e.spec.ts b/tests/e2e/campaignTerritories.e2e.spec.ts index 8a55cf44..8bdaa5db 100644 --- a/tests/e2e/campaignTerritories.e2e.spec.ts +++ b/tests/e2e/campaignTerritories.e2e.spec.ts @@ -51,8 +51,10 @@ test.describe('Territórios de Identidade', () => { await campaign.login(page, email, password) await page.goto('/campanha/territorios') - await expect(page.locator('#ti-irece')).toBeVisible() - await expect(page.locator('#ti-velho-chico')).toBeVisible() + // `.first()`: transient RSC-pending duplication copies the rows (observed + // strict-mode flake on loaded machines; CI stays green). + await expect(page.locator('#ti-irece').first()).toBeVisible() + await expect(page.locator('#ti-velho-chico').first()).toBeVisible() }) test('a wide panel surfaces the read-only network columns; Cobertura stays hidden by default', async ({ diff --git a/tests/e2e/campaignWebAuthn.e2e.spec.ts b/tests/e2e/campaignWebAuthn.e2e.spec.ts index 8cf2561c..417d9c24 100644 --- a/tests/e2e/campaignWebAuthn.e2e.spec.ts +++ b/tests/e2e/campaignWebAuthn.e2e.spec.ts @@ -85,7 +85,9 @@ test('enrolls a passkey, signs in with it, then revokes it', async ({ await page.getByRole('button', { name: 'Ativar neste aparelho' }).click() await expect(page.getByText('Celular da assessora')).toBeVisible({ timeout: CEREMONY_TIMEOUT }) - await expect(page.getByText('Nenhum aparelho cadastrado ainda.')).toBeHidden() + // `.first()`: a transient RSC-pending duplication copies this empty-state + // line (observed strict-mode flake on loaded machines; CI stays green). + await expect(page.getByText('Nenhum aparelho cadastrado ainda.').first()).toBeHidden() // 2. Password-less sign-in issues the 14-day cookie — enrolling the device IS // the "remember me" opt-in, so there is no checkbox in this path. @@ -106,7 +108,7 @@ test('enrolls a passkey, signs in with it, then revokes it', async ({ // the profile and it has to actually stop the credential. await page.goto('/campanha/perfil') await page.getByRole('button', { name: 'Remover Celular da assessora' }).click() - await expect(page.getByText('Nenhum aparelho cadastrado ainda.')).toBeVisible() + await expect(page.getByText('Nenhum aparelho cadastrado ainda.').first()).toBeVisible() await context.clearCookies() await page.goto('/campanha/login')