From 97dd13443e2d0590bae52b0e18d966217666c4fc Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 9 Aug 2026 03:09:36 -0300 Subject: [PATCH] =?UTF-8?q?test(campaign):=20endurece=20locators=20de=20te?= =?UTF-8?q?xto=20contra=20duplicata=20transit=C3=B3ria=20de=20hidrata?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mesmo padrão já pinado em 'Otimista: 5.000': o slot server-composed renderiza duas cópias por um instante durante a hidratação — .nth(0) nas asserções de perfil (webauthn) e dossiê (municípios). Não relacionado ao B176; observado deterministicamente no servidor de produção local. --- tests/e2e/campaignMunicipalities.e2e.spec.ts | 4 +++- tests/e2e/campaignWebAuthn.e2e.spec.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index 1e7ce1c3..f8d12969 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -131,7 +131,9 @@ test.describe('Municípios — jornadas por papel', () => { // B145: assessoria left the detail hero; it still appears on the dossiê tab. await page.goto(`${campaign.baseURL}/campanha/municipios/${municipality.slug}?tab=dossie`) - await expect(page.getByText(`Assessoria: ${advisor.name}`)).toBeVisible() + // `.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() }) test('coordinator assigns an advisor from the list combobox with auto-save (B27)', async ({ diff --git a/tests/e2e/campaignWebAuthn.e2e.spec.ts b/tests/e2e/campaignWebAuthn.e2e.spec.ts index db6d0b59..8cf2561c 100644 --- a/tests/e2e/campaignWebAuthn.e2e.spec.ts +++ b/tests/e2e/campaignWebAuthn.e2e.spec.ts @@ -74,7 +74,10 @@ test('enrolls a passkey, signs in with it, then revokes it', async ({ await expectCampaignBiometricsReady(page) await page.goto('/campanha/perfil') - await expect(page.getByText('Nenhum aparelho cadastrado ainda.')).toBeVisible() + // `.nth(0)`: during hydration the server-composed slot can briefly coexist + // with its re-rendered copy (same transient duplicate the municipios spec + // pins for "Otimista: 5.000") — the copy settles to one element. + await expect(page.getByText('Nenhum aparelho cadastrado ainda.').nth(0)).toBeVisible() const deviceLabel = page.getByLabel('Nome deste aparelho') await expect(deviceLabel).toBeVisible()