diff --git a/tests/unit/listOmniboxB128.unit.spec.ts b/tests/unit/listOmniboxB128.unit.spec.ts index 836311c5..0d49037c 100644 --- a/tests/unit/listOmniboxB128.unit.spec.ts +++ b/tests/unit/listOmniboxB128.unit.spec.ts @@ -3,6 +3,9 @@ import { describe, expect, it } from 'vitest' import { applySearchOnlyOmniboxSuggestion, buildSearchOnlyOmniboxChips, + buildSearchOnlyOmniboxSuggestions, + clearSearchOnlyOmnibox, + removeSearchOnlyOmniboxChip, } from '@/lib/searchOnlyListOmnibox' import { applyActivityOmniboxSuggestion, @@ -266,6 +269,7 @@ describe('list omnibox adapters (B128)', () => { expect(applied).toEqual({ kind: 'url', state: { page: 1, q: 'ana' } }) }) +<<<<<<< HEAD it('advisor toggles municipality portfolio filter and suggests by name', () => { const base = parseAdvisorListParams({}) const applied = applyAdvisorOmniboxSuggestion({ @@ -288,5 +292,22 @@ describe('list omnibox adapters (B128)', () => { }) const suggestions = filterAdvisorOmniboxSuggestions(seeds, 'feira') expect(suggestions.some((entry) => entry.group === 'MunicĂ­pio (carteira)')).toBe(true) +======= + it('search-only omnibox clears and removes chips', () => { + expect(buildSearchOnlyOmniboxSuggestions('')).toEqual([]) + + const removed = removeSearchOnlyOmniboxChip({ + state: { q: 'x', page: 2 }, + chipId: 'q', + withPageReset: (next) => ({ ...next, page: 1 }), + }) + expect(removed).toEqual({ kind: 'url', state: { page: 1, q: undefined } }) + + const cleared = clearSearchOnlyOmnibox({ + state: { q: 'x' }, + cleared: {}, + }) + expect(cleared).toEqual({ kind: 'clear', state: {} }) +>>>>>>> c2a8e54b (test(B128): cover search-only omnibox exports for knip graph) }) })