mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
Fecha a navegação inversa para /campanha/territorios com âncoras estáveis compartilhadas entre lista e destino.
17 lines
709 B
TypeScript
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)
|
|
})
|
|
})
|