@internetarchive/collection-browser 2.13.2-alpha-webdev7687.7 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/test/collection-browser.test.js +36 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.d.ts +1 -0
- package/dist/test/mocks/mock-search-responses.js +64 -0
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js +2 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +2 -2
- package/test/collection-browser.test.ts +54 -0
- package/test/mocks/mock-search-responses.ts +68 -0
- package/test/mocks/mock-search-service.ts +2 -0
- package/test/restoration-state-handler.test.ts +1 -4
|
@@ -688,6 +688,42 @@ describe('Collection Browser', () => {
|
|
|
688
688
|
},
|
|
689
689
|
});
|
|
690
690
|
});
|
|
691
|
+
it('applies correct search filter when TV clip filter set to commercials', async () => {
|
|
692
|
+
var _a, _b, _c;
|
|
693
|
+
const searchService = new MockSearchService();
|
|
694
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
695
|
+
</collection-browser>`);
|
|
696
|
+
el.baseQuery = 'tv-fields';
|
|
697
|
+
el.searchType = SearchType.TV;
|
|
698
|
+
el.tvClipFilter = 'commercials';
|
|
699
|
+
await el.updateComplete;
|
|
700
|
+
await el.initialSearchComplete;
|
|
701
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.ad_id) === null || _c === void 0 ? void 0 : _c['*']).to.equal(FilterConstraint.INCLUDE);
|
|
702
|
+
});
|
|
703
|
+
it('applies correct search filter when TV clip filter set to factchecks', async () => {
|
|
704
|
+
var _a, _b, _c;
|
|
705
|
+
const searchService = new MockSearchService();
|
|
706
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
707
|
+
</collection-browser>`);
|
|
708
|
+
el.baseQuery = 'tv-fields';
|
|
709
|
+
el.searchType = SearchType.TV;
|
|
710
|
+
el.tvClipFilter = 'factchecks';
|
|
711
|
+
await el.updateComplete;
|
|
712
|
+
await el.initialSearchComplete;
|
|
713
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.factcheck) === null || _c === void 0 ? void 0 : _c['*']).to.equal(FilterConstraint.INCLUDE);
|
|
714
|
+
});
|
|
715
|
+
it('applies correct search filter when TV clip filter set to quotes', async () => {
|
|
716
|
+
var _a, _b, _c;
|
|
717
|
+
const searchService = new MockSearchService();
|
|
718
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
719
|
+
</collection-browser>`);
|
|
720
|
+
el.baseQuery = 'tv-fields';
|
|
721
|
+
el.searchType = SearchType.TV;
|
|
722
|
+
el.tvClipFilter = 'quotes';
|
|
723
|
+
await el.updateComplete;
|
|
724
|
+
await el.initialSearchComplete;
|
|
725
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.clip) === null || _c === void 0 ? void 0 : _c['1']).to.equal(FilterConstraint.INCLUDE);
|
|
726
|
+
});
|
|
691
727
|
it('resets letter filters when query changes', async () => {
|
|
692
728
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
693
729
|
const searchService = new MockSearchService();
|