mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-18 05:53:05 +00:00
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 {
|
import {
|
||||||
applySearchOnlyOmniboxSuggestion,
|
applySearchOnlyOmniboxSuggestion,
|
||||||
buildSearchOnlyOmniboxChips,
|
buildSearchOnlyOmniboxChips,
|
||||||
|
buildSearchOnlyOmniboxSuggestions,
|
||||||
|
clearSearchOnlyOmnibox,
|
||||||
|
removeSearchOnlyOmniboxChip,
|
||||||
} from '@/lib/searchOnlyListOmnibox'
|
} from '@/lib/searchOnlyListOmnibox'
|
||||||
import {
|
import {
|
||||||
applyActivityOmniboxSuggestion,
|
applyActivityOmniboxSuggestion,
|
||||||
|
|
@ -144,5 +147,20 @@ describe('list omnibox adapters (B128)', () => {
|
||||||
withPageReset: (next) => ({ ...next, page: 1 }),
|
withPageReset: (next) => ({ ...next, page: 1 }),
|
||||||
})
|
})
|
||||||
expect(applied).toEqual({ kind: 'url', state: { page: 1, q: 'ana' } })
|
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