teqo-backup/tests/unit/territoryAnchor.unit.spec.ts
Francisco Ignácio Fontoura Solla a60200cf6c B25: link do território na lista de municípios
Fecha a navegação inversa para /campanha/territorios com âncoras estáveis compartilhadas entre lista e destino.
2026-07-26 18:59:49 -03:00

17 lines
709 B
TypeScript

import { describe, expect, it } from 'vitest'
import { bahiaIdentityTerritories } from '@/lib/bahiaTerritories'
import { buildTerritoryPageHref, territoryAnchorId } from '@/lib/territoryAnchor'
describe('territoryAnchor', () => {
it('pins a known territory name to a stable anchor and href', () => {
expect(territoryAnchorId('Velho Chico')).toBe('ti-velho-chico')
expect(buildTerritoryPageHref('Velho Chico')).toBe('/campanha/territorios#ti-velho-chico')
})
it('produces 27 distinct anchor ids for the official TI catalog', () => {
const ids = bahiaIdentityTerritories.map((name) => territoryAnchorId(name))
expect(ids).toHaveLength(27)
expect(new Set(ids).size).toBe(27)
})
})