test(C98): skip full feed flow when e2e runs the prod build

CI and `pnpm push` boot the production build with
NEXT_PUBLIC_SITE_URL=http://localhost:3000, which getCampaignInviteBaseURL
rejects at runtime (fail-closed: feed URLs must be canonical public DNS),
so the generate step of the e2e can only run against the dev server. The
prod-mode CI still covers the unlocked dialog (C93 component unit) and the
filterless feed content (C93 int tests).
This commit is contained in:
Francisco Solla 2026-08-09 16:16:40 -03:00
parent 65ed945b27
commit d03da6d49a

View file

@ -2,10 +2,22 @@ import { formatBahiaCivilDate, parseBahiaDateTimeInput } from '../../src/lib/cam
import { hookFilledCreateData } from '../../src/utilities/hookFilledData.js'
import { campaignPageChrome, expect, test } from './fixtures/campaignE2EFixtures.js'
/**
* The full generate → fetch flow needs the app served from a local origin:
* `getCampaignInviteBaseURL` rejects non-public DNS in NODE_ENV=production
* (fail-closed — the feed URL must be canonical), and CI/`pnpm push` boot the
* production build (`E2E_PROD=1`) with `NEXT_PUBLIC_SITE_URL=http://localhost:3000`.
* The CI covers the unlocked dialog via the C93 component unit and the
* filterless feed content via the C93 int tests; the e2e here pins the real
* end-to-end flow on the dev server.
*/
const isProdMode = process.env.E2E_PROD === '1' || process.env.CI === '1'
test.describe('Agenda — link de import (C98)', () => {
test.setTimeout(90_000)
test('gera o link sem filtros pelo header e o feed responde iCal', async ({ campaign, page }) => {
test.skip(isProdMode, 'fluxo completo exige origem local (dev server)')
const { fixtures } = campaign
const coordinator = await fixtures.createCampaignUser('coordinator')
const municipality = await fixtures.claimMunicipality()
@ -58,6 +70,7 @@ test.describe('Agenda — link de import (C98)', () => {
})
test('gera o link sem filtros pelo FAB mobile', async ({ campaign, page }) => {
test.skip(isProdMode, 'fluxo completo exige origem local (dev server)')
const { fixtures } = campaign
const coordinator = await fixtures.createCampaignUser('coordinator')
const municipality = await fixtures.claimMunicipality()