apps/web/src/lib/mediaSearch.test.ts
1import { expect, test } from 'bun:test'
2import { mediaTypeFilter } from './mediaSearch'
3
4test('formats remain exact while mixed requests and company research retain relevant scope', () => {
5 expect(mediaTypeFilter('What reports has UNLEASH published?')).toEqual({
6 type: { $in: ['report', 'research'] },
7 })
8 expect(mediaTypeFilter('AI articles and on-demand webinars')).toEqual({
9 type: { $in: ['webinar'] },
10 })
11 expect(mediaTypeFilter('Show podcasts and videos')).toEqual({
12 type: { $in: ['podcast', 'video'] },
13 })
14 expect(mediaTypeFilter('SAP')).toBeUndefined()
15})
16