test(campaignMunicipalities): torna o assert Otimista: 5.000 determinístico

O getByText sem índice também casa com o span sr-only do hover-preview quando
uma linha está hovered — strict-mode violation flaky no CI. .nth(0) fixa no
resumo da célula.
This commit is contained in:
Francisco Solla 2026-08-08 18:29:42 -03:00
parent cfb27296f6
commit c1bedcf838

View file

@ -124,7 +124,10 @@ test.describe('Municípios — jornadas por papel', () => {
// (visually a hover-only preview otherwise), so assert against that
// unique, unambiguous string rather than a bare "5.000" substring —
// that also matches the (opacity-0 but DOM-visible) hover-preview span.
await expect(page.getByText('Otimista: 5.000')).toBeVisible()
// `.nth(0)`: the cell's sr-only summary is first in DOM; the preview span
// duplicates the text when a row is hovered, making a bare getByText a
// strict-mode violation (observed flaky on CI).
await expect(page.getByText('Otimista: 5.000').nth(0)).toBeVisible()
// B145: assessoria left the detail hero; it still appears on the dossiê tab.
await page.goto(`${campaign.baseURL}/campanha/municipios/${municipality.slug}?tab=dossie`)