From 6fe38b332c95aa823d89c621ccda1256b74eb0a7 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Mon, 10 Aug 2026 20:00:55 -0300 Subject: [PATCH] =?UTF-8?q?test(B195):=20migrar=20e2e=20B85=20do=20cadastr?= =?UTF-8?q?o=20de=20demanda=20ao=20campo=20=C3=BAnico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/campaignMunicipalities.e2e.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index ab58bfa5..d865848b 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -1,6 +1,7 @@ import type { Page } from '@playwright/test' import { SUPPORTER_REGISTRATION_CONSENT_KEY } from '../../src/lib/campaignConsentKeys.js' +import { fallbackDemandTitle } from '../../src/lib/demandTitle.js' import { ensureLeasedConsent, SUPPORTER_REGISTRATION_CONSENT_LEASE_KEY, @@ -726,13 +727,15 @@ test.describe('Municípios — jornadas por papel', () => { }) fixtures.touchMunicipality(municipality.id) - const demandTitle = fixtures.value('Carro de som') + // B195: single free-text field; the title is derived server-side (fallback + // truncation without a DEEPSEEK_API_KEY in the e2e app). + const demandText = fixtures.value('Carro de som: precisamos para a caminhada de sábado.') + const demandTitle = fallbackDemandTitle(demandText) await campaign.login(page, advisor.email!, password) await page.goto(`${campaign.baseURL}/campanha/demandas/nova`) - await page.getByLabel('O que você precisa?').fill(demandTitle) await page.getByLabel('Município').selectOption({ label: municipality.name }) - await page.getByLabel('Detalhe a necessidade').fill('Precisamos para a caminhada de sábado.') + await page.getByLabel('O que você precisa?').fill(demandText) await page.getByRole('button', { name: 'Abrir demanda' }).click() await expect(campaignPageChrome(page, demandTitle)).toBeVisible() await expect(page.getByRole('button', { name: 'Aprovar' })).toBeVisible()