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:
parent
ea6641071e
commit
7fe42a5fa5
1 changed files with 18 additions and 0 deletions
|
|
@ -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: {} })
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue