fix(e2e): first() em asserts com duplicação transitória de RSC pending (flake pré-existente, base reproduz)

This commit is contained in:
Francisco Solla 2026-08-09 03:50:25 -03:00
parent a195dd6851
commit cd4698571a
3 changed files with 11 additions and 4 deletions

View file

@ -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()

View file

@ -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 ({

View file

@ -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')