diff --git a/.env.example b/.env.example
index 51c0e514..b14eadb6 100644
--- a/.env.example
+++ b/.env.example
@@ -35,7 +35,3 @@ CAMPAIGN_EMAIL_FROM_NAME=Campanha Jorge Solla
# Note: the automated test suite ignores this file and reads .env.test instead,
# and only ever runs against a database whose name ends with "_test".
-
-# Unified list factory (CL*). Compile-time; set to 1/true to render lists via OpsListPage.
-# Absent or 0 keeps the legacy list shells. See docs/plans/lista-unificada-campanha-spec.md
-LIST_UNIFIED=
diff --git a/docs/CHANGELOG-AGENTS.md b/docs/CHANGELOG-AGENTS.md
index 74993ee6..96cfda6e 100644
--- a/docs/CHANGELOG-AGENTS.md
+++ b/docs/CHANGELOG-AGENTS.md
@@ -4,6 +4,8 @@ Conteúdo movido do `AGENTS.md` em 2026-07-30 (fatiamento do paradigma de agente
---
+**Recently resolved (2026-08-02):** **CL9** — removida flag compile-time `LIST_UNIFIED`: 8 rotas de lista sempre via `OpsListPage`; apagados `opsListFlag.ts` / env / Playwright; spec-mãe `lista-unificada-campanha-spec.md` em **implementado**. Plano: [`cl9-list-unified-flag-cleanup.md`](docs/plans/cl9-list-unified-flag-cleanup.md).
+
**Recently resolved (2026-08-02):** **OH14** (Issue #175) — removida flag compile-time `OPS_HYBRID`: sync híbrido sempre ON para staff (`isStaffCampaignRole` no layout); ramificações legacy OFF apagadas nos forms/controles; e2e offline em CI sem env; spec-mãe `ops-hibrido-rsc-local-spec.md` em **implementado** com receita de nova write offline. Plano: [`oh14-flag-cleanup.md`](docs/plans/oh14-flag-cleanup.md).
**Recently resolved (2026-08-02):** **OH13** (Issue #176) — writes CAS por domínio: `baseUpdatedAt` + `*Cas` em leadership / demand transition / activity update / stateDeputy vínculos; helper `assertCampaignDocCas`; outbox `opsDomainOutbox` com Manter/Usar nos forms; flag OFF intacto. Plano: [`oh13-domain-writes-cas.md`](docs/plans/oh13-domain-writes-cas.md).
diff --git a/docs/plans/cl9-list-unified-flag-cleanup.md b/docs/plans/cl9-list-unified-flag-cleanup.md
new file mode 100644
index 00000000..ab61a233
--- /dev/null
+++ b/docs/plans/cl9-list-unified-flag-cleanup.md
@@ -0,0 +1,28 @@
+# CL9 — Limpeza da flag `LIST_UNIFIED`
+
+Status: implementado
+Atualizado em: 2026-08-02
+Issue: —
+Priority: P2
+Model: composer-2.5
+Impeccable: A — N/A (limpeza)
+Appetite: ~0,5 dia eng
+Depends: CL8, OH14
+Responsável: —
+
+## Decisão
+
+**Remover a flag e manter só `OpsListPage`.** Justificativa: as 8 rotas v1 já migraram (CL3–CL8); dual-path só aumentava complexidade; prod ainda em desenvolvimento (mesmo critério OH14). Sem Issue GitHub — chore directo pós-CL8.
+
+## Entrega
+
+- Apagado `resolveListUnifiedEnabled` / `opsListFlag.ts` / `LIST_UNIFIED` (`next.config`, `.env.example`, Playwright).
+- 8 pages de lista sempre renderizam `` (sem ternário OFF / `CampaignListPendingBoundary` legado na rota).
+- Pins unit/e2e sem gate de env; saved filters municípios cobertos pelo suite principal.
+- Spec-mãe `lista-unificada-campanha-spec.md` → `Status: implementado`.
+
+## Fases verificáveis
+
+- [x] pages + config + delete flag
+- [x] tests + docs + CHANGELOG
+- [x] `pnpm gate:fast` + knip + cycles
diff --git a/docs/plans/lista-unificada-campanha-spec.md b/docs/plans/lista-unificada-campanha-spec.md
index 2a9ac528..4f783d2c 100644
--- a/docs/plans/lista-unificada-campanha-spec.md
+++ b/docs/plans/lista-unificada-campanha-spec.md
@@ -1,7 +1,7 @@
# Lista unificada `/campanha` — spec-mãe e critérios
-Status: travado (freshness audit 2026-08-01 — premissas confirmadas no repo)
-Atualizado em: 2026-08-01
+Status: implementado (flag `LIST_UNIFIED` retirada — CL9, 2026-08-02)
+Atualizado em: 2026-08-02
Issue: #155
Priority: P1
Model: cursor-grok-4.5-high
@@ -13,9 +13,9 @@ Responsável: —
1. Factory = prólogo de página + render com slots; não unifica where/sort/paginação.
2. `atividades` fica fora da factory (cards + tabs próprios) — **não** entra em `opsListDomains`.
-3. `assessores` e `territorios` precisam de pré-work antes de migrar (CL5a / CL6a).
+3. `assessores` e `territorios` precisavam de pré-work antes de migrar (CL5a / CL6a) — feito.
4. Saved filters só municípios; allowlist `CampaignListId` para seletor de colunas.
-5. Flag `LIST_UNIFIED` via env (`resolveListUnifiedEnabled` em CL2); URLs públicas intactas.
+5. URLs públicas intactas. Flag `LIST_UNIFIED` **retirada** (CL9): as 8 rotas sempre usam `OpsListPage`.
## Objetivos
@@ -98,11 +98,10 @@ Estado **hoje** (não o contrato-alvo). Para sortModel / canonicalRedirect / col
## Critérios de aceite do projecto
-1. Sem `LIST_UNIFIED`: e2e existentes idênticas a `main`.
-2. Com `LIST_UNIFIED=1`: cada lista migrada renderiza pela `OpsListPage` com paridade funcional/visível.
-3. URLs canónicas e saved filters municípios funcionam igual.
-4. `pnpm gate:fast` + e2e das listas verdes.
-5. Registry falha o build se faltar slug v1 ou coluna sem `label`.
+1. Cada lista v1 renderiza pela `OpsListPage` (sem dual-path / sem `LIST_UNIFIED`).
+2. URLs canónicas e saved filters municípios funcionam igual.
+3. `pnpm gate:fast` + e2e das listas verdes.
+4. Registry falha o build se faltar slug v1 ou coluna sem `label`.
## Index de planos filhos
@@ -117,6 +116,7 @@ Números GitHub (#156–#162) **não** seguem a ordem de execução (CL5=#160, C
| CL6 | #159 | [`cl6-territorios-factory.md`](cl6-territorios-factory.md) | CL3 (+ CL6a bloqueia CL6b) | ~2d |
| CL7 | #161 | [`cl7-apoiadores-organizacoes.md`](cl7-apoiadores-organizacoes.md) | CL3 | ~1–1,5d |
| CL8 | #162 | [`cl8-contrato-cleanup.md`](cl8-contrato-cleanup.md) | CL4–CL7 | ~1d |
+| CL9 | — | [`cl9-list-unified-flag-cleanup.md`](cl9-list-unified-flag-cleanup.md) | CL8 (+ OH14) | ~0,5d |
## Dependência entre projectos
diff --git a/next.config.mjs b/next.config.mjs
index 9e050645..9b677705 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -5,10 +5,6 @@ const allowedImageHost = process.env.NEXT_PUBLIC_SITE_URL || 'https://jorgesolla
const nextConfig = {
distDir: process.env.NEXT_DIST_DIR || '.next',
- // CL*: compile-time flag inlined for client islands; absent/`0` keeps legacy list shells.
- env: {
- LIST_UNIFIED: process.env.LIST_UNIFIED ?? '',
- },
images: {
remotePatterns: [new URL(`${allowedImageHost}/**`)],
},
diff --git a/playwright.config.ts b/playwright.config.ts
index 1343f6f2..91fe8301 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -118,7 +118,6 @@ export default defineConfig({
NEXT_DIST_DIR: '.next/e2e',
PAYLOAD_SECRET: process.env.PAYLOAD_SECRET ?? 'test-only-secret-not-used-in-production',
NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL ?? baseURL,
- LIST_UNIFIED: process.env.LIST_UNIFIED ?? '',
},
},
})
diff --git a/src/app/(campaign)/campanha/(app)/apoiadores/page.tsx b/src/app/(campaign)/campanha/(app)/apoiadores/page.tsx
index 7cff9cec..8045f8d6 100644
--- a/src/app/(campaign)/campanha/(app)/apoiadores/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/apoiadores/page.tsx
@@ -9,10 +9,6 @@ import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignListEmptyState } from '@/components/campaign/shared/CampaignListEmptyState'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import { CampaignScopeBadge } from '@/components/campaign/shared/CampaignScopeBadge'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
@@ -20,7 +16,6 @@ import { SupporterFilters } from '@/components/campaign/supporter/SupporterFilte
import { SupporterList } from '@/components/campaign/supporter/SupporterList'
import { SupporterListOverview } from '@/components/campaign/supporter/SupporterListOverview'
import { Button } from '@/components/ui/button'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { isCampaignCoordinator, isCampaignUnrestricted } from '@/utilities/campaignAccess'
import { readCampaignColumnVisibility } from '@/utilities/campaignColumnVisibilityCookie'
import { requireCampaignPageActor } from '@/utilities/campaignPageActor'
@@ -91,7 +86,7 @@ export default async function SupportersPage({ searchParams }: SupportersPagePro
/>
) : null
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {toolbarNode}
-
- {overviewNode}
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/assessores/page.tsx b/src/app/(campaign)/campanha/(app)/assessores/page.tsx
index 7a4c5945..57be965d 100644
--- a/src/app/(campaign)/campanha/(app)/assessores/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/assessores/page.tsx
@@ -8,15 +8,10 @@ import { OfflineBoundary } from '@/components/campaign/opsSync/OfflineBoundary'
import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import { CampaignSearchForm } from '@/components/campaign/shared/CampaignSearchForm'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
import { CAMPAIGN_ADVISORS_HOME } from '@/lib/campaignPaths'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { advisorListHrefForPage, resolveAdvisorListUrl } from '@/utilities/advisor/advisorListUrl'
import { loadAdvisorListPageData } from '@/utilities/advisorData'
import { readCampaignColumnVisibility } from '@/utilities/campaignColumnVisibilityCookie'
@@ -88,7 +83,7 @@ export default async function AdvisorsPage({ searchParams }: AdvisorsPageProps)
/>
)
- const main: ReactNode = resolveListUnifiedEnabled() ? (
+ const main: ReactNode = (
- ) : (
-
- {toolbar}
-
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/demandas/page.tsx b/src/app/(campaign)/campanha/(app)/demandas/page.tsx
index 862c8067..ee887168 100644
--- a/src/app/(campaign)/campanha/(app)/demandas/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/demandas/page.tsx
@@ -10,16 +10,11 @@ import { CampaignFilterChips } from '@/components/campaign/shared/CampaignFilter
import { CampaignListEmptyState } from '@/components/campaign/shared/CampaignListEmptyState'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import { CampaignTable, type CampaignTableColumn } from '@/components/campaign/shared/CampaignTable'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
import { Badge } from '@/components/ui/Badge'
import { Button } from '@/components/ui/button'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import {
campaignDemandKindLabels,
campaignDemandStatusLabels,
@@ -169,7 +164,7 @@ export default async function DemandsPage({ searchParams }: DemandsPageProps) {
/>
) : null
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {statusChips}
-
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx
index 475bebba..f6e23c45 100644
--- a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx
@@ -8,11 +8,7 @@ import { OfflineBoundary } from '@/components/campaign/opsSync/OfflineBoundary'
import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
- CampaignTransitionAnchor,
-} from '@/components/campaign/shared/CampaignListPending'
+import { CampaignTransitionAnchor } from '@/components/campaign/shared/CampaignListPending'
import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost'
import {
CampaignTable,
@@ -39,7 +35,6 @@ import {
} from '@/components/ui/Empty'
import { resolveVisibleColumns } from '@/lib/campaignColumnVisibility'
import type { MunicipalityPortfolioIndexEntry } from '@/lib/municipalityPortfolio'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { cn } from '@/lib/utils'
import { getAdvisorMunicipalityIds } from '@/utilities/campaignAccess'
import { readCampaignColumnVisibility } from '@/utilities/campaignColumnVisibilityCookie'
@@ -264,7 +259,7 @@ export default async function StateDeputiesPage({ searchParams }: StateDeputiesP
/>
) : null
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {filters}
-
- {sortSummaryNode}
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/liderancas/page.tsx b/src/app/(campaign)/campanha/(app)/liderancas/page.tsx
index 8021757e..6edb988f 100644
--- a/src/app/(campaign)/campanha/(app)/liderancas/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/liderancas/page.tsx
@@ -16,11 +16,7 @@ import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignCopyableCell } from '@/components/campaign/shared/CampaignCopyableCell'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
- CampaignTransitionAnchor,
-} from '@/components/campaign/shared/CampaignListPending'
+import { CampaignTransitionAnchor } from '@/components/campaign/shared/CampaignListPending'
import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost'
import {
CampaignTable,
@@ -50,7 +46,6 @@ import {
resolvedPortfolioEntriesById,
type MunicipalityPortfolioIndexEntry,
} from '@/lib/municipalityPortfolio'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { formatBrazilianPhoneInput, whatsAppHrefForPhone } from '@/lib/phone'
import { MAX_LEADERSHIP_MUNICIPALITIES } from '@/lib/schemas/leadership'
import { cn } from '@/lib/utils'
@@ -422,7 +417,7 @@ export default async function LeadershipsPage({ searchParams }: LeadershipsPageP
/>
) : null
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {filters}
-
- {sortSummaryNode}
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/municipios/page.tsx b/src/app/(campaign)/campanha/(app)/municipios/page.tsx
index f0cb196f..e4f6f4e6 100644
--- a/src/app/(campaign)/campanha/(app)/municipios/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/municipios/page.tsx
@@ -1,7 +1,3 @@
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import config from '@payload-config'
import { redirect } from 'next/navigation'
import { getPayload } from 'payload'
@@ -19,7 +15,6 @@ import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignLis
import { CampaignScopeBadge } from '@/components/campaign/shared/CampaignScopeBadge'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import {
isCampaignCoordinator,
isCampaignStaff,
@@ -165,28 +160,16 @@ export default async function MunicipalitiesPage({ searchParams }: Municipalitie
/>
)
- // Shared pieces; flag only switches the composition shell (CL3 tracer).
- // Provider wraps both paths the same way (outside the pending boundary).
+ // Provider wraps outside the pending boundary (OpsListPage owns pending chrome).
const main = wrapStaffListRegion(
isStaffView,
- resolveListUnifiedEnabled() ? (
-
- ) : (
-
- {filters}
-
- {overviewNode}
- {tableNode}
- {footerNode}
-
-
- ),
+ ,
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/organizacoes/page.tsx b/src/app/(campaign)/campanha/(app)/organizacoes/page.tsx
index 4a1cf16f..51aa98e9 100644
--- a/src/app/(campaign)/campanha/(app)/organizacoes/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/organizacoes/page.tsx
@@ -8,17 +8,12 @@ import { OfflineBoundary } from '@/components/campaign/opsSync/OfflineBoundary'
import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignListEmptyState } from '@/components/campaign/shared/CampaignListEmptyState'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import { CampaignSearchForm } from '@/components/campaign/shared/CampaignSearchForm'
import { CampaignTable, type CampaignTableColumn } from '@/components/campaign/shared/CampaignTable'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
import { Badge } from '@/components/ui/Badge'
import { Button } from '@/components/ui/button'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { organizationKindLabels } from '@/lib/schemas/organization'
import { readCampaignColumnVisibility } from '@/utilities/campaignColumnVisibilityCookie'
import { requireCampaignPageActor } from '@/utilities/campaignPageActor'
@@ -135,7 +130,7 @@ export default async function OrganizationsPage({ searchParams }: OrganizationsP
/>
) : null
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {toolbarNode}
-
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/app/(campaign)/campanha/(app)/territorios/page.tsx b/src/app/(campaign)/campanha/(app)/territorios/page.tsx
index 03f4f6d2..6e8c0013 100644
--- a/src/app/(campaign)/campanha/(app)/territorios/page.tsx
+++ b/src/app/(campaign)/campanha/(app)/territorios/page.tsx
@@ -8,13 +8,8 @@ import { OfflineBoundary } from '@/components/campaign/opsSync/OfflineBoundary'
import { OpsListLocal } from '@/components/campaign/opsSync/OpsListLocal'
import { CampaignListFooter } from '@/components/campaign/shared/CampaignListFooter'
import { CampaignListPageHeader } from '@/components/campaign/shared/CampaignListPageHeader'
-import {
- CampaignListPendingBoundary,
- CampaignListResults,
-} from '@/components/campaign/shared/CampaignListPending'
import { OpsListPage } from '@/components/campaign/shared/OpsListPage'
import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import { readCampaignColumnVisibility } from '@/utilities/campaignColumnVisibilityCookie'
import { requireCampaignPageActor } from '@/utilities/campaignPageActor'
import { loadTerritoryOverviewPage } from '@/utilities/territory/loadTerritoryOverview'
@@ -64,7 +59,7 @@ export default async function TerritoriesPage({ searchParams }: TerritoriesPageP
/>
)
- const main = resolveListUnifiedEnabled() ? (
+ const main = (
- ) : (
-
- {filters}
-
- {tableNode}
- {footerNode}
-
-
)
return (
diff --git a/src/lib/opsListRegistry/opsListFlag.ts b/src/lib/opsListRegistry/opsListFlag.ts
deleted file mode 100644
index 4714ef31..00000000
--- a/src/lib/opsListRegistry/opsListFlag.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * CL2 — feature flag for the unified list factory (CL3+).
- *
- * When disabled, existing list routes keep their current implementation.
- */
-
-const TRUTHY = new Set(['1', 'true'])
-
-export const resolveListUnifiedEnabled = (
- env: Record = process.env,
-): boolean => TRUTHY.has(env.LIST_UNIFIED ?? '')
diff --git a/tests/e2e/campaignSavedFilters.e2e.spec.ts b/tests/e2e/campaignSavedFilters.e2e.spec.ts
index 19196a4b..dfb42227 100644
--- a/tests/e2e/campaignSavedFilters.e2e.spec.ts
+++ b/tests/e2e/campaignSavedFilters.e2e.spec.ts
@@ -8,9 +8,6 @@ import { expect, test } from './fixtures/campaignE2EFixtures.js'
* there must not be read as a regression here.
*/
-const listUnifiedEnabled =
- process.env.LIST_UNIFIED === '1' || process.env.LIST_UNIFIED?.toLowerCase() === 'true'
-
/** 416 whole municipalities — deep enough that `?page=2` is a real page. */
const SAVED_RECORTE = '/campanha/municipios?priority=alta'
@@ -132,31 +129,3 @@ test.describe('Filtros salvos de Municípios', () => {
await expect(page.getByRole('link', { name: SAVED_NAME })).toBeVisible()
})
})
-
-test.describe('Filtros salvos com LIST_UNIFIED (CL8)', () => {
- test.skip(
- !listUnifiedEnabled,
- 'Set LIST_UNIFIED=1 on the e2e webServer to run the unified-list tracer.',
- )
-
- test('saved filters stay intact behind OpsListPage', async ({ campaign, page }) => {
- test.slow()
-
- const { fixtures } = campaign
- const coordinator = await fixtures.createCampaignUser('coordinator', {
- name: fixtures.value('Coordenadora Filtros Unificados'),
- })
-
- await campaign.login(page, coordinator.email!, coordinator.password)
- await page.goto(SAVED_RECORTE)
- await page.getByRole('button', { name: 'Salvar filtro', exact: true }).click()
- await page.getByLabel('Nome do filtro').fill(SAVED_NAME)
- await page.getByRole('button', { name: 'Salvar', exact: true }).click()
-
- const shortcut = page.getByRole('link', { name: SAVED_NAME })
- await expect(shortcut).toBeVisible()
- await shortcut.click()
- await expect(page).toHaveURL(SAVED_RECORTE, NAVIGATION)
- await expect(shortcut).toHaveAttribute('aria-current', 'page', NAVIGATION)
- })
-})
diff --git a/tests/unit/opsListPage.unit.spec.ts b/tests/unit/opsListPage.unit.spec.ts
index 957c3519..a92d7d3f 100644
--- a/tests/unit/opsListPage.unit.spec.ts
+++ b/tests/unit/opsListPage.unit.spec.ts
@@ -9,45 +9,27 @@ const ROUTE_PAGES = {
dobradinhas: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx'),
demandas: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/demandas/page.tsx'),
assessores: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/assessores/page.tsx'),
+ territorios: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/territorios/page.tsx'),
apoiadores: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/apoiadores/page.tsx'),
organizacoes: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/organizacoes/page.tsx'),
} as const
const expectOpsListPageWiring = (source: string) => {
- expect(source).toContain('resolveListUnifiedEnabled')
expect(source).toContain('OpsListPage')
expect(source).toContain("from '@/components/campaign/shared/OpsListPage'")
- expect(source).toContain("from '@/lib/opsListRegistry/opsListFlag'")
+ expect(source).not.toContain('resolveListUnifiedEnabled')
+ expect(source).not.toContain('opsListFlag')
}
-describe('OpsListPage municipios tracer (CL3)', () => {
- it('wires LIST_UNIFIED behind OpsListPage on the municipios route', () => {
- expectOpsListPageWiring(readFileSync(ROUTE_PAGES.municipios, 'utf8'))
- })
-})
-
-describe('OpsListPage CL4 routes', () => {
- it.each(['liderancas', 'dobradinhas', 'demandas'] as const)(
- 'wires LIST_UNIFIED behind OpsListPage on the %s route',
+describe('OpsListPage route wiring', () => {
+ it.each(Object.keys(ROUTE_PAGES) as Array)(
+ 'always renders OpsListPage on the %s route',
(route) => {
- expectOpsListPageWiring(readFileSync(ROUTE_PAGES[route], 'utf8'))
- },
- )
-})
-
-describe('OpsListPage assessores (CL5)', () => {
- it('wires LIST_UNIFIED behind OpsListPage on the assessores route', () => {
- const source = readFileSync(ROUTE_PAGES.assessores, 'utf8')
- expectOpsListPageWiring(source)
- expect(source).toContain('resolveAdvisorListUrl')
- })
-})
-
-describe('OpsListPage CL7 routes', () => {
- it.each(['apoiadores', 'organizacoes'] as const)(
- 'wires LIST_UNIFIED behind OpsListPage on the %s route',
- (route) => {
- expectOpsListPageWiring(readFileSync(ROUTE_PAGES[route], 'utf8'))
+ const source = readFileSync(ROUTE_PAGES[route], 'utf8')
+ expectOpsListPageWiring(source)
+ if (route === 'assessores') {
+ expect(source).toContain('resolveAdvisorListUrl')
+ }
},
)
})
diff --git a/tests/unit/opsListRegistry.unit.spec.ts b/tests/unit/opsListRegistry.unit.spec.ts
index f06c6075..5db5dbc0 100644
--- a/tests/unit/opsListRegistry.unit.spec.ts
+++ b/tests/unit/opsListRegistry.unit.spec.ts
@@ -1,7 +1,6 @@
import { describe, expect, it } from 'vitest'
import type { CampaignListId } from '@/lib/campaignColumnVisibility'
-import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
import {
getOpsListDomain,
opsListDomains,
@@ -111,21 +110,3 @@ describe('opsListRegistry v1', () => {
}
})
})
-
-describe('resolveListUnifiedEnabled', () => {
- it('is false when LIST_UNIFIED is absent', () => {
- expect(resolveListUnifiedEnabled({})).toBe(false)
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: undefined })).toBe(false)
- })
-
- it('is true for "1" and "true"', () => {
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: '1' })).toBe(true)
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: 'true' })).toBe(true)
- })
-
- it('is false for "0" and other values', () => {
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: '0' })).toBe(false)
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: 'false' })).toBe(false)
- expect(resolveListUnifiedEnabled({ LIST_UNIFIED: 'yes' })).toBe(false)
- })
-})
diff --git a/tests/unit/opsListRegistryRoutes.unit.spec.ts b/tests/unit/opsListRegistryRoutes.unit.spec.ts
index 4420471a..5cf0d1a0 100644
--- a/tests/unit/opsListRegistryRoutes.unit.spec.ts
+++ b/tests/unit/opsListRegistryRoutes.unit.spec.ts
@@ -11,10 +11,10 @@ const routePagePath = (routePath: string): string => {
}
const expectOpsListFactoryWiring = (source: string) => {
- expect(source).toContain('resolveListUnifiedEnabled')
expect(source).toContain('OpsListPage')
expect(source).toContain("from '@/components/campaign/shared/OpsListPage'")
- expect(source).toContain("from '@/lib/opsListRegistry/opsListFlag'")
+ expect(source).not.toContain('resolveListUnifiedEnabled')
+ expect(source).not.toContain('opsListFlag')
}
describe('opsListRegistry v1 routes (CL8)', () => {