From 7fe42a5fa5e1c12d4ddd03a08e90dec56fdc53cb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 23:25:50 +0000 Subject: [PATCH] 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. --- tests/unit/listOmniboxB128.unit.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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: {} }) }) })