fix(e2e): C142 — harden B196 completion-footer assert (30s poll) for deploy verify

The B196 'relation groups' spec asserted the '1 município encontrado'
completion footer with the 10s expect default; under 4-worker CI load the
RSC list chunk can land late ('element(s) not found'), the same
stream-latency class as the issue's three deploy-blocking assertions.

Polls the footer with the same 30s budget the sibling geometry asserts
use, scoped to .first() so a transient streaming duplicate cannot trip
strict mode.
This commit is contained in:
Francisco Solla 2026-08-23 21:54:40 -03:00
parent 9039b1bbd3
commit 2a101c87ab

View file

@ -1376,8 +1376,13 @@ test.describe('Municípios — barra colada e card denso (B196)', () => {
await expect(crowdedCard).toBeVisible()
// The completion footer proves the filtered list finished streaming — the
// `S:` settle alone can pass while the list still re-renders (measured:
// a mid-stream card can report a transient narrow layout).
await expect(page.getByText('1 município encontrado')).toBeVisible()
// a mid-stream card can report a transient narrow layout). B196 flake
// class: under 4-worker load the footer chunk can land late, so poll with
// the same 30s budget as the geometry asserts below instead of the 10s
// expect default.
await expect
.poll(() => page.getByText('1 município encontrado').first().isVisible(), { timeout: 30_000 })
.toBe(true)
const crowdedRow = crowdedCard.locator('[data-view="relation-avatars"]').first()
await expect(crowdedRow.locator('.size-7')).toHaveCount(5)
// ONE layout snapshot per read, polled until the settled layout satisfies
@ -1428,7 +1433,11 @@ test.describe('Municípios — barra colada e card denso (B196)', () => {
await page.waitForFunction(() => document.querySelectorAll('div[id^="S:"]').length === 0)
const sparseCard = cardFor(page, sparse.name)
await expect(sparseCard).toBeVisible()
await expect(page.getByText('1 município encontrado')).toBeVisible()
// Same B196 stream-latency flake class as the `crowdedCard` footer above:
// poll the completion footer with the 30s geometry budget.
await expect
.poll(() => page.getByText('1 município encontrado').first().isVisible(), { timeout: 30_000 })
.toBe(true)
const sparseRow = sparseCard.locator('[data-view="relation-avatars"]').first()
await expect(sparseRow.locator('.size-7')).toHaveCount(2)
await expect