From 9e8b635f32f59bd1f60ac608e864a77a1fde1b5f Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Wed, 12 Aug 2026 00:01:05 -0300 Subject: [PATCH] =?UTF-8?q?C130:=20rebase=20em=20main=20=E2=80=94=20C125?= =?UTF-8?q?=20(sort=20prim=C3=A1rio=20na=20omnibox)=20e=20aus=C3=AAncia=20?= =?UTF-8?q?'qualquer'=20reconciliados=20(party=20+=20Dobra=20em=20nos=20te?= =?UTF-8?q?stes)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/unit/peopleListUrl.unit.spec.ts | 3 ++- tests/unit/peopleOmnibox.unit.spec.ts | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/unit/peopleListUrl.unit.spec.ts b/tests/unit/peopleListUrl.unit.spec.ts index 2d2df6ed..ae844b55 100644 --- a/tests/unit/peopleListUrl.unit.spec.ts +++ b/tests/unit/peopleListUrl.unit.spec.ts @@ -212,7 +212,7 @@ describe('people list URL contract', () => { }) it('derives the omnibox primary sort options: one per key, in its default direction', () => { - expect(peopleListSortPrimaryOptions).toHaveLength(7) + expect(peopleListSortPrimaryOptions).toHaveLength(8) expect(peopleListSortPrimaryOptions.map((option) => option.key)).toEqual([ 'name', 'contact', @@ -221,6 +221,7 @@ describe('people list URL contract', () => { 'aliada', 'assessorado', 'base', + 'party', ]) for (const option of peopleListSortPrimaryOptions) { expect(option.dir).toBe(defaultPeopleListSortDir(option.key)) diff --git a/tests/unit/peopleOmnibox.unit.spec.ts b/tests/unit/peopleOmnibox.unit.spec.ts index 60f0e5c7..0d142d96 100644 --- a/tests/unit/peopleOmnibox.unit.spec.ts +++ b/tests/unit/peopleOmnibox.unit.spec.ts @@ -9,7 +9,10 @@ import { removePeopleOmniboxChip, } from '@/utilities/people/peopleOmnibox' -const seeds = buildPeopleOmniboxSuggestionSeeds({ municipalityFilterOptions: [] }) +const seeds = buildPeopleOmniboxSuggestionSeeds({ + municipalityFilterOptions: [], + partyFilterOptions: [], +}) const sortSeedsIn = (query: string) => filterPeopleOmniboxSuggestions(seeds, query).filter((entry) => entry.group === 'Ordenação') @@ -25,19 +28,20 @@ describe('people omnibox — sort discovery (C125)', () => { 'sort:aliada|desc', 'sort:assessorado|desc', 'sort:base|asc', + 'sort:party|asc', ]) - expect(suggestions.map((entry) => entry.label)).toContain('Aliada em (maior → menor)') + expect(suggestions.map((entry) => entry.label)).toContain('Dobra em (maior → menor)') expect(suggestions.map((entry) => entry.label)).toContain('Base (A–Z)') }) it('shows the Ordenação group on an empty query (mobile discovery)', () => { const suggestions = filterPeopleOmniboxSuggestions(seeds, '') expect(suggestions.some((entry) => entry.group === 'Ordenação')).toBe(true) - expect(sortSeedsIn('')).toHaveLength(7) + expect(sortSeedsIn('')).toHaveLength(8) }) - it('matches a sort column by its label, e.g. "aliada"', () => { - const suggestions = sortSeedsIn('aliada') + it('matches a sort column by its label, e.g. "dobra"', () => { + const suggestions = sortSeedsIn('dobra') expect(suggestions.map((entry) => entry.id)).toEqual(['sort:aliada|desc']) })