mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
Rewrite AdvisorsTable on CampaignTable with column picker, add resolveAdvisorListUrl (preserves criar=1), register assessores in CAMPAIGN_LIST_IDS/opsListRegistry, and wire LIST_UNIFIED factory shell. Closes #160 Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
/**
|
|
* Pins the "simple" entity list parsers ahead of the Pass 2 list-system
|
|
* consolidation (W1): organizações and demandas. Assessores moved to
|
|
* `advisorListUrl.ts` (CL5); lideranças left earlier in B29.
|
|
*/
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { parseDemandListParams } from '@/utilities/campaignDemandData'
|
|
import { parseOrganizationListParams } from '@/utilities/organizationData'
|
|
|
|
describe('parseOrganizationListParams', () => {
|
|
it('keeps only known organization kinds', () => {
|
|
expect(parseOrganizationListParams({ kind: 'sindicato' }).kind).toBe('sindicato')
|
|
expect(parseOrganizationListParams({ kind: 'clube' }).kind).toBeUndefined()
|
|
})
|
|
|
|
it('combines q, kind and page', () => {
|
|
expect(parseOrganizationListParams({ q: 'cut', kind: 'sindicato', page: '2' })).toEqual({
|
|
page: 2,
|
|
q: 'cut',
|
|
kind: 'sindicato',
|
|
})
|
|
})
|
|
})
|
|
|
|
describe('parseDemandListParams', () => {
|
|
it('keeps only known statuses and kinds', () => {
|
|
expect(parseDemandListParams({ status: 'aberta' }).status).toBe('aberta')
|
|
expect(parseDemandListParams({ status: 'fechada' }).status).toBeUndefined()
|
|
expect(parseDemandListParams({ kind: 'material' }).kind).toBe('material')
|
|
expect(parseDemandListParams({ kind: 'outra-coisa' }).kind).toBeUndefined()
|
|
})
|
|
|
|
it('defaults to page 1 with no filters', () => {
|
|
expect(parseDemandListParams({})).toEqual({ page: 1 })
|
|
})
|
|
})
|