mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-14 08:53:11 +00:00
test(C119): pina facet de status na lista de pessoas, parse exaustivo da URL de pessoas e variant do badge
This commit is contained in:
parent
3a4e44f422
commit
c91b6a508d
3 changed files with 44 additions and 10 deletions
|
|
@ -185,17 +185,21 @@ describe('campaign visual foundation', () => {
|
|||
})
|
||||
|
||||
it.each([
|
||||
['engajado', 'Engajado'],
|
||||
['a_abordar', 'A abordar'],
|
||||
['em_disputa', 'Em disputa'],
|
||||
['lembranca', 'Lembrança'],
|
||||
['negativo', 'Negativo'],
|
||||
] as const)('renders the %s support status with text and semantic state', (status, label) => {
|
||||
const html = renderToStaticMarkup(createElement(SupportStatusBadge, { status }))
|
||||
['engajado', 'Engajado', 'support-engaged'],
|
||||
['a_abordar', 'A abordar', 'support-to-approach'],
|
||||
['em_disputa', 'Em disputa', 'support-disputed'],
|
||||
['lembranca', 'Lembrança', 'support-remembered'],
|
||||
['negativo', 'Negativo', 'support-negative'],
|
||||
] as const)(
|
||||
'renders the %s support status with text, semantic state and variant',
|
||||
(status, label, variant) => {
|
||||
const html = renderToStaticMarkup(createElement(SupportStatusBadge, { status }))
|
||||
|
||||
expect(html).toContain(label)
|
||||
expect(html).toContain(`data-support-status="${status}"`)
|
||||
})
|
||||
expect(html).toContain(label)
|
||||
expect(html).toContain(`data-support-status="${status}"`)
|
||||
expect(html).toContain(`data-variant="${variant}"`)
|
||||
},
|
||||
)
|
||||
|
||||
it('qualifies TSE zones instead of showing an ambiguous number', () => {
|
||||
const html = renderToStaticMarkup(createElement(TseZoneBadge, { zoneNumber: 12 }))
|
||||
|
|
|
|||
|
|
@ -50,6 +50,14 @@ describe('people list URL contract', () => {
|
|||
).toEqual({ page: 1, municipalities: [12, 3], statuses: ['engajado', 'em_disputa'] })
|
||||
})
|
||||
|
||||
it('canonicalizes selecting every status member to the absent filter (C119)', () => {
|
||||
expect(
|
||||
parsePeopleListParams({
|
||||
status: ['engajado', 'a_abordar', 'em_disputa', 'lembranca', 'negativo'],
|
||||
}),
|
||||
).toEqual({ page: 1 })
|
||||
})
|
||||
|
||||
it('serializes canonical params in stable order and omits defaults', () => {
|
||||
const params = serializeCanonicalPeopleListSearchParams({
|
||||
page: 1,
|
||||
|
|
|
|||
|
|
@ -221,4 +221,26 @@ describe('peopleFilterFacetsFromRows', () => {
|
|||
expect(facets.municipalityIDs).toEqual([1, 3, 4, 5, 6, 99])
|
||||
expect(facets.statuses).toEqual(['engajado'])
|
||||
})
|
||||
|
||||
it('keeps every leadership status present in the rows, in canonical selector order (C119)', () => {
|
||||
const withAllStatuses: PeopleMergeSources = {
|
||||
...source,
|
||||
leaderships: (['engajado', 'a_abordar', 'em_disputa', 'lembranca', 'negativo'] as const).map(
|
||||
(supportStatus, index) => ({
|
||||
...source.leaderships[0]!,
|
||||
id: 10 + index,
|
||||
contactID: 100 + index,
|
||||
supportStatus,
|
||||
}),
|
||||
),
|
||||
}
|
||||
const facets = peopleFilterFacetsFromRows(mergePeopleSources(withAllStatuses), { page: 1 })
|
||||
expect(facets.statuses).toEqual([
|
||||
'engajado',
|
||||
'a_abordar',
|
||||
'em_disputa',
|
||||
'lembranca',
|
||||
'negativo',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue