teqo-backup/tests/unit/opsListPage.unit.spec.ts
Cursor Agent 4d035017f2
CL3: OpsListPage/OpsListView tracer for municípios list
Introduce the unified list shell (OpsListView slots + OpsListPage
server casca) and wire /campanha/municipios behind LIST_UNIFIED with
flag-OFF parity and shared domain pieces as slots.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:29:08 +00:00

25 lines
892 B
TypeScript

import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { describe, expect, it } from 'vitest'
import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag'
const MUNICIPIOS_PAGE = join(
process.cwd(),
'src/app/(campaign)/campanha/(app)/municipios/page.tsx',
)
describe('OpsListPage municipios tracer (CL3)', () => {
it('wires LIST_UNIFIED behind OpsListPage on the municipios route', () => {
const source = readFileSync(MUNICIPIOS_PAGE, 'utf8')
expect(source).toContain('resolveListUnifiedEnabled')
expect(source).toContain('OpsListPage')
expect(source).toContain("from '@/components/campaign/shared/OpsListPage'")
expect(source).toContain("from '@/lib/opsListRegistry/opsListFlag'")
})
it('keeps the flag fail-closed when LIST_UNIFIED is unset', () => {
expect(resolveListUnifiedEnabled({})).toBe(false)
})
})