test(e2e): fix C87 unified-update specs (polarity + adversary signal)

This commit is contained in:
Francisco Solla 2026-08-07 06:56:41 -03:00
parent 212a1f2423
commit 11a9f45d69
4 changed files with 12 additions and 10 deletions

View file

@ -45,11 +45,12 @@ test.describe('Atividades — registro-fundação', () => {
await expect(page.getByLabel('Município')).toHaveValue(String(municipality.id))
await page.goto(`${campaign.baseURL}/campanha/municipios/${municipality.slug}?tab=updates`)
await page.getByLabel('Tipo', { exact: true }).selectOption('sinal')
await expect(page.getByText('Invasão:', { exact: true })).toBeVisible()
await expect(page.getByText('Adversário ocupando nosso espaço.')).toBeVisible()
await expect(page.getByText('Rede esfriou:', { exact: true })).toBeVisible()
await expect(page.getByText('Adversário apareceu:', { exact: true })).toBeVisible()
await expect(page.getByText('Alguém pediu algo:', { exact: true })).toBeVisible()
// Unified C87 surface: body + polarity + urgent + adversary signal, no
// legacy kind/signal-type navigation.
await expect(page.getByLabel('Texto da atualização')).toBeVisible()
await expect(page.getByLabel('Polaridade')).toBeVisible()
await expect(page.getByLabel('Sinalizar como urgente')).toBeVisible()
await expect(page.getByLabel('Sinalizar adversário')).toBeVisible()
await expect(page.getByLabel('Tipo', { exact: true })).toHaveCount(0)
})
})

View file

@ -363,7 +363,7 @@ test.describe('Wizard — registrar atualização (C87)', () => {
`/campanha/acoes/mudar-tendencia\\?municipio=${municipality.slug}&entry=register-update`,
),
)
await expect(page.getByText('Atualização registrada.')).toBeVisible()
await expect(page.getByText('Atualização registrada com sucesso.')).toBeVisible()
})
test('renders the unified fields without legacy signal-type navigation', async ({

View file

@ -398,7 +398,7 @@ test.describe('Municípios — jornadas por papel', () => {
await expect(reopened.getByLabel('Justificativa')).toHaveValue(note)
})
test('coordinator registers a typed signal from the list freshness cell', async ({
test('coordinator registers an adversary-signal update from the list freshness cell', async ({
campaign,
page,
}) => {
@ -434,7 +434,8 @@ test.describe('Municípios — jornadas por papel', () => {
await signalForm
.getByRole('textbox', { name: 'Texto' })
.fill('Liderança local reportou visita adversária na feira.')
await signalForm.getByLabel('Tipo do sinal').selectOption('visita_adversario')
await signalForm.getByLabel('Polaridade').selectOption('ruim')
await signalForm.getByLabel('Sinalizar adversário').check()
await Promise.all([
expectPostResponse(page, '/campanha/municipios'),
signalForm.getByRole('button', { name: 'Registrar atualização', exact: true }).click(),

View file

@ -78,7 +78,7 @@ const expectedHeadersAt = (width: number) => {
if (width >= 66 * REM_IN_PIXELS) headers.push('Liderança')
if (width >= 72 * REM_IN_PIXELS) headers.push('Dobradinha')
if (width >= 78 * REM_IN_PIXELS) headers.push('Cobertura')
headers.push('Sinal')
headers.push('Atualização')
return headers
}