diff --git a/tests/unit/listOmniboxB128.unit.spec.ts b/tests/unit/listOmniboxB128.unit.spec.ts index 02ab4b39..9320e25e 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, @@ -144,5 +147,20 @@ describe('list omnibox adapters (B128)', () => { withPageReset: (next) => ({ ...next, page: 1 }), }) expect(applied).toEqual({ kind: 'url', state: { page: 1, q: 'ana' } }) + + expect(buildSearchOnlyOmniboxSuggestions('x')[0]?.id).toBe('q:x') + + const removed = removeSearchOnlyOmniboxChip({ + state: { q: 'sindicato', page: 2 }, + chipId: 'q', + withPageReset: (next) => ({ ...next, page: 1 }), + }) + expect(removed).toEqual({ kind: 'url', state: { page: 1, q: undefined } }) + + const cleared = clearSearchOnlyOmnibox({ + state: { q: 'sindicato' }, + cleared: {}, + }) + expect(cleared).toEqual({ kind: 'clear', state: {} }) }) })