mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
Delega as três rotas à factory unificada atrás de LIST_UNIFIED, seguindo o padrão CL3 de municípios: slots extraídos (toolbar, overview, table, footer) com paridade total quando a flag está OFF. - lideranças/dobradinhas: sort summary no slot overview, sheet provider na tabela - demandas: chips de status no toolbar, sem redirect canónico (sort fixed) - testes unitários estendidos em opsListPage.unit.spec.ts Closes #158 Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { readFileSync } from 'node:fs'
|
|
import { join } from 'node:path'
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const ROUTE_PAGES = {
|
|
municipios: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/municipios/page.tsx'),
|
|
liderancas: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/liderancas/page.tsx'),
|
|
dobradinhas: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx'),
|
|
demandas: join(process.cwd(), 'src/app/(campaign)/campanha/(app)/demandas/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'")
|
|
}
|
|
|
|
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',
|
|
(route) => {
|
|
expectOpsListPageWiring(readFileSync(ROUTE_PAGES[route], 'utf8'))
|
|
},
|
|
)
|
|
})
|