@internetarchive/collection-browser 2.22.1-alpha-webdev7818.4 → 2.22.1-alpha-webdev7761.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/src/collection-browser.d.ts +12 -5
- package/dist/src/collection-browser.js +785 -691
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets.js +12 -0
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +10 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +19 -1
- package/dist/src/data-source/collection-browser-data-source.js +36 -18
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.d.ts +1 -2
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.d.ts +11 -0
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.d.ts +2 -6
- package/dist/src/models.js +8 -12
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +1 -2
- package/dist/src/restoration-state-handler.js +3 -9
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +45 -45
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +97 -97
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +289 -289
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/test/collection-browser.test.js +206 -196
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js +5 -37
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/collection-browser.ts +2848 -2755
- package/src/collection-facets.ts +11 -0
- package/src/data-source/collection-browser-data-source-interface.ts +345 -333
- package/src/data-source/collection-browser-data-source.ts +1432 -1390
- package/src/data-source/collection-browser-query-state.ts +1 -7
- package/src/data-source/models.ts +13 -0
- package/src/models.ts +10 -14
- package/src/restoration-state-handler.ts +9 -11
- package/src/tiles/list/tile-list-compact-header.ts +86 -86
- package/src/tiles/list/tile-list-compact.ts +236 -236
- package/src/tiles/list/tile-list.ts +688 -688
- package/test/collection-browser.test.ts +2369 -2359
- package/test/restoration-state-handler.test.ts +12 -42
|
@@ -71,7 +71,7 @@ describe('Collection Browser', () => {
|
|
|
71
71
|
});
|
|
72
72
|
it('filterBy creator with analytics', async () => {
|
|
73
73
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
74
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
74
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
75
75
|
</collection-browser>`);
|
|
76
76
|
el.searchContext = 'betaSearchService';
|
|
77
77
|
el.selectedSort = 'creator';
|
|
@@ -90,7 +90,7 @@ describe('Collection Browser', () => {
|
|
|
90
90
|
});
|
|
91
91
|
it('filterBy title with analytics', async () => {
|
|
92
92
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
93
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
93
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
94
94
|
</collection-browser>`);
|
|
95
95
|
el.searchContext = 'beta-search-service';
|
|
96
96
|
el.selectedSort = 'title';
|
|
@@ -119,7 +119,7 @@ describe('Collection Browser', () => {
|
|
|
119
119
|
collection: {},
|
|
120
120
|
year: {},
|
|
121
121
|
};
|
|
122
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
122
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
123
123
|
</collection-browser>`);
|
|
124
124
|
el.searchContext = 'search-service';
|
|
125
125
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -166,7 +166,7 @@ describe('Collection Browser', () => {
|
|
|
166
166
|
collection: {},
|
|
167
167
|
year: {},
|
|
168
168
|
};
|
|
169
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
169
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
170
170
|
</collection-browser>`);
|
|
171
171
|
el.searchContext = 'beta-search-service';
|
|
172
172
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -204,7 +204,7 @@ describe('Collection Browser', () => {
|
|
|
204
204
|
it('should render with a sort bar, facets, and infinite scroller', async () => {
|
|
205
205
|
var _a, _b, _c;
|
|
206
206
|
const searchService = new MockSearchService();
|
|
207
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
207
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
208
208
|
</collection-browser>`);
|
|
209
209
|
el.baseQuery = 'hello';
|
|
210
210
|
await el.updateComplete;
|
|
@@ -219,7 +219,7 @@ describe('Collection Browser', () => {
|
|
|
219
219
|
it('queries the search service when given a base query', async () => {
|
|
220
220
|
var _a, _b, _c;
|
|
221
221
|
const searchService = new MockSearchService();
|
|
222
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
222
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
223
223
|
</collection-browser>`);
|
|
224
224
|
el.baseQuery = 'collection:foo';
|
|
225
225
|
await el.updateComplete;
|
|
@@ -230,7 +230,7 @@ describe('Collection Browser', () => {
|
|
|
230
230
|
it('queries the search service with a metadata search', async () => {
|
|
231
231
|
var _a, _b, _c;
|
|
232
232
|
const searchService = new MockSearchService();
|
|
233
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
233
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
234
234
|
</collection-browser>`);
|
|
235
235
|
el.searchType = SearchType.METADATA;
|
|
236
236
|
await el.updateComplete;
|
|
@@ -243,7 +243,7 @@ describe('Collection Browser', () => {
|
|
|
243
243
|
});
|
|
244
244
|
it('can change search type', async () => {
|
|
245
245
|
const searchService = new MockSearchService();
|
|
246
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
246
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
247
247
|
</collection-browser>`);
|
|
248
248
|
el.baseQuery = 'collection:foo';
|
|
249
249
|
await el.updateComplete;
|
|
@@ -255,7 +255,7 @@ describe('Collection Browser', () => {
|
|
|
255
255
|
it('queries the search service with a fulltext search', async () => {
|
|
256
256
|
var _a, _b, _c;
|
|
257
257
|
const searchService = new MockSearchService();
|
|
258
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
258
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
259
259
|
</collection-browser>`);
|
|
260
260
|
el.searchType = SearchType.FULLTEXT;
|
|
261
261
|
await el.updateComplete;
|
|
@@ -269,7 +269,7 @@ describe('Collection Browser', () => {
|
|
|
269
269
|
it('queries the search service with a radio search', async () => {
|
|
270
270
|
var _a, _b, _c;
|
|
271
271
|
const searchService = new MockSearchService();
|
|
272
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
272
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
273
273
|
</collection-browser>`);
|
|
274
274
|
el.searchType = SearchType.RADIO;
|
|
275
275
|
await el.updateComplete;
|
|
@@ -283,7 +283,7 @@ describe('Collection Browser', () => {
|
|
|
283
283
|
it('queries the search service with a TV search', async () => {
|
|
284
284
|
var _a, _b, _c;
|
|
285
285
|
const searchService = new MockSearchService();
|
|
286
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
286
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
287
287
|
</collection-browser>`);
|
|
288
288
|
el.searchType = SearchType.TV;
|
|
289
289
|
await el.updateComplete;
|
|
@@ -323,7 +323,7 @@ describe('Collection Browser', () => {
|
|
|
323
323
|
collection: {},
|
|
324
324
|
year: {},
|
|
325
325
|
};
|
|
326
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
326
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
327
327
|
</collection-browser>`);
|
|
328
328
|
el.baseQuery = 'collection:foo';
|
|
329
329
|
el.selectedFacets = selectedFacets;
|
|
@@ -356,7 +356,7 @@ describe('Collection Browser', () => {
|
|
|
356
356
|
url.searchParams.append('sin', 'TXT');
|
|
357
357
|
window.history.replaceState({}, '', url);
|
|
358
358
|
const searchService = new MockSearchService();
|
|
359
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
359
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
360
360
|
</collection-browser>`);
|
|
361
361
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
362
362
|
});
|
|
@@ -366,10 +366,10 @@ describe('Collection Browser', () => {
|
|
|
366
366
|
url.searchParams.append('sin', 'TXT');
|
|
367
367
|
window.history.replaceState({}, '', url);
|
|
368
368
|
const searchService = new MockSearchService();
|
|
369
|
-
const el = await fixture(html `<collection-browser
|
|
370
|
-
.searchService=${searchService}
|
|
371
|
-
suppressURLSinParam
|
|
372
|
-
>
|
|
369
|
+
const el = await fixture(html `<collection-browser
|
|
370
|
+
.searchService=${searchService}
|
|
371
|
+
suppressURLSinParam
|
|
372
|
+
>
|
|
373
373
|
</collection-browser>`);
|
|
374
374
|
url = new URL(window.location.href);
|
|
375
375
|
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
@@ -381,7 +381,7 @@ describe('Collection Browser', () => {
|
|
|
381
381
|
});
|
|
382
382
|
it('can construct tile models with many fields present', async () => {
|
|
383
383
|
const searchService = new MockSearchService();
|
|
384
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
384
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
385
385
|
</collection-browser>`);
|
|
386
386
|
el.baseQuery = 'many-fields';
|
|
387
387
|
await el.updateComplete;
|
|
@@ -394,10 +394,10 @@ describe('Collection Browser', () => {
|
|
|
394
394
|
it('emits empty results event when search fetches no results', async () => {
|
|
395
395
|
const searchService = new MockSearchService();
|
|
396
396
|
const emptyResultsSpy = sinon.spy();
|
|
397
|
-
const el = await fixture(html `<collection-browser
|
|
398
|
-
.searchService=${searchService}
|
|
399
|
-
@emptyResults=${emptyResultsSpy}
|
|
400
|
-
>
|
|
397
|
+
const el = await fixture(html `<collection-browser
|
|
398
|
+
.searchService=${searchService}
|
|
399
|
+
@emptyResults=${emptyResultsSpy}
|
|
400
|
+
>
|
|
401
401
|
</collection-browser>`);
|
|
402
402
|
el.baseQuery = 'no-results';
|
|
403
403
|
await el.updateComplete;
|
|
@@ -407,7 +407,7 @@ describe('Collection Browser', () => {
|
|
|
407
407
|
it('applies loggedin flag to tile models if needed', async () => {
|
|
408
408
|
var _a;
|
|
409
409
|
const searchService = new MockSearchService();
|
|
410
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
410
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
411
411
|
</collection-browser>`);
|
|
412
412
|
el.baseQuery = 'loggedin';
|
|
413
413
|
await el.updateComplete;
|
|
@@ -421,7 +421,7 @@ describe('Collection Browser', () => {
|
|
|
421
421
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
422
422
|
var _a;
|
|
423
423
|
const searchService = new MockSearchService();
|
|
424
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
424
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
425
425
|
</collection-browser>`);
|
|
426
426
|
el.baseQuery = 'no-preview';
|
|
427
427
|
await el.updateComplete;
|
|
@@ -435,7 +435,7 @@ describe('Collection Browser', () => {
|
|
|
435
435
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
436
436
|
var _a, _b;
|
|
437
437
|
const searchService = new MockSearchService();
|
|
438
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
438
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
439
439
|
</collection-browser>`);
|
|
440
440
|
el.baseQuery = 'loggedin-no-preview';
|
|
441
441
|
await el.updateComplete;
|
|
@@ -450,7 +450,7 @@ describe('Collection Browser', () => {
|
|
|
450
450
|
it('joins full description array into a single string with line breaks', async () => {
|
|
451
451
|
var _a;
|
|
452
452
|
const searchService = new MockSearchService();
|
|
453
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
453
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
454
454
|
</collection-browser>`);
|
|
455
455
|
// This query receives an array description like ['line1', 'line2']
|
|
456
456
|
el.baseQuery = 'multi-line-description';
|
|
@@ -466,9 +466,9 @@ describe('Collection Browser', () => {
|
|
|
466
466
|
it('can change search type', async () => {
|
|
467
467
|
var _a;
|
|
468
468
|
const searchService = new MockSearchService();
|
|
469
|
-
const el = await fixture(html `<collection-browser
|
|
470
|
-
.searchService=${searchService}
|
|
471
|
-
.searchType=${SearchType.METADATA}
|
|
469
|
+
const el = await fixture(html `<collection-browser
|
|
470
|
+
.searchService=${searchService}
|
|
471
|
+
.searchType=${SearchType.METADATA}
|
|
472
472
|
></collection-browser>`);
|
|
473
473
|
el.baseQuery = 'collection:foo';
|
|
474
474
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -480,8 +480,8 @@ describe('Collection Browser', () => {
|
|
|
480
480
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
481
481
|
var _a;
|
|
482
482
|
const searchService = new MockSearchService();
|
|
483
|
-
const el = await fixture(html `<collection-browser
|
|
484
|
-
.searchService=${searchService}
|
|
483
|
+
const el = await fixture(html `<collection-browser
|
|
484
|
+
.searchService=${searchService}
|
|
485
485
|
></collection-browser>`);
|
|
486
486
|
el.baseQuery = ' collection:foo ';
|
|
487
487
|
await el.updateComplete;
|
|
@@ -491,8 +491,8 @@ describe('Collection Browser', () => {
|
|
|
491
491
|
it('shows error message when error response received', async () => {
|
|
492
492
|
var _a, _b;
|
|
493
493
|
const searchService = new MockSearchService();
|
|
494
|
-
const el = await fixture(html `<collection-browser
|
|
495
|
-
.searchService=${searchService}
|
|
494
|
+
const el = await fixture(html `<collection-browser
|
|
495
|
+
.searchService=${searchService}
|
|
496
496
|
></collection-browser>`);
|
|
497
497
|
el.baseQuery = 'error';
|
|
498
498
|
await el.updateComplete;
|
|
@@ -505,8 +505,8 @@ describe('Collection Browser', () => {
|
|
|
505
505
|
it('shows error message when error response received for a collection', async () => {
|
|
506
506
|
var _a, _b;
|
|
507
507
|
const searchService = new MockSearchService();
|
|
508
|
-
const el = await fixture(html `<collection-browser
|
|
509
|
-
.searchService=${searchService}
|
|
508
|
+
const el = await fixture(html `<collection-browser
|
|
509
|
+
.searchService=${searchService}
|
|
510
510
|
></collection-browser>`);
|
|
511
511
|
el.withinCollection = 'error';
|
|
512
512
|
await el.updateComplete;
|
|
@@ -521,8 +521,8 @@ describe('Collection Browser', () => {
|
|
|
521
521
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
522
522
|
window.Sentry = { captureMessage: sentrySpy };
|
|
523
523
|
const searchService = new MockSearchService();
|
|
524
|
-
const el = await fixture(html `<collection-browser
|
|
525
|
-
.searchService=${searchService}
|
|
524
|
+
const el = await fixture(html `<collection-browser
|
|
525
|
+
.searchService=${searchService}
|
|
526
526
|
></collection-browser>`);
|
|
527
527
|
el.baseQuery = 'malformed';
|
|
528
528
|
await el.updateComplete;
|
|
@@ -531,7 +531,7 @@ describe('Collection Browser', () => {
|
|
|
531
531
|
});
|
|
532
532
|
it('adds collection names to cache when present on response', async () => {
|
|
533
533
|
const searchService = new MockSearchService();
|
|
534
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
534
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
535
535
|
</collection-browser>`);
|
|
536
536
|
el.baseQuery = 'collection-titles';
|
|
537
537
|
await el.updateComplete;
|
|
@@ -543,7 +543,7 @@ describe('Collection Browser', () => {
|
|
|
543
543
|
});
|
|
544
544
|
it('adds tv channel aliases to cache when present on response', async () => {
|
|
545
545
|
const searchService = new MockSearchService();
|
|
546
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
546
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
547
547
|
</collection-browser>`);
|
|
548
548
|
el.baseQuery = 'channel-aliases';
|
|
549
549
|
await el.updateComplete;
|
|
@@ -557,7 +557,7 @@ describe('Collection Browser', () => {
|
|
|
557
557
|
asyncResponse: true,
|
|
558
558
|
resultsSpy,
|
|
559
559
|
});
|
|
560
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
560
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
561
561
|
</collection-browser>`);
|
|
562
562
|
el.baseQuery = 'with-sort';
|
|
563
563
|
el.selectedSort = SortField.date;
|
|
@@ -574,7 +574,7 @@ describe('Collection Browser', () => {
|
|
|
574
574
|
asyncResponse: true,
|
|
575
575
|
resultsSpy,
|
|
576
576
|
});
|
|
577
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
577
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
578
578
|
</collection-browser>`);
|
|
579
579
|
el.baseQuery = 'with-sort';
|
|
580
580
|
el.selectedSort = SortField.date;
|
|
@@ -596,7 +596,7 @@ describe('Collection Browser', () => {
|
|
|
596
596
|
asyncResponse: true,
|
|
597
597
|
resultsSpy,
|
|
598
598
|
});
|
|
599
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
599
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
600
600
|
</collection-browser>`);
|
|
601
601
|
el.baseQuery = 'single-result';
|
|
602
602
|
await el.updateComplete;
|
|
@@ -617,7 +617,7 @@ describe('Collection Browser', () => {
|
|
|
617
617
|
asyncResponse: true,
|
|
618
618
|
resultsSpy,
|
|
619
619
|
});
|
|
620
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
620
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
621
621
|
</collection-browser>`);
|
|
622
622
|
el.baseQuery = 'with-sort';
|
|
623
623
|
el.selectedSort = SortField.date;
|
|
@@ -636,7 +636,7 @@ describe('Collection Browser', () => {
|
|
|
636
636
|
it('sets sort properties when user changes sort', async () => {
|
|
637
637
|
var _a, _b, _c, _d, _e, _f;
|
|
638
638
|
const searchService = new MockSearchService();
|
|
639
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
639
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
640
640
|
</collection-browser>`);
|
|
641
641
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
642
642
|
el.baseQuery = 'foo';
|
|
@@ -659,7 +659,7 @@ describe('Collection Browser', () => {
|
|
|
659
659
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
660
660
|
var _a, _b, _c, _d;
|
|
661
661
|
const searchService = new MockSearchService();
|
|
662
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
662
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
663
663
|
</collection-browser>`);
|
|
664
664
|
el.baseQuery = 'first-title';
|
|
665
665
|
el.selectedSort = 'title';
|
|
@@ -673,7 +673,7 @@ describe('Collection Browser', () => {
|
|
|
673
673
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
674
674
|
var _a, _b, _c, _d;
|
|
675
675
|
const searchService = new MockSearchService();
|
|
676
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
676
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
677
677
|
</collection-browser>`);
|
|
678
678
|
el.baseQuery = 'first-creator';
|
|
679
679
|
el.selectedSort = 'creator';
|
|
@@ -696,7 +696,7 @@ describe('Collection Browser', () => {
|
|
|
696
696
|
subject: {},
|
|
697
697
|
year: {},
|
|
698
698
|
};
|
|
699
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
699
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
700
700
|
</collection-browser>`);
|
|
701
701
|
el.baseQuery = 'first-creator';
|
|
702
702
|
el.selectedSort = 'creator';
|
|
@@ -721,46 +721,56 @@ describe('Collection Browser', () => {
|
|
|
721
721
|
},
|
|
722
722
|
});
|
|
723
723
|
});
|
|
724
|
-
it('applies correct
|
|
724
|
+
it('applies correct TV search filter for commercials', async () => {
|
|
725
725
|
var _a, _b, _c;
|
|
726
726
|
const searchService = new MockSearchService();
|
|
727
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
727
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
728
728
|
</collection-browser>`);
|
|
729
729
|
el.baseQuery = 'tv-fields';
|
|
730
730
|
el.searchType = SearchType.TV;
|
|
731
|
-
el.
|
|
731
|
+
el.selectedFacets = {
|
|
732
|
+
clip_type: {
|
|
733
|
+
commercial: { key: 'commercial', count: 1, state: 'selected' },
|
|
734
|
+
},
|
|
735
|
+
};
|
|
732
736
|
await el.updateComplete;
|
|
733
737
|
await el.initialSearchComplete;
|
|
734
|
-
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.
|
|
738
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.clip_type) === null || _c === void 0 ? void 0 : _c.commercial).to.equal(FilterConstraint.INCLUDE);
|
|
735
739
|
});
|
|
736
|
-
it('applies correct
|
|
740
|
+
it('applies correct TV search filter for fact checks', async () => {
|
|
737
741
|
var _a, _b, _c;
|
|
738
742
|
const searchService = new MockSearchService();
|
|
739
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
743
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
740
744
|
</collection-browser>`);
|
|
741
745
|
el.baseQuery = 'tv-fields';
|
|
742
746
|
el.searchType = SearchType.TV;
|
|
743
|
-
el.
|
|
747
|
+
el.selectedFacets = {
|
|
748
|
+
clip_type: {
|
|
749
|
+
'fact check': { key: 'fact check', count: 1, state: 'selected' },
|
|
750
|
+
},
|
|
751
|
+
};
|
|
744
752
|
await el.updateComplete;
|
|
745
753
|
await el.initialSearchComplete;
|
|
746
|
-
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.
|
|
754
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.clip_type) === null || _c === void 0 ? void 0 : _c['fact check']).to.equal(FilterConstraint.INCLUDE);
|
|
747
755
|
});
|
|
748
|
-
it('applies correct
|
|
756
|
+
it('applies correct TV search filter for quotes', async () => {
|
|
749
757
|
var _a, _b, _c;
|
|
750
758
|
const searchService = new MockSearchService();
|
|
751
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
759
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
752
760
|
</collection-browser>`);
|
|
753
761
|
el.baseQuery = 'tv-fields';
|
|
754
762
|
el.searchType = SearchType.TV;
|
|
755
|
-
el.
|
|
763
|
+
el.selectedFacets = {
|
|
764
|
+
clip_type: { quote: { key: 'quote', count: 1, state: 'selected' } },
|
|
765
|
+
};
|
|
756
766
|
await el.updateComplete;
|
|
757
767
|
await el.initialSearchComplete;
|
|
758
|
-
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.
|
|
768
|
+
expect((_c = (_b = (_a = searchService.searchParams) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.clip_type) === null || _c === void 0 ? void 0 : _c.quote).to.equal(FilterConstraint.INCLUDE);
|
|
759
769
|
});
|
|
760
770
|
it('resets letter filters when query changes', async () => {
|
|
761
771
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
762
772
|
const searchService = new MockSearchService();
|
|
763
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
773
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
764
774
|
</collection-browser>`);
|
|
765
775
|
el.baseQuery = 'first-creator';
|
|
766
776
|
el.selectedSort = 'creator';
|
|
@@ -781,11 +791,11 @@ describe('Collection Browser', () => {
|
|
|
781
791
|
var _a, _b, _c;
|
|
782
792
|
const searchService = new MockSearchService();
|
|
783
793
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
784
|
-
const el = await fixture(html `<collection-browser
|
|
785
|
-
.searchService=${searchService}
|
|
786
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
787
|
-
.suppressPlaceholders=${true}
|
|
788
|
-
>
|
|
794
|
+
const el = await fixture(html `<collection-browser
|
|
795
|
+
.searchService=${searchService}
|
|
796
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
797
|
+
.suppressPlaceholders=${true}
|
|
798
|
+
>
|
|
789
799
|
</collection-browser>`);
|
|
790
800
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
791
801
|
el.showHistogramDatePicker = true;
|
|
@@ -814,10 +824,10 @@ describe('Collection Browser', () => {
|
|
|
814
824
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
815
825
|
var _a, _b, _c;
|
|
816
826
|
const searchService = new MockSearchService();
|
|
817
|
-
const el = await fixture(html `<collection-browser
|
|
818
|
-
.searchService=${searchService}
|
|
819
|
-
.suppressPlaceholders=${true}
|
|
820
|
-
>
|
|
827
|
+
const el = await fixture(html `<collection-browser
|
|
828
|
+
.searchService=${searchService}
|
|
829
|
+
.suppressPlaceholders=${true}
|
|
830
|
+
>
|
|
821
831
|
</collection-browser>`);
|
|
822
832
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
823
833
|
el.searchType = SearchType.TV;
|
|
@@ -848,9 +858,9 @@ describe('Collection Browser', () => {
|
|
|
848
858
|
var _a, _b, _c, _d;
|
|
849
859
|
const spy = sinon.spy();
|
|
850
860
|
const searchService = new MockSearchService();
|
|
851
|
-
const el = await fixture(html `<collection-browser
|
|
852
|
-
.searchService=${searchService}
|
|
853
|
-
@searchResultsLoadingChanged=${spy}
|
|
861
|
+
const el = await fixture(html `<collection-browser
|
|
862
|
+
.searchService=${searchService}
|
|
863
|
+
@searchResultsLoadingChanged=${spy}
|
|
854
864
|
></collection-browser>`);
|
|
855
865
|
spy.resetHistory();
|
|
856
866
|
el.baseQuery = 'collection:foo';
|
|
@@ -864,9 +874,9 @@ describe('Collection Browser', () => {
|
|
|
864
874
|
it('collapses extra set of quotes around href field', async () => {
|
|
865
875
|
var _a;
|
|
866
876
|
const searchService = new MockSearchService();
|
|
867
|
-
const el = await fixture(html `<collection-browser
|
|
868
|
-
.searchService=${searchService}
|
|
869
|
-
.baseNavigationUrl=${''}
|
|
877
|
+
const el = await fixture(html `<collection-browser
|
|
878
|
+
.searchService=${searchService}
|
|
879
|
+
.baseNavigationUrl=${''}
|
|
870
880
|
></collection-browser>`);
|
|
871
881
|
el.baseQuery = 'extra-quoted-href';
|
|
872
882
|
await el.updateComplete;
|
|
@@ -879,9 +889,9 @@ describe('Collection Browser', () => {
|
|
|
879
889
|
it('sets default sort from collection metadata', async () => {
|
|
880
890
|
var _a;
|
|
881
891
|
const searchService = new MockSearchService();
|
|
882
|
-
const el = await fixture(html `<collection-browser
|
|
883
|
-
.searchService=${searchService}
|
|
884
|
-
.baseNavigationUrl=${''}
|
|
892
|
+
const el = await fixture(html `<collection-browser
|
|
893
|
+
.searchService=${searchService}
|
|
894
|
+
.baseNavigationUrl=${''}
|
|
885
895
|
></collection-browser>`);
|
|
886
896
|
el.withinCollection = 'default-sort';
|
|
887
897
|
await el.updateComplete;
|
|
@@ -898,9 +908,9 @@ describe('Collection Browser', () => {
|
|
|
898
908
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
899
909
|
var _a;
|
|
900
910
|
const searchService = new MockSearchService();
|
|
901
|
-
const el = await fixture(html `<collection-browser
|
|
902
|
-
.searchService=${searchService}
|
|
903
|
-
.baseNavigationUrl=${''}
|
|
911
|
+
const el = await fixture(html `<collection-browser
|
|
912
|
+
.searchService=${searchService}
|
|
913
|
+
.baseNavigationUrl=${''}
|
|
904
914
|
></collection-browser>`);
|
|
905
915
|
el.withinCollection = 'default-sort-concise';
|
|
906
916
|
await el.updateComplete;
|
|
@@ -915,8 +925,8 @@ describe('Collection Browser', () => {
|
|
|
915
925
|
expect(sortBar.sortDirection).to.be.null;
|
|
916
926
|
});
|
|
917
927
|
it('falls back to weekly views default sorting on profiles when tab not set', async () => {
|
|
918
|
-
const el = await fixture(html `<collection-browser
|
|
919
|
-
.withinProfile=${'@foobar'}
|
|
928
|
+
const el = await fixture(html `<collection-browser
|
|
929
|
+
.withinProfile=${'@foobar'}
|
|
920
930
|
></collection-browser>`);
|
|
921
931
|
el.applyDefaultProfileSort();
|
|
922
932
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -927,9 +937,9 @@ describe('Collection Browser', () => {
|
|
|
927
937
|
it('uses relevance sort as default when a query is set', async () => {
|
|
928
938
|
var _a;
|
|
929
939
|
const searchService = new MockSearchService();
|
|
930
|
-
const el = await fixture(html `<collection-browser
|
|
931
|
-
.searchService=${searchService}
|
|
932
|
-
.baseNavigationUrl=${''}
|
|
940
|
+
const el = await fixture(html `<collection-browser
|
|
941
|
+
.searchService=${searchService}
|
|
942
|
+
.baseNavigationUrl=${''}
|
|
933
943
|
></collection-browser>`);
|
|
934
944
|
el.withinCollection = 'default-sort';
|
|
935
945
|
el.baseQuery = 'default-sort';
|
|
@@ -947,9 +957,9 @@ describe('Collection Browser', () => {
|
|
|
947
957
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
948
958
|
var _a;
|
|
949
959
|
const searchService = new MockSearchService();
|
|
950
|
-
const el = await fixture(html `<collection-browser
|
|
951
|
-
.searchService=${searchService}
|
|
952
|
-
.baseNavigationUrl=${''}
|
|
960
|
+
const el = await fixture(html `<collection-browser
|
|
961
|
+
.searchService=${searchService}
|
|
962
|
+
.baseNavigationUrl=${''}
|
|
953
963
|
></collection-browser>`);
|
|
954
964
|
el.withinCollection = 'fav-sort';
|
|
955
965
|
await el.updateComplete;
|
|
@@ -966,7 +976,7 @@ describe('Collection Browser', () => {
|
|
|
966
976
|
it('scrolls to page', async () => {
|
|
967
977
|
var _a;
|
|
968
978
|
const searchService = new MockSearchService();
|
|
969
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
979
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
970
980
|
</collection-browser>`);
|
|
971
981
|
// Infinite scroller won't exist unless there's a base query.
|
|
972
982
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -988,9 +998,9 @@ describe('Collection Browser', () => {
|
|
|
988
998
|
it('shows mobile facets in mobile view', async () => {
|
|
989
999
|
var _a, _b;
|
|
990
1000
|
const searchService = new MockSearchService();
|
|
991
|
-
const el = await fixture(html `<collection-browser
|
|
992
|
-
.searchService=${searchService}
|
|
993
|
-
.mobileBreakpoint=${9999}
|
|
1001
|
+
const el = await fixture(html `<collection-browser
|
|
1002
|
+
.searchService=${searchService}
|
|
1003
|
+
.mobileBreakpoint=${9999}
|
|
994
1004
|
></collection-browser>`);
|
|
995
1005
|
el.baseQuery = 'collection:foo';
|
|
996
1006
|
await el.updateComplete;
|
|
@@ -1010,11 +1020,11 @@ describe('Collection Browser', () => {
|
|
|
1010
1020
|
var _a, _b;
|
|
1011
1021
|
const searchService = new MockSearchService();
|
|
1012
1022
|
const analyticsHandler = new MockAnalyticsHandler();
|
|
1013
|
-
const el = await fixture(html `<collection-browser
|
|
1014
|
-
.searchService=${searchService}
|
|
1015
|
-
.analyticsHandler=${analyticsHandler}
|
|
1016
|
-
.searchContext=${'foobar-context'}
|
|
1017
|
-
.mobileBreakpoint=${9999}
|
|
1023
|
+
const el = await fixture(html `<collection-browser
|
|
1024
|
+
.searchService=${searchService}
|
|
1025
|
+
.analyticsHandler=${analyticsHandler}
|
|
1026
|
+
.searchContext=${'foobar-context'}
|
|
1027
|
+
.mobileBreakpoint=${9999}
|
|
1018
1028
|
></collection-browser>`);
|
|
1019
1029
|
el.baseQuery = 'collection:foo';
|
|
1020
1030
|
await el.updateComplete;
|
|
@@ -1054,9 +1064,9 @@ describe('Collection Browser', () => {
|
|
|
1054
1064
|
});
|
|
1055
1065
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1056
1066
|
const searchService = new MockSearchService();
|
|
1057
|
-
const el = await fixture(html `<collection-browser
|
|
1058
|
-
.searchService=${searchService}
|
|
1059
|
-
.withinCollection=${'fake'}
|
|
1067
|
+
const el = await fixture(html `<collection-browser
|
|
1068
|
+
.searchService=${searchService}
|
|
1069
|
+
.withinCollection=${'fake'}
|
|
1060
1070
|
></collection-browser>`);
|
|
1061
1071
|
el.baseQuery = 'parent-collections';
|
|
1062
1072
|
await el.updateComplete;
|
|
@@ -1066,9 +1076,9 @@ describe('Collection Browser', () => {
|
|
|
1066
1076
|
});
|
|
1067
1077
|
it('recognizes TV collections', async () => {
|
|
1068
1078
|
const searchService = new MockSearchService();
|
|
1069
|
-
const el = await fixture(html `<collection-browser
|
|
1070
|
-
.searchService=${searchService}
|
|
1071
|
-
.withinCollection=${'TV-FOO'}
|
|
1079
|
+
const el = await fixture(html `<collection-browser
|
|
1080
|
+
.searchService=${searchService}
|
|
1081
|
+
.withinCollection=${'TV-FOO'}
|
|
1072
1082
|
></collection-browser>`);
|
|
1073
1083
|
el.baseQuery = 'tv-collection';
|
|
1074
1084
|
await el.updateComplete;
|
|
@@ -1080,9 +1090,9 @@ describe('Collection Browser', () => {
|
|
|
1080
1090
|
var _a;
|
|
1081
1091
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1082
1092
|
const searchService = new MockSearchService();
|
|
1083
|
-
const el = await fixture(html `<collection-browser
|
|
1084
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1085
|
-
.searchService=${searchService}
|
|
1093
|
+
const el = await fixture(html `<collection-browser
|
|
1094
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1095
|
+
.searchService=${searchService}
|
|
1086
1096
|
></collection-browser>`);
|
|
1087
1097
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1088
1098
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1128,7 +1138,7 @@ describe('Collection Browser', () => {
|
|
|
1128
1138
|
it('query the search service for single result', async () => {
|
|
1129
1139
|
var _a, _b;
|
|
1130
1140
|
const searchService = new MockSearchService();
|
|
1131
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1141
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1132
1142
|
</collection-browser>`);
|
|
1133
1143
|
el.baseQuery = 'single-result';
|
|
1134
1144
|
await el.updateComplete;
|
|
@@ -1157,7 +1167,7 @@ describe('Collection Browser', () => {
|
|
|
1157
1167
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1158
1168
|
window.history.replaceState({}, '', url);
|
|
1159
1169
|
const searchService = new MockSearchService();
|
|
1160
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1170
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1161
1171
|
</collection-browser>`);
|
|
1162
1172
|
await el.initialSearchComplete;
|
|
1163
1173
|
await el.updateComplete;
|
|
@@ -1183,10 +1193,10 @@ describe('Collection Browser', () => {
|
|
|
1183
1193
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1184
1194
|
window.history.replaceState({}, '', url);
|
|
1185
1195
|
const searchService = new MockSearchService();
|
|
1186
|
-
const el = await fixture(html `<collection-browser
|
|
1187
|
-
.searchService=${searchService}
|
|
1188
|
-
.withinCollection=${'foobar'}
|
|
1189
|
-
>
|
|
1196
|
+
const el = await fixture(html `<collection-browser
|
|
1197
|
+
.searchService=${searchService}
|
|
1198
|
+
.withinCollection=${'foobar'}
|
|
1199
|
+
>
|
|
1190
1200
|
</collection-browser>`);
|
|
1191
1201
|
await el.initialSearchComplete;
|
|
1192
1202
|
await el.updateComplete;
|
|
@@ -1211,11 +1221,11 @@ describe('Collection Browser', () => {
|
|
|
1211
1221
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1212
1222
|
window.history.replaceState({}, '', url);
|
|
1213
1223
|
const searchService = new MockSearchService();
|
|
1214
|
-
const el = await fixture(html `<collection-browser
|
|
1215
|
-
.searchService=${searchService}
|
|
1216
|
-
.withinProfile=${'@foobar'}
|
|
1217
|
-
.profileElement=${'uploads'}
|
|
1218
|
-
>
|
|
1224
|
+
const el = await fixture(html `<collection-browser
|
|
1225
|
+
.searchService=${searchService}
|
|
1226
|
+
.withinProfile=${'@foobar'}
|
|
1227
|
+
.profileElement=${'uploads'}
|
|
1228
|
+
>
|
|
1219
1229
|
</collection-browser>`);
|
|
1220
1230
|
await el.initialSearchComplete;
|
|
1221
1231
|
await el.updateComplete;
|
|
@@ -1242,7 +1252,7 @@ describe('Collection Browser', () => {
|
|
|
1242
1252
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1243
1253
|
window.history.replaceState({}, '', url);
|
|
1244
1254
|
const searchService = new MockSearchService();
|
|
1245
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1255
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1246
1256
|
</collection-browser>`);
|
|
1247
1257
|
await el.initialSearchComplete;
|
|
1248
1258
|
await el.updateComplete;
|
|
@@ -1270,10 +1280,10 @@ describe('Collection Browser', () => {
|
|
|
1270
1280
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1271
1281
|
window.history.replaceState({}, '', url);
|
|
1272
1282
|
const searchService = new MockSearchService();
|
|
1273
|
-
const el = await fixture(html `<collection-browser
|
|
1274
|
-
.searchService=${searchService}
|
|
1275
|
-
.withinCollection=${'foobar'}
|
|
1276
|
-
>
|
|
1283
|
+
const el = await fixture(html `<collection-browser
|
|
1284
|
+
.searchService=${searchService}
|
|
1285
|
+
.withinCollection=${'foobar'}
|
|
1286
|
+
>
|
|
1277
1287
|
</collection-browser>`);
|
|
1278
1288
|
el.baseQuery = 'bar';
|
|
1279
1289
|
await el.updateComplete;
|
|
@@ -1300,10 +1310,10 @@ describe('Collection Browser', () => {
|
|
|
1300
1310
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1301
1311
|
window.history.replaceState({}, '', url);
|
|
1302
1312
|
const searchService = new MockSearchService();
|
|
1303
|
-
const el = await fixture(html `<collection-browser
|
|
1304
|
-
.searchService=${searchService}
|
|
1305
|
-
.withinCollection=${'foobar'}
|
|
1306
|
-
>
|
|
1313
|
+
const el = await fixture(html `<collection-browser
|
|
1314
|
+
.searchService=${searchService}
|
|
1315
|
+
.withinCollection=${'foobar'}
|
|
1316
|
+
>
|
|
1307
1317
|
</collection-browser>`);
|
|
1308
1318
|
el.withinCollection = 'bar';
|
|
1309
1319
|
await el.updateComplete;
|
|
@@ -1320,11 +1330,11 @@ describe('Collection Browser', () => {
|
|
|
1320
1330
|
it('correctly retrieves web archive hits', async () => {
|
|
1321
1331
|
var _a, _b, _c;
|
|
1322
1332
|
const searchService = new MockSearchService();
|
|
1323
|
-
const el = await fixture(html `<collection-browser
|
|
1324
|
-
.searchService=${searchService}
|
|
1325
|
-
.withinProfile=${'@foo'}
|
|
1326
|
-
.profileElement=${'web_archives'}
|
|
1327
|
-
>
|
|
1333
|
+
const el = await fixture(html `<collection-browser
|
|
1334
|
+
.searchService=${searchService}
|
|
1335
|
+
.withinProfile=${'@foo'}
|
|
1336
|
+
.profileElement=${'web_archives'}
|
|
1337
|
+
>
|
|
1328
1338
|
</collection-browser>`);
|
|
1329
1339
|
el.baseQuery = 'web-archive';
|
|
1330
1340
|
await el.updateComplete;
|
|
@@ -1338,10 +1348,10 @@ describe('Collection Browser', () => {
|
|
|
1338
1348
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1339
1349
|
var _a;
|
|
1340
1350
|
const searchService = new MockSearchService();
|
|
1341
|
-
const el = await fixture(html `<collection-browser
|
|
1342
|
-
.searchService=${searchService}
|
|
1343
|
-
facetLoadStrategy=${'opt-in'}
|
|
1344
|
-
>
|
|
1351
|
+
const el = await fixture(html `<collection-browser
|
|
1352
|
+
.searchService=${searchService}
|
|
1353
|
+
facetLoadStrategy=${'opt-in'}
|
|
1354
|
+
>
|
|
1345
1355
|
</collection-browser>`);
|
|
1346
1356
|
el.baseQuery = 'foo';
|
|
1347
1357
|
await el.updateComplete;
|
|
@@ -1352,10 +1362,10 @@ describe('Collection Browser', () => {
|
|
|
1352
1362
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1353
1363
|
var _a, _b;
|
|
1354
1364
|
const searchService = new MockSearchService();
|
|
1355
|
-
const el = await fixture(html `<collection-browser
|
|
1356
|
-
.searchService=${searchService}
|
|
1357
|
-
facetLoadStrategy=${'off'}
|
|
1358
|
-
>
|
|
1365
|
+
const el = await fixture(html `<collection-browser
|
|
1366
|
+
.searchService=${searchService}
|
|
1367
|
+
facetLoadStrategy=${'off'}
|
|
1368
|
+
>
|
|
1359
1369
|
</collection-browser>`);
|
|
1360
1370
|
el.baseQuery = 'foo';
|
|
1361
1371
|
await el.updateComplete;
|
|
@@ -1367,7 +1377,7 @@ describe('Collection Browser', () => {
|
|
|
1367
1377
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1368
1378
|
var _a, _b, _c, _d;
|
|
1369
1379
|
const searchService = new MockSearchService();
|
|
1370
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1380
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1371
1381
|
</collection-browser>`);
|
|
1372
1382
|
el.baseQuery = 'foo';
|
|
1373
1383
|
await el.updateComplete;
|
|
@@ -1383,11 +1393,11 @@ describe('Collection Browser', () => {
|
|
|
1383
1393
|
});
|
|
1384
1394
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1385
1395
|
const searchService = new MockSearchService();
|
|
1386
|
-
const el = await fixture(html `<collection-browser
|
|
1387
|
-
.searchService=${searchService}
|
|
1388
|
-
.baseQuery=${'foo'}
|
|
1389
|
-
.displayMode=${'list-detail'}
|
|
1390
|
-
>
|
|
1396
|
+
const el = await fixture(html `<collection-browser
|
|
1397
|
+
.searchService=${searchService}
|
|
1398
|
+
.baseQuery=${'foo'}
|
|
1399
|
+
.displayMode=${'list-detail'}
|
|
1400
|
+
>
|
|
1391
1401
|
</collection-browser>`);
|
|
1392
1402
|
el.isManageView = true;
|
|
1393
1403
|
await el.updateComplete;
|
|
@@ -1396,10 +1406,10 @@ describe('Collection Browser', () => {
|
|
|
1396
1406
|
it('can remove all checked tiles', async () => {
|
|
1397
1407
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1398
1408
|
const searchService = new MockSearchService();
|
|
1399
|
-
const el = await fixture(html `<collection-browser
|
|
1400
|
-
.searchService=${searchService}
|
|
1401
|
-
.baseNavigationUrl=${''}
|
|
1402
|
-
>
|
|
1409
|
+
const el = await fixture(html `<collection-browser
|
|
1410
|
+
.searchService=${searchService}
|
|
1411
|
+
.baseNavigationUrl=${''}
|
|
1412
|
+
>
|
|
1403
1413
|
</collection-browser>`);
|
|
1404
1414
|
el.baseQuery = 'foo';
|
|
1405
1415
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1435,10 +1445,10 @@ describe('Collection Browser', () => {
|
|
|
1435
1445
|
});
|
|
1436
1446
|
it('can check/uncheck all tiles', async () => {
|
|
1437
1447
|
const searchService = new MockSearchService();
|
|
1438
|
-
const el = await fixture(html `<collection-browser
|
|
1439
|
-
.searchService=${searchService}
|
|
1440
|
-
.baseNavigationUrl=${''}
|
|
1441
|
-
>
|
|
1448
|
+
const el = await fixture(html `<collection-browser
|
|
1449
|
+
.searchService=${searchService}
|
|
1450
|
+
.baseNavigationUrl=${''}
|
|
1451
|
+
>
|
|
1442
1452
|
</collection-browser>`);
|
|
1443
1453
|
el.baseQuery = 'foo';
|
|
1444
1454
|
await el.updateComplete;
|
|
@@ -1458,10 +1468,10 @@ describe('Collection Browser', () => {
|
|
|
1458
1468
|
var _a, _b;
|
|
1459
1469
|
const spy = sinon.spy();
|
|
1460
1470
|
const searchService = new MockSearchService();
|
|
1461
|
-
const el = await fixture(html `<collection-browser
|
|
1462
|
-
.searchService=${searchService}
|
|
1463
|
-
.baseNavigationUrl=${''}
|
|
1464
|
-
@manageModeChanged=${spy}
|
|
1471
|
+
const el = await fixture(html `<collection-browser
|
|
1472
|
+
.searchService=${searchService}
|
|
1473
|
+
.baseNavigationUrl=${''}
|
|
1474
|
+
@manageModeChanged=${spy}
|
|
1465
1475
|
></collection-browser>`);
|
|
1466
1476
|
el.isManageView = true;
|
|
1467
1477
|
await el.updateComplete;
|
|
@@ -1476,11 +1486,11 @@ describe('Collection Browser', () => {
|
|
|
1476
1486
|
var _a, _b, _c, _d, _e;
|
|
1477
1487
|
const spy = sinon.spy();
|
|
1478
1488
|
const searchService = new MockSearchService();
|
|
1479
|
-
const el = await fixture(html `<collection-browser
|
|
1480
|
-
.searchService=${searchService}
|
|
1481
|
-
.baseNavigationUrl=${''}
|
|
1482
|
-
@itemRemovalRequested=${spy}
|
|
1483
|
-
>
|
|
1489
|
+
const el = await fixture(html `<collection-browser
|
|
1490
|
+
.searchService=${searchService}
|
|
1491
|
+
.baseNavigationUrl=${''}
|
|
1492
|
+
@itemRemovalRequested=${spy}
|
|
1493
|
+
>
|
|
1484
1494
|
</collection-browser>`);
|
|
1485
1495
|
el.baseQuery = 'foo';
|
|
1486
1496
|
await el.updateComplete;
|
|
@@ -1510,10 +1520,10 @@ describe('Collection Browser', () => {
|
|
|
1510
1520
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1511
1521
|
var _a;
|
|
1512
1522
|
const searchService = new MockSearchService();
|
|
1513
|
-
const el = await fixture(html `<collection-browser
|
|
1514
|
-
.searchService=${searchService}
|
|
1515
|
-
.baseNavigationUrl=${''}
|
|
1516
|
-
>
|
|
1523
|
+
const el = await fixture(html `<collection-browser
|
|
1524
|
+
.searchService=${searchService}
|
|
1525
|
+
.baseNavigationUrl=${''}
|
|
1526
|
+
>
|
|
1517
1527
|
</collection-browser>`);
|
|
1518
1528
|
el.baseQuery = 'foo';
|
|
1519
1529
|
await el.updateComplete;
|
|
@@ -1530,7 +1540,7 @@ describe('Collection Browser', () => {
|
|
|
1530
1540
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1531
1541
|
var _a, _b, _c, _d;
|
|
1532
1542
|
const searchService = new MockSearchService();
|
|
1533
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1543
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1534
1544
|
</collection-browser>`);
|
|
1535
1545
|
el.baseQuery = 'foo';
|
|
1536
1546
|
await el.updateComplete;
|
|
@@ -1558,10 +1568,10 @@ describe('Collection Browser', () => {
|
|
|
1558
1568
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1559
1569
|
var _a;
|
|
1560
1570
|
const searchService = new MockSearchService();
|
|
1561
|
-
const el = await fixture(html `<collection-browser
|
|
1562
|
-
.baseNavigationUrl=${''}
|
|
1563
|
-
.searchService=${searchService}
|
|
1564
|
-
>
|
|
1571
|
+
const el = await fixture(html `<collection-browser
|
|
1572
|
+
.baseNavigationUrl=${''}
|
|
1573
|
+
.searchService=${searchService}
|
|
1574
|
+
>
|
|
1565
1575
|
</collection-browser>`);
|
|
1566
1576
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1567
1577
|
await el.updateComplete;
|
|
@@ -1573,10 +1583,10 @@ describe('Collection Browser', () => {
|
|
|
1573
1583
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1574
1584
|
var _a;
|
|
1575
1585
|
const searchService = new MockSearchService();
|
|
1576
|
-
const el = await fixture(html `<collection-browser
|
|
1577
|
-
.baseNavigationUrl=${''}
|
|
1578
|
-
.searchService=${searchService}
|
|
1579
|
-
>
|
|
1586
|
+
const el = await fixture(html `<collection-browser
|
|
1587
|
+
.baseNavigationUrl=${''}
|
|
1588
|
+
.searchService=${searchService}
|
|
1589
|
+
>
|
|
1580
1590
|
</collection-browser>`);
|
|
1581
1591
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1582
1592
|
await el.updateComplete;
|
|
@@ -1588,10 +1598,10 @@ describe('Collection Browser', () => {
|
|
|
1588
1598
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1589
1599
|
var _a, _b, _c;
|
|
1590
1600
|
const searchService = new MockSearchService();
|
|
1591
|
-
const el = await fixture(html `<collection-browser
|
|
1592
|
-
.baseNavigationUrl=${''}
|
|
1593
|
-
.searchService=${searchService}
|
|
1594
|
-
>
|
|
1601
|
+
const el = await fixture(html `<collection-browser
|
|
1602
|
+
.baseNavigationUrl=${''}
|
|
1603
|
+
.searchService=${searchService}
|
|
1604
|
+
>
|
|
1595
1605
|
</collection-browser>`);
|
|
1596
1606
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1597
1607
|
await el.updateComplete;
|
|
@@ -1607,11 +1617,11 @@ describe('Collection Browser', () => {
|
|
|
1607
1617
|
it('applies loans tab properties to sort bar', async () => {
|
|
1608
1618
|
var _a;
|
|
1609
1619
|
const searchService = new MockSearchService();
|
|
1610
|
-
const el = await fixture(html `<collection-browser
|
|
1611
|
-
.baseNavigationUrl=${''}
|
|
1612
|
-
.searchService=${searchService}
|
|
1613
|
-
.enableSortOptionsSlot=${true}
|
|
1614
|
-
>
|
|
1620
|
+
const el = await fixture(html `<collection-browser
|
|
1621
|
+
.baseNavigationUrl=${''}
|
|
1622
|
+
.searchService=${searchService}
|
|
1623
|
+
.enableSortOptionsSlot=${true}
|
|
1624
|
+
>
|
|
1615
1625
|
</collection-browser>`);
|
|
1616
1626
|
el.baseQuery = 'collection:foo';
|
|
1617
1627
|
await el.updateComplete;
|
|
@@ -1626,9 +1636,9 @@ describe('Collection Browser', () => {
|
|
|
1626
1636
|
it('can suppress presence of result count', async () => {
|
|
1627
1637
|
var _a;
|
|
1628
1638
|
const searchService = new MockSearchService();
|
|
1629
|
-
const el = await fixture(html `<collection-browser
|
|
1630
|
-
.searchService=${searchService}
|
|
1631
|
-
suppressResultCount
|
|
1639
|
+
const el = await fixture(html `<collection-browser
|
|
1640
|
+
.searchService=${searchService}
|
|
1641
|
+
suppressResultCount
|
|
1632
1642
|
></collection-browser>`);
|
|
1633
1643
|
el.baseQuery = 'collection:foo';
|
|
1634
1644
|
await el.updateComplete;
|
|
@@ -1639,9 +1649,9 @@ describe('Collection Browser', () => {
|
|
|
1639
1649
|
it('can suppress presence of result tiles', async () => {
|
|
1640
1650
|
var _a;
|
|
1641
1651
|
const searchService = new MockSearchService();
|
|
1642
|
-
const el = await fixture(html `<collection-browser
|
|
1643
|
-
.searchService=${searchService}
|
|
1644
|
-
suppressResultTiles
|
|
1652
|
+
const el = await fixture(html `<collection-browser
|
|
1653
|
+
.searchService=${searchService}
|
|
1654
|
+
suppressResultTiles
|
|
1645
1655
|
></collection-browser>`);
|
|
1646
1656
|
el.baseQuery = 'collection:foo';
|
|
1647
1657
|
await el.updateComplete;
|
|
@@ -1654,7 +1664,7 @@ describe('Collection Browser', () => {
|
|
|
1654
1664
|
asyncResponse: true,
|
|
1655
1665
|
resultsSpy,
|
|
1656
1666
|
});
|
|
1657
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1667
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1658
1668
|
</collection-browser>`);
|
|
1659
1669
|
const numberOfPages = 15;
|
|
1660
1670
|
el.baseQuery = 'jack';
|
|
@@ -1667,10 +1677,10 @@ describe('Collection Browser', () => {
|
|
|
1667
1677
|
it('renders provided results header instead of default, when showing smart results', async () => {
|
|
1668
1678
|
var _a, _b;
|
|
1669
1679
|
const searchService = new MockSearchService();
|
|
1670
|
-
const el = await fixture(html `<collection-browser
|
|
1671
|
-
showSmartResults
|
|
1672
|
-
.searchService=${searchService}
|
|
1673
|
-
.resultsHeader=${'Foo Bar'}
|
|
1680
|
+
const el = await fixture(html `<collection-browser
|
|
1681
|
+
showSmartResults
|
|
1682
|
+
.searchService=${searchService}
|
|
1683
|
+
.resultsHeader=${'Foo Bar'}
|
|
1674
1684
|
></collection-browser>`);
|
|
1675
1685
|
el.baseQuery = 'foo';
|
|
1676
1686
|
await el.updateComplete;
|