mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
refactor(search): extract shared filter helper
Share filter parsing and provider mapping logic between Stork and upcoming search adapters. This keeps the existing Stork API stable while adding Pagefind-oriented filter serialization under test.
This commit is contained in:
parent
e5f28b16ee
commit
727f84e4c2
3 changed files with 135 additions and 120 deletions
|
|
@ -84,5 +84,19 @@ describe('StorkFilters', () => {
|
|||
filters.setFromString('test_works_yes')
|
||||
expect(filters.asQuery).toBe('test_works_yes')
|
||||
})
|
||||
|
||||
it('should map filters for Pagefind', () => {
|
||||
const filters = new StorkFilters()
|
||||
|
||||
filters.setFromStringArray([
|
||||
'status_native',
|
||||
'category_system_tools'
|
||||
])
|
||||
|
||||
expect(filters.asPagefindFilters).toEqual({
|
||||
status: [ 'native' ],
|
||||
category: [ 'system_tools' ]
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue