test(omnibox): cover search-only helpers for knip graph (#313)

Knip could not see exports only referenced from client filter components;
extend B128 unit spec so CI knip stays green.
This commit is contained in:
Cursor Agent 2026-08-02 23:25:50 +00:00
parent ea6641071e
commit 7fe42a5fa5
No known key found for this signature in database

View file

@ -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: {} })
})
})