From d03da6d49a1807eccc7db560d087aa152ff64654 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 9 Aug 2026 16:16:40 -0300 Subject: [PATCH] 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). --- tests/e2e/campaignAgendaFeed.e2e.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/e2e/campaignAgendaFeed.e2e.spec.ts b/tests/e2e/campaignAgendaFeed.e2e.spec.ts index d7be936d..e7697c24 100644 --- a/tests/e2e/campaignAgendaFeed.e2e.spec.ts +++ b/tests/e2e/campaignAgendaFeed.e2e.spec.ts @@ -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()