@internetarchive/collection-browser 2.20.1-alpha-webdev7822.1 → 2.21.1-alpha-webdev7886.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/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +6 -0
- 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 +4 -0
- package/dist/src/data-source/collection-browser-data-source.js +6 -0
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +376 -376
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/test/collection-browser.test.js +202 -183
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/data-source/collection-browser-data-source-interface.ts +7 -0
- package/src/data-source/collection-browser-data-source.ts +7 -0
- package/src/models.ts +870 -870
- package/src/sort-filter-bar/sort-filter-bar.ts +1283 -1283
- package/test/collection-browser.test.ts +2359 -2332
- package/test/sort-filter-bar/sort-filter-bar.test.ts +885 -885
|
@@ -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,13 +356,32 @@ 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
|
});
|
|
363
|
+
it('does not persist or restore search type from URL param if suppressed', async () => {
|
|
364
|
+
// Add a sin=TXT param to the URL
|
|
365
|
+
let url = new URL(window.location.href);
|
|
366
|
+
url.searchParams.append('sin', 'TXT');
|
|
367
|
+
window.history.replaceState({}, '', url);
|
|
368
|
+
const searchService = new MockSearchService();
|
|
369
|
+
const el = await fixture(html `<collection-browser
|
|
370
|
+
.searchService=${searchService}
|
|
371
|
+
suppressURLSinParam
|
|
372
|
+
>
|
|
373
|
+
</collection-browser>`);
|
|
374
|
+
url = new URL(window.location.href);
|
|
375
|
+
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
376
|
+
expect(url.searchParams.has('sin')).to.be.false; // Removes existing sin param
|
|
377
|
+
el.searchType = SearchType.RADIO;
|
|
378
|
+
await el.updateComplete;
|
|
379
|
+
url = new URL(window.location.href);
|
|
380
|
+
expect(url.searchParams.has('sin')).to.be.false; // Doesn't add sin param
|
|
381
|
+
});
|
|
363
382
|
it('can construct tile models with many fields present', async () => {
|
|
364
383
|
const searchService = new MockSearchService();
|
|
365
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
384
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
366
385
|
</collection-browser>`);
|
|
367
386
|
el.baseQuery = 'many-fields';
|
|
368
387
|
await el.updateComplete;
|
|
@@ -375,10 +394,10 @@ describe('Collection Browser', () => {
|
|
|
375
394
|
it('emits empty results event when search fetches no results', async () => {
|
|
376
395
|
const searchService = new MockSearchService();
|
|
377
396
|
const emptyResultsSpy = sinon.spy();
|
|
378
|
-
const el = await fixture(html `<collection-browser
|
|
379
|
-
.searchService=${searchService}
|
|
380
|
-
@emptyResults=${emptyResultsSpy}
|
|
381
|
-
>
|
|
397
|
+
const el = await fixture(html `<collection-browser
|
|
398
|
+
.searchService=${searchService}
|
|
399
|
+
@emptyResults=${emptyResultsSpy}
|
|
400
|
+
>
|
|
382
401
|
</collection-browser>`);
|
|
383
402
|
el.baseQuery = 'no-results';
|
|
384
403
|
await el.updateComplete;
|
|
@@ -388,7 +407,7 @@ describe('Collection Browser', () => {
|
|
|
388
407
|
it('applies loggedin flag to tile models if needed', async () => {
|
|
389
408
|
var _a;
|
|
390
409
|
const searchService = new MockSearchService();
|
|
391
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
410
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
392
411
|
</collection-browser>`);
|
|
393
412
|
el.baseQuery = 'loggedin';
|
|
394
413
|
await el.updateComplete;
|
|
@@ -402,7 +421,7 @@ describe('Collection Browser', () => {
|
|
|
402
421
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
403
422
|
var _a;
|
|
404
423
|
const searchService = new MockSearchService();
|
|
405
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
424
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
406
425
|
</collection-browser>`);
|
|
407
426
|
el.baseQuery = 'no-preview';
|
|
408
427
|
await el.updateComplete;
|
|
@@ -416,7 +435,7 @@ describe('Collection Browser', () => {
|
|
|
416
435
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
417
436
|
var _a, _b;
|
|
418
437
|
const searchService = new MockSearchService();
|
|
419
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
438
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
420
439
|
</collection-browser>`);
|
|
421
440
|
el.baseQuery = 'loggedin-no-preview';
|
|
422
441
|
await el.updateComplete;
|
|
@@ -431,7 +450,7 @@ describe('Collection Browser', () => {
|
|
|
431
450
|
it('joins full description array into a single string with line breaks', async () => {
|
|
432
451
|
var _a;
|
|
433
452
|
const searchService = new MockSearchService();
|
|
434
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
453
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
435
454
|
</collection-browser>`);
|
|
436
455
|
// This query receives an array description like ['line1', 'line2']
|
|
437
456
|
el.baseQuery = 'multi-line-description';
|
|
@@ -447,9 +466,9 @@ describe('Collection Browser', () => {
|
|
|
447
466
|
it('can change search type', async () => {
|
|
448
467
|
var _a;
|
|
449
468
|
const searchService = new MockSearchService();
|
|
450
|
-
const el = await fixture(html `<collection-browser
|
|
451
|
-
.searchService=${searchService}
|
|
452
|
-
.searchType=${SearchType.METADATA}
|
|
469
|
+
const el = await fixture(html `<collection-browser
|
|
470
|
+
.searchService=${searchService}
|
|
471
|
+
.searchType=${SearchType.METADATA}
|
|
453
472
|
></collection-browser>`);
|
|
454
473
|
el.baseQuery = 'collection:foo';
|
|
455
474
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -461,8 +480,8 @@ describe('Collection Browser', () => {
|
|
|
461
480
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
462
481
|
var _a;
|
|
463
482
|
const searchService = new MockSearchService();
|
|
464
|
-
const el = await fixture(html `<collection-browser
|
|
465
|
-
.searchService=${searchService}
|
|
483
|
+
const el = await fixture(html `<collection-browser
|
|
484
|
+
.searchService=${searchService}
|
|
466
485
|
></collection-browser>`);
|
|
467
486
|
el.baseQuery = ' collection:foo ';
|
|
468
487
|
await el.updateComplete;
|
|
@@ -472,8 +491,8 @@ describe('Collection Browser', () => {
|
|
|
472
491
|
it('shows error message when error response received', async () => {
|
|
473
492
|
var _a, _b;
|
|
474
493
|
const searchService = new MockSearchService();
|
|
475
|
-
const el = await fixture(html `<collection-browser
|
|
476
|
-
.searchService=${searchService}
|
|
494
|
+
const el = await fixture(html `<collection-browser
|
|
495
|
+
.searchService=${searchService}
|
|
477
496
|
></collection-browser>`);
|
|
478
497
|
el.baseQuery = 'error';
|
|
479
498
|
await el.updateComplete;
|
|
@@ -486,8 +505,8 @@ describe('Collection Browser', () => {
|
|
|
486
505
|
it('shows error message when error response received for a collection', async () => {
|
|
487
506
|
var _a, _b;
|
|
488
507
|
const searchService = new MockSearchService();
|
|
489
|
-
const el = await fixture(html `<collection-browser
|
|
490
|
-
.searchService=${searchService}
|
|
508
|
+
const el = await fixture(html `<collection-browser
|
|
509
|
+
.searchService=${searchService}
|
|
491
510
|
></collection-browser>`);
|
|
492
511
|
el.withinCollection = 'error';
|
|
493
512
|
await el.updateComplete;
|
|
@@ -502,8 +521,8 @@ describe('Collection Browser', () => {
|
|
|
502
521
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
503
522
|
window.Sentry = { captureMessage: sentrySpy };
|
|
504
523
|
const searchService = new MockSearchService();
|
|
505
|
-
const el = await fixture(html `<collection-browser
|
|
506
|
-
.searchService=${searchService}
|
|
524
|
+
const el = await fixture(html `<collection-browser
|
|
525
|
+
.searchService=${searchService}
|
|
507
526
|
></collection-browser>`);
|
|
508
527
|
el.baseQuery = 'malformed';
|
|
509
528
|
await el.updateComplete;
|
|
@@ -512,7 +531,7 @@ describe('Collection Browser', () => {
|
|
|
512
531
|
});
|
|
513
532
|
it('adds collection names to cache when present on response', async () => {
|
|
514
533
|
const searchService = new MockSearchService();
|
|
515
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
534
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
516
535
|
</collection-browser>`);
|
|
517
536
|
el.baseQuery = 'collection-titles';
|
|
518
537
|
await el.updateComplete;
|
|
@@ -524,7 +543,7 @@ describe('Collection Browser', () => {
|
|
|
524
543
|
});
|
|
525
544
|
it('adds tv channel aliases to cache when present on response', async () => {
|
|
526
545
|
const searchService = new MockSearchService();
|
|
527
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
546
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
528
547
|
</collection-browser>`);
|
|
529
548
|
el.baseQuery = 'channel-aliases';
|
|
530
549
|
await el.updateComplete;
|
|
@@ -538,7 +557,7 @@ describe('Collection Browser', () => {
|
|
|
538
557
|
asyncResponse: true,
|
|
539
558
|
resultsSpy,
|
|
540
559
|
});
|
|
541
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
560
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
542
561
|
</collection-browser>`);
|
|
543
562
|
el.baseQuery = 'with-sort';
|
|
544
563
|
el.selectedSort = SortField.date;
|
|
@@ -555,7 +574,7 @@ describe('Collection Browser', () => {
|
|
|
555
574
|
asyncResponse: true,
|
|
556
575
|
resultsSpy,
|
|
557
576
|
});
|
|
558
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
577
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
559
578
|
</collection-browser>`);
|
|
560
579
|
el.baseQuery = 'with-sort';
|
|
561
580
|
el.selectedSort = SortField.date;
|
|
@@ -577,7 +596,7 @@ describe('Collection Browser', () => {
|
|
|
577
596
|
asyncResponse: true,
|
|
578
597
|
resultsSpy,
|
|
579
598
|
});
|
|
580
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
599
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
581
600
|
</collection-browser>`);
|
|
582
601
|
el.baseQuery = 'single-result';
|
|
583
602
|
await el.updateComplete;
|
|
@@ -598,7 +617,7 @@ describe('Collection Browser', () => {
|
|
|
598
617
|
asyncResponse: true,
|
|
599
618
|
resultsSpy,
|
|
600
619
|
});
|
|
601
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
620
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
602
621
|
</collection-browser>`);
|
|
603
622
|
el.baseQuery = 'with-sort';
|
|
604
623
|
el.selectedSort = SortField.date;
|
|
@@ -617,7 +636,7 @@ describe('Collection Browser', () => {
|
|
|
617
636
|
it('sets sort properties when user changes sort', async () => {
|
|
618
637
|
var _a, _b, _c, _d, _e, _f;
|
|
619
638
|
const searchService = new MockSearchService();
|
|
620
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
639
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
621
640
|
</collection-browser>`);
|
|
622
641
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
623
642
|
el.baseQuery = 'foo';
|
|
@@ -640,7 +659,7 @@ describe('Collection Browser', () => {
|
|
|
640
659
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
641
660
|
var _a, _b, _c, _d;
|
|
642
661
|
const searchService = new MockSearchService();
|
|
643
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
662
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
644
663
|
</collection-browser>`);
|
|
645
664
|
el.baseQuery = 'first-title';
|
|
646
665
|
el.selectedSort = 'title';
|
|
@@ -654,7 +673,7 @@ describe('Collection Browser', () => {
|
|
|
654
673
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
655
674
|
var _a, _b, _c, _d;
|
|
656
675
|
const searchService = new MockSearchService();
|
|
657
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
676
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
658
677
|
</collection-browser>`);
|
|
659
678
|
el.baseQuery = 'first-creator';
|
|
660
679
|
el.selectedSort = 'creator';
|
|
@@ -677,7 +696,7 @@ describe('Collection Browser', () => {
|
|
|
677
696
|
subject: {},
|
|
678
697
|
year: {},
|
|
679
698
|
};
|
|
680
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
699
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
681
700
|
</collection-browser>`);
|
|
682
701
|
el.baseQuery = 'first-creator';
|
|
683
702
|
el.selectedSort = 'creator';
|
|
@@ -705,7 +724,7 @@ describe('Collection Browser', () => {
|
|
|
705
724
|
it('applies correct search filter when TV clip filter set to commercials', async () => {
|
|
706
725
|
var _a, _b, _c;
|
|
707
726
|
const searchService = new MockSearchService();
|
|
708
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
727
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
709
728
|
</collection-browser>`);
|
|
710
729
|
el.baseQuery = 'tv-fields';
|
|
711
730
|
el.searchType = SearchType.TV;
|
|
@@ -717,7 +736,7 @@ describe('Collection Browser', () => {
|
|
|
717
736
|
it('applies correct search filter when TV clip filter set to factchecks', async () => {
|
|
718
737
|
var _a, _b, _c;
|
|
719
738
|
const searchService = new MockSearchService();
|
|
720
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
739
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
721
740
|
</collection-browser>`);
|
|
722
741
|
el.baseQuery = 'tv-fields';
|
|
723
742
|
el.searchType = SearchType.TV;
|
|
@@ -729,7 +748,7 @@ describe('Collection Browser', () => {
|
|
|
729
748
|
it('applies correct search filter when TV clip filter set to quotes', async () => {
|
|
730
749
|
var _a, _b, _c;
|
|
731
750
|
const searchService = new MockSearchService();
|
|
732
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
751
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
733
752
|
</collection-browser>`);
|
|
734
753
|
el.baseQuery = 'tv-fields';
|
|
735
754
|
el.searchType = SearchType.TV;
|
|
@@ -741,7 +760,7 @@ describe('Collection Browser', () => {
|
|
|
741
760
|
it('resets letter filters when query changes', async () => {
|
|
742
761
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
743
762
|
const searchService = new MockSearchService();
|
|
744
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
763
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
745
764
|
</collection-browser>`);
|
|
746
765
|
el.baseQuery = 'first-creator';
|
|
747
766
|
el.selectedSort = 'creator';
|
|
@@ -762,11 +781,11 @@ describe('Collection Browser', () => {
|
|
|
762
781
|
var _a, _b, _c;
|
|
763
782
|
const searchService = new MockSearchService();
|
|
764
783
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
765
|
-
const el = await fixture(html `<collection-browser
|
|
766
|
-
.searchService=${searchService}
|
|
767
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
768
|
-
.suppressPlaceholders=${true}
|
|
769
|
-
>
|
|
784
|
+
const el = await fixture(html `<collection-browser
|
|
785
|
+
.searchService=${searchService}
|
|
786
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
787
|
+
.suppressPlaceholders=${true}
|
|
788
|
+
>
|
|
770
789
|
</collection-browser>`);
|
|
771
790
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
772
791
|
el.showHistogramDatePicker = true;
|
|
@@ -795,10 +814,10 @@ describe('Collection Browser', () => {
|
|
|
795
814
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
796
815
|
var _a, _b, _c;
|
|
797
816
|
const searchService = new MockSearchService();
|
|
798
|
-
const el = await fixture(html `<collection-browser
|
|
799
|
-
.searchService=${searchService}
|
|
800
|
-
.suppressPlaceholders=${true}
|
|
801
|
-
>
|
|
817
|
+
const el = await fixture(html `<collection-browser
|
|
818
|
+
.searchService=${searchService}
|
|
819
|
+
.suppressPlaceholders=${true}
|
|
820
|
+
>
|
|
802
821
|
</collection-browser>`);
|
|
803
822
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
804
823
|
el.searchType = SearchType.TV;
|
|
@@ -829,9 +848,9 @@ describe('Collection Browser', () => {
|
|
|
829
848
|
var _a, _b, _c, _d;
|
|
830
849
|
const spy = sinon.spy();
|
|
831
850
|
const searchService = new MockSearchService();
|
|
832
|
-
const el = await fixture(html `<collection-browser
|
|
833
|
-
.searchService=${searchService}
|
|
834
|
-
@searchResultsLoadingChanged=${spy}
|
|
851
|
+
const el = await fixture(html `<collection-browser
|
|
852
|
+
.searchService=${searchService}
|
|
853
|
+
@searchResultsLoadingChanged=${spy}
|
|
835
854
|
></collection-browser>`);
|
|
836
855
|
spy.resetHistory();
|
|
837
856
|
el.baseQuery = 'collection:foo';
|
|
@@ -845,9 +864,9 @@ describe('Collection Browser', () => {
|
|
|
845
864
|
it('collapses extra set of quotes around href field', async () => {
|
|
846
865
|
var _a;
|
|
847
866
|
const searchService = new MockSearchService();
|
|
848
|
-
const el = await fixture(html `<collection-browser
|
|
849
|
-
.searchService=${searchService}
|
|
850
|
-
.baseNavigationUrl=${''}
|
|
867
|
+
const el = await fixture(html `<collection-browser
|
|
868
|
+
.searchService=${searchService}
|
|
869
|
+
.baseNavigationUrl=${''}
|
|
851
870
|
></collection-browser>`);
|
|
852
871
|
el.baseQuery = 'extra-quoted-href';
|
|
853
872
|
await el.updateComplete;
|
|
@@ -860,9 +879,9 @@ describe('Collection Browser', () => {
|
|
|
860
879
|
it('sets default sort from collection metadata', async () => {
|
|
861
880
|
var _a;
|
|
862
881
|
const searchService = new MockSearchService();
|
|
863
|
-
const el = await fixture(html `<collection-browser
|
|
864
|
-
.searchService=${searchService}
|
|
865
|
-
.baseNavigationUrl=${''}
|
|
882
|
+
const el = await fixture(html `<collection-browser
|
|
883
|
+
.searchService=${searchService}
|
|
884
|
+
.baseNavigationUrl=${''}
|
|
866
885
|
></collection-browser>`);
|
|
867
886
|
el.withinCollection = 'default-sort';
|
|
868
887
|
await el.updateComplete;
|
|
@@ -879,9 +898,9 @@ describe('Collection Browser', () => {
|
|
|
879
898
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
880
899
|
var _a;
|
|
881
900
|
const searchService = new MockSearchService();
|
|
882
|
-
const el = await fixture(html `<collection-browser
|
|
883
|
-
.searchService=${searchService}
|
|
884
|
-
.baseNavigationUrl=${''}
|
|
901
|
+
const el = await fixture(html `<collection-browser
|
|
902
|
+
.searchService=${searchService}
|
|
903
|
+
.baseNavigationUrl=${''}
|
|
885
904
|
></collection-browser>`);
|
|
886
905
|
el.withinCollection = 'default-sort-concise';
|
|
887
906
|
await el.updateComplete;
|
|
@@ -896,8 +915,8 @@ describe('Collection Browser', () => {
|
|
|
896
915
|
expect(sortBar.sortDirection).to.be.null;
|
|
897
916
|
});
|
|
898
917
|
it('falls back to weekly views default sorting on profiles when tab not set', async () => {
|
|
899
|
-
const el = await fixture(html `<collection-browser
|
|
900
|
-
.withinProfile=${'@foobar'}
|
|
918
|
+
const el = await fixture(html `<collection-browser
|
|
919
|
+
.withinProfile=${'@foobar'}
|
|
901
920
|
></collection-browser>`);
|
|
902
921
|
el.applyDefaultProfileSort();
|
|
903
922
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -908,9 +927,9 @@ describe('Collection Browser', () => {
|
|
|
908
927
|
it('uses relevance sort as default when a query is set', async () => {
|
|
909
928
|
var _a;
|
|
910
929
|
const searchService = new MockSearchService();
|
|
911
|
-
const el = await fixture(html `<collection-browser
|
|
912
|
-
.searchService=${searchService}
|
|
913
|
-
.baseNavigationUrl=${''}
|
|
930
|
+
const el = await fixture(html `<collection-browser
|
|
931
|
+
.searchService=${searchService}
|
|
932
|
+
.baseNavigationUrl=${''}
|
|
914
933
|
></collection-browser>`);
|
|
915
934
|
el.withinCollection = 'default-sort';
|
|
916
935
|
el.baseQuery = 'default-sort';
|
|
@@ -928,9 +947,9 @@ describe('Collection Browser', () => {
|
|
|
928
947
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
929
948
|
var _a;
|
|
930
949
|
const searchService = new MockSearchService();
|
|
931
|
-
const el = await fixture(html `<collection-browser
|
|
932
|
-
.searchService=${searchService}
|
|
933
|
-
.baseNavigationUrl=${''}
|
|
950
|
+
const el = await fixture(html `<collection-browser
|
|
951
|
+
.searchService=${searchService}
|
|
952
|
+
.baseNavigationUrl=${''}
|
|
934
953
|
></collection-browser>`);
|
|
935
954
|
el.withinCollection = 'fav-sort';
|
|
936
955
|
await el.updateComplete;
|
|
@@ -947,7 +966,7 @@ describe('Collection Browser', () => {
|
|
|
947
966
|
it('scrolls to page', async () => {
|
|
948
967
|
var _a;
|
|
949
968
|
const searchService = new MockSearchService();
|
|
950
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
969
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
951
970
|
</collection-browser>`);
|
|
952
971
|
// Infinite scroller won't exist unless there's a base query.
|
|
953
972
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -969,9 +988,9 @@ describe('Collection Browser', () => {
|
|
|
969
988
|
it('shows mobile facets in mobile view', async () => {
|
|
970
989
|
var _a, _b;
|
|
971
990
|
const searchService = new MockSearchService();
|
|
972
|
-
const el = await fixture(html `<collection-browser
|
|
973
|
-
.searchService=${searchService}
|
|
974
|
-
.mobileBreakpoint=${9999}
|
|
991
|
+
const el = await fixture(html `<collection-browser
|
|
992
|
+
.searchService=${searchService}
|
|
993
|
+
.mobileBreakpoint=${9999}
|
|
975
994
|
></collection-browser>`);
|
|
976
995
|
el.baseQuery = 'collection:foo';
|
|
977
996
|
await el.updateComplete;
|
|
@@ -991,11 +1010,11 @@ describe('Collection Browser', () => {
|
|
|
991
1010
|
var _a, _b;
|
|
992
1011
|
const searchService = new MockSearchService();
|
|
993
1012
|
const analyticsHandler = new MockAnalyticsHandler();
|
|
994
|
-
const el = await fixture(html `<collection-browser
|
|
995
|
-
.searchService=${searchService}
|
|
996
|
-
.analyticsHandler=${analyticsHandler}
|
|
997
|
-
.searchContext=${'foobar-context'}
|
|
998
|
-
.mobileBreakpoint=${9999}
|
|
1013
|
+
const el = await fixture(html `<collection-browser
|
|
1014
|
+
.searchService=${searchService}
|
|
1015
|
+
.analyticsHandler=${analyticsHandler}
|
|
1016
|
+
.searchContext=${'foobar-context'}
|
|
1017
|
+
.mobileBreakpoint=${9999}
|
|
999
1018
|
></collection-browser>`);
|
|
1000
1019
|
el.baseQuery = 'collection:foo';
|
|
1001
1020
|
await el.updateComplete;
|
|
@@ -1035,9 +1054,9 @@ describe('Collection Browser', () => {
|
|
|
1035
1054
|
});
|
|
1036
1055
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1037
1056
|
const searchService = new MockSearchService();
|
|
1038
|
-
const el = await fixture(html `<collection-browser
|
|
1039
|
-
.searchService=${searchService}
|
|
1040
|
-
.withinCollection=${'fake'}
|
|
1057
|
+
const el = await fixture(html `<collection-browser
|
|
1058
|
+
.searchService=${searchService}
|
|
1059
|
+
.withinCollection=${'fake'}
|
|
1041
1060
|
></collection-browser>`);
|
|
1042
1061
|
el.baseQuery = 'parent-collections';
|
|
1043
1062
|
await el.updateComplete;
|
|
@@ -1047,9 +1066,9 @@ describe('Collection Browser', () => {
|
|
|
1047
1066
|
});
|
|
1048
1067
|
it('recognizes TV collections', async () => {
|
|
1049
1068
|
const searchService = new MockSearchService();
|
|
1050
|
-
const el = await fixture(html `<collection-browser
|
|
1051
|
-
.searchService=${searchService}
|
|
1052
|
-
.withinCollection=${'TV-FOO'}
|
|
1069
|
+
const el = await fixture(html `<collection-browser
|
|
1070
|
+
.searchService=${searchService}
|
|
1071
|
+
.withinCollection=${'TV-FOO'}
|
|
1053
1072
|
></collection-browser>`);
|
|
1054
1073
|
el.baseQuery = 'tv-collection';
|
|
1055
1074
|
await el.updateComplete;
|
|
@@ -1061,9 +1080,9 @@ describe('Collection Browser', () => {
|
|
|
1061
1080
|
var _a;
|
|
1062
1081
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1063
1082
|
const searchService = new MockSearchService();
|
|
1064
|
-
const el = await fixture(html `<collection-browser
|
|
1065
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1066
|
-
.searchService=${searchService}
|
|
1083
|
+
const el = await fixture(html `<collection-browser
|
|
1084
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1085
|
+
.searchService=${searchService}
|
|
1067
1086
|
></collection-browser>`);
|
|
1068
1087
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1069
1088
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1109,7 +1128,7 @@ describe('Collection Browser', () => {
|
|
|
1109
1128
|
it('query the search service for single result', async () => {
|
|
1110
1129
|
var _a, _b;
|
|
1111
1130
|
const searchService = new MockSearchService();
|
|
1112
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1131
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1113
1132
|
</collection-browser>`);
|
|
1114
1133
|
el.baseQuery = 'single-result';
|
|
1115
1134
|
await el.updateComplete;
|
|
@@ -1138,7 +1157,7 @@ describe('Collection Browser', () => {
|
|
|
1138
1157
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1139
1158
|
window.history.replaceState({}, '', url);
|
|
1140
1159
|
const searchService = new MockSearchService();
|
|
1141
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1160
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1142
1161
|
</collection-browser>`);
|
|
1143
1162
|
await el.initialSearchComplete;
|
|
1144
1163
|
await el.updateComplete;
|
|
@@ -1164,10 +1183,10 @@ describe('Collection Browser', () => {
|
|
|
1164
1183
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1165
1184
|
window.history.replaceState({}, '', url);
|
|
1166
1185
|
const searchService = new MockSearchService();
|
|
1167
|
-
const el = await fixture(html `<collection-browser
|
|
1168
|
-
.searchService=${searchService}
|
|
1169
|
-
.withinCollection=${'foobar'}
|
|
1170
|
-
>
|
|
1186
|
+
const el = await fixture(html `<collection-browser
|
|
1187
|
+
.searchService=${searchService}
|
|
1188
|
+
.withinCollection=${'foobar'}
|
|
1189
|
+
>
|
|
1171
1190
|
</collection-browser>`);
|
|
1172
1191
|
await el.initialSearchComplete;
|
|
1173
1192
|
await el.updateComplete;
|
|
@@ -1192,11 +1211,11 @@ describe('Collection Browser', () => {
|
|
|
1192
1211
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1193
1212
|
window.history.replaceState({}, '', url);
|
|
1194
1213
|
const searchService = new MockSearchService();
|
|
1195
|
-
const el = await fixture(html `<collection-browser
|
|
1196
|
-
.searchService=${searchService}
|
|
1197
|
-
.withinProfile=${'@foobar'}
|
|
1198
|
-
.profileElement=${'uploads'}
|
|
1199
|
-
>
|
|
1214
|
+
const el = await fixture(html `<collection-browser
|
|
1215
|
+
.searchService=${searchService}
|
|
1216
|
+
.withinProfile=${'@foobar'}
|
|
1217
|
+
.profileElement=${'uploads'}
|
|
1218
|
+
>
|
|
1200
1219
|
</collection-browser>`);
|
|
1201
1220
|
await el.initialSearchComplete;
|
|
1202
1221
|
await el.updateComplete;
|
|
@@ -1223,7 +1242,7 @@ describe('Collection Browser', () => {
|
|
|
1223
1242
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1224
1243
|
window.history.replaceState({}, '', url);
|
|
1225
1244
|
const searchService = new MockSearchService();
|
|
1226
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1245
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1227
1246
|
</collection-browser>`);
|
|
1228
1247
|
await el.initialSearchComplete;
|
|
1229
1248
|
await el.updateComplete;
|
|
@@ -1251,10 +1270,10 @@ describe('Collection Browser', () => {
|
|
|
1251
1270
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1252
1271
|
window.history.replaceState({}, '', url);
|
|
1253
1272
|
const searchService = new MockSearchService();
|
|
1254
|
-
const el = await fixture(html `<collection-browser
|
|
1255
|
-
.searchService=${searchService}
|
|
1256
|
-
.withinCollection=${'foobar'}
|
|
1257
|
-
>
|
|
1273
|
+
const el = await fixture(html `<collection-browser
|
|
1274
|
+
.searchService=${searchService}
|
|
1275
|
+
.withinCollection=${'foobar'}
|
|
1276
|
+
>
|
|
1258
1277
|
</collection-browser>`);
|
|
1259
1278
|
el.baseQuery = 'bar';
|
|
1260
1279
|
await el.updateComplete;
|
|
@@ -1281,10 +1300,10 @@ describe('Collection Browser', () => {
|
|
|
1281
1300
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1282
1301
|
window.history.replaceState({}, '', url);
|
|
1283
1302
|
const searchService = new MockSearchService();
|
|
1284
|
-
const el = await fixture(html `<collection-browser
|
|
1285
|
-
.searchService=${searchService}
|
|
1286
|
-
.withinCollection=${'foobar'}
|
|
1287
|
-
>
|
|
1303
|
+
const el = await fixture(html `<collection-browser
|
|
1304
|
+
.searchService=${searchService}
|
|
1305
|
+
.withinCollection=${'foobar'}
|
|
1306
|
+
>
|
|
1288
1307
|
</collection-browser>`);
|
|
1289
1308
|
el.withinCollection = 'bar';
|
|
1290
1309
|
await el.updateComplete;
|
|
@@ -1301,11 +1320,11 @@ describe('Collection Browser', () => {
|
|
|
1301
1320
|
it('correctly retrieves web archive hits', async () => {
|
|
1302
1321
|
var _a, _b, _c;
|
|
1303
1322
|
const searchService = new MockSearchService();
|
|
1304
|
-
const el = await fixture(html `<collection-browser
|
|
1305
|
-
.searchService=${searchService}
|
|
1306
|
-
.withinProfile=${'@foo'}
|
|
1307
|
-
.profileElement=${'web_archives'}
|
|
1308
|
-
>
|
|
1323
|
+
const el = await fixture(html `<collection-browser
|
|
1324
|
+
.searchService=${searchService}
|
|
1325
|
+
.withinProfile=${'@foo'}
|
|
1326
|
+
.profileElement=${'web_archives'}
|
|
1327
|
+
>
|
|
1309
1328
|
</collection-browser>`);
|
|
1310
1329
|
el.baseQuery = 'web-archive';
|
|
1311
1330
|
await el.updateComplete;
|
|
@@ -1319,10 +1338,10 @@ describe('Collection Browser', () => {
|
|
|
1319
1338
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1320
1339
|
var _a;
|
|
1321
1340
|
const searchService = new MockSearchService();
|
|
1322
|
-
const el = await fixture(html `<collection-browser
|
|
1323
|
-
.searchService=${searchService}
|
|
1324
|
-
facetLoadStrategy=${'opt-in'}
|
|
1325
|
-
>
|
|
1341
|
+
const el = await fixture(html `<collection-browser
|
|
1342
|
+
.searchService=${searchService}
|
|
1343
|
+
facetLoadStrategy=${'opt-in'}
|
|
1344
|
+
>
|
|
1326
1345
|
</collection-browser>`);
|
|
1327
1346
|
el.baseQuery = 'foo';
|
|
1328
1347
|
await el.updateComplete;
|
|
@@ -1333,10 +1352,10 @@ describe('Collection Browser', () => {
|
|
|
1333
1352
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1334
1353
|
var _a, _b;
|
|
1335
1354
|
const searchService = new MockSearchService();
|
|
1336
|
-
const el = await fixture(html `<collection-browser
|
|
1337
|
-
.searchService=${searchService}
|
|
1338
|
-
facetLoadStrategy=${'off'}
|
|
1339
|
-
>
|
|
1355
|
+
const el = await fixture(html `<collection-browser
|
|
1356
|
+
.searchService=${searchService}
|
|
1357
|
+
facetLoadStrategy=${'off'}
|
|
1358
|
+
>
|
|
1340
1359
|
</collection-browser>`);
|
|
1341
1360
|
el.baseQuery = 'foo';
|
|
1342
1361
|
await el.updateComplete;
|
|
@@ -1348,7 +1367,7 @@ describe('Collection Browser', () => {
|
|
|
1348
1367
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1349
1368
|
var _a, _b, _c, _d;
|
|
1350
1369
|
const searchService = new MockSearchService();
|
|
1351
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1370
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1352
1371
|
</collection-browser>`);
|
|
1353
1372
|
el.baseQuery = 'foo';
|
|
1354
1373
|
await el.updateComplete;
|
|
@@ -1364,11 +1383,11 @@ describe('Collection Browser', () => {
|
|
|
1364
1383
|
});
|
|
1365
1384
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1366
1385
|
const searchService = new MockSearchService();
|
|
1367
|
-
const el = await fixture(html `<collection-browser
|
|
1368
|
-
.searchService=${searchService}
|
|
1369
|
-
.baseQuery=${'foo'}
|
|
1370
|
-
.displayMode=${'list-detail'}
|
|
1371
|
-
>
|
|
1386
|
+
const el = await fixture(html `<collection-browser
|
|
1387
|
+
.searchService=${searchService}
|
|
1388
|
+
.baseQuery=${'foo'}
|
|
1389
|
+
.displayMode=${'list-detail'}
|
|
1390
|
+
>
|
|
1372
1391
|
</collection-browser>`);
|
|
1373
1392
|
el.isManageView = true;
|
|
1374
1393
|
await el.updateComplete;
|
|
@@ -1377,10 +1396,10 @@ describe('Collection Browser', () => {
|
|
|
1377
1396
|
it('can remove all checked tiles', async () => {
|
|
1378
1397
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1379
1398
|
const searchService = new MockSearchService();
|
|
1380
|
-
const el = await fixture(html `<collection-browser
|
|
1381
|
-
.searchService=${searchService}
|
|
1382
|
-
.baseNavigationUrl=${''}
|
|
1383
|
-
>
|
|
1399
|
+
const el = await fixture(html `<collection-browser
|
|
1400
|
+
.searchService=${searchService}
|
|
1401
|
+
.baseNavigationUrl=${''}
|
|
1402
|
+
>
|
|
1384
1403
|
</collection-browser>`);
|
|
1385
1404
|
el.baseQuery = 'foo';
|
|
1386
1405
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1416,10 +1435,10 @@ describe('Collection Browser', () => {
|
|
|
1416
1435
|
});
|
|
1417
1436
|
it('can check/uncheck all tiles', async () => {
|
|
1418
1437
|
const searchService = new MockSearchService();
|
|
1419
|
-
const el = await fixture(html `<collection-browser
|
|
1420
|
-
.searchService=${searchService}
|
|
1421
|
-
.baseNavigationUrl=${''}
|
|
1422
|
-
>
|
|
1438
|
+
const el = await fixture(html `<collection-browser
|
|
1439
|
+
.searchService=${searchService}
|
|
1440
|
+
.baseNavigationUrl=${''}
|
|
1441
|
+
>
|
|
1423
1442
|
</collection-browser>`);
|
|
1424
1443
|
el.baseQuery = 'foo';
|
|
1425
1444
|
await el.updateComplete;
|
|
@@ -1439,10 +1458,10 @@ describe('Collection Browser', () => {
|
|
|
1439
1458
|
var _a, _b;
|
|
1440
1459
|
const spy = sinon.spy();
|
|
1441
1460
|
const searchService = new MockSearchService();
|
|
1442
|
-
const el = await fixture(html `<collection-browser
|
|
1443
|
-
.searchService=${searchService}
|
|
1444
|
-
.baseNavigationUrl=${''}
|
|
1445
|
-
@manageModeChanged=${spy}
|
|
1461
|
+
const el = await fixture(html `<collection-browser
|
|
1462
|
+
.searchService=${searchService}
|
|
1463
|
+
.baseNavigationUrl=${''}
|
|
1464
|
+
@manageModeChanged=${spy}
|
|
1446
1465
|
></collection-browser>`);
|
|
1447
1466
|
el.isManageView = true;
|
|
1448
1467
|
await el.updateComplete;
|
|
@@ -1457,11 +1476,11 @@ describe('Collection Browser', () => {
|
|
|
1457
1476
|
var _a, _b, _c, _d, _e;
|
|
1458
1477
|
const spy = sinon.spy();
|
|
1459
1478
|
const searchService = new MockSearchService();
|
|
1460
|
-
const el = await fixture(html `<collection-browser
|
|
1461
|
-
.searchService=${searchService}
|
|
1462
|
-
.baseNavigationUrl=${''}
|
|
1463
|
-
@itemRemovalRequested=${spy}
|
|
1464
|
-
>
|
|
1479
|
+
const el = await fixture(html `<collection-browser
|
|
1480
|
+
.searchService=${searchService}
|
|
1481
|
+
.baseNavigationUrl=${''}
|
|
1482
|
+
@itemRemovalRequested=${spy}
|
|
1483
|
+
>
|
|
1465
1484
|
</collection-browser>`);
|
|
1466
1485
|
el.baseQuery = 'foo';
|
|
1467
1486
|
await el.updateComplete;
|
|
@@ -1491,10 +1510,10 @@ describe('Collection Browser', () => {
|
|
|
1491
1510
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1492
1511
|
var _a;
|
|
1493
1512
|
const searchService = new MockSearchService();
|
|
1494
|
-
const el = await fixture(html `<collection-browser
|
|
1495
|
-
.searchService=${searchService}
|
|
1496
|
-
.baseNavigationUrl=${''}
|
|
1497
|
-
>
|
|
1513
|
+
const el = await fixture(html `<collection-browser
|
|
1514
|
+
.searchService=${searchService}
|
|
1515
|
+
.baseNavigationUrl=${''}
|
|
1516
|
+
>
|
|
1498
1517
|
</collection-browser>`);
|
|
1499
1518
|
el.baseQuery = 'foo';
|
|
1500
1519
|
await el.updateComplete;
|
|
@@ -1511,7 +1530,7 @@ describe('Collection Browser', () => {
|
|
|
1511
1530
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1512
1531
|
var _a, _b, _c, _d;
|
|
1513
1532
|
const searchService = new MockSearchService();
|
|
1514
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1533
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1515
1534
|
</collection-browser>`);
|
|
1516
1535
|
el.baseQuery = 'foo';
|
|
1517
1536
|
await el.updateComplete;
|
|
@@ -1539,10 +1558,10 @@ describe('Collection Browser', () => {
|
|
|
1539
1558
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1540
1559
|
var _a;
|
|
1541
1560
|
const searchService = new MockSearchService();
|
|
1542
|
-
const el = await fixture(html `<collection-browser
|
|
1543
|
-
.baseNavigationUrl=${''}
|
|
1544
|
-
.searchService=${searchService}
|
|
1545
|
-
>
|
|
1561
|
+
const el = await fixture(html `<collection-browser
|
|
1562
|
+
.baseNavigationUrl=${''}
|
|
1563
|
+
.searchService=${searchService}
|
|
1564
|
+
>
|
|
1546
1565
|
</collection-browser>`);
|
|
1547
1566
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1548
1567
|
await el.updateComplete;
|
|
@@ -1554,10 +1573,10 @@ describe('Collection Browser', () => {
|
|
|
1554
1573
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1555
1574
|
var _a;
|
|
1556
1575
|
const searchService = new MockSearchService();
|
|
1557
|
-
const el = await fixture(html `<collection-browser
|
|
1558
|
-
.baseNavigationUrl=${''}
|
|
1559
|
-
.searchService=${searchService}
|
|
1560
|
-
>
|
|
1576
|
+
const el = await fixture(html `<collection-browser
|
|
1577
|
+
.baseNavigationUrl=${''}
|
|
1578
|
+
.searchService=${searchService}
|
|
1579
|
+
>
|
|
1561
1580
|
</collection-browser>`);
|
|
1562
1581
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1563
1582
|
await el.updateComplete;
|
|
@@ -1569,10 +1588,10 @@ describe('Collection Browser', () => {
|
|
|
1569
1588
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1570
1589
|
var _a, _b, _c;
|
|
1571
1590
|
const searchService = new MockSearchService();
|
|
1572
|
-
const el = await fixture(html `<collection-browser
|
|
1573
|
-
.baseNavigationUrl=${''}
|
|
1574
|
-
.searchService=${searchService}
|
|
1575
|
-
>
|
|
1591
|
+
const el = await fixture(html `<collection-browser
|
|
1592
|
+
.baseNavigationUrl=${''}
|
|
1593
|
+
.searchService=${searchService}
|
|
1594
|
+
>
|
|
1576
1595
|
</collection-browser>`);
|
|
1577
1596
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1578
1597
|
await el.updateComplete;
|
|
@@ -1588,11 +1607,11 @@ describe('Collection Browser', () => {
|
|
|
1588
1607
|
it('applies loans tab properties to sort bar', async () => {
|
|
1589
1608
|
var _a;
|
|
1590
1609
|
const searchService = new MockSearchService();
|
|
1591
|
-
const el = await fixture(html `<collection-browser
|
|
1592
|
-
.baseNavigationUrl=${''}
|
|
1593
|
-
.searchService=${searchService}
|
|
1594
|
-
.enableSortOptionsSlot=${true}
|
|
1595
|
-
>
|
|
1610
|
+
const el = await fixture(html `<collection-browser
|
|
1611
|
+
.baseNavigationUrl=${''}
|
|
1612
|
+
.searchService=${searchService}
|
|
1613
|
+
.enableSortOptionsSlot=${true}
|
|
1614
|
+
>
|
|
1596
1615
|
</collection-browser>`);
|
|
1597
1616
|
el.baseQuery = 'collection:foo';
|
|
1598
1617
|
await el.updateComplete;
|
|
@@ -1607,9 +1626,9 @@ describe('Collection Browser', () => {
|
|
|
1607
1626
|
it('can suppress presence of result count', async () => {
|
|
1608
1627
|
var _a;
|
|
1609
1628
|
const searchService = new MockSearchService();
|
|
1610
|
-
const el = await fixture(html `<collection-browser
|
|
1611
|
-
.searchService=${searchService}
|
|
1612
|
-
suppressResultCount
|
|
1629
|
+
const el = await fixture(html `<collection-browser
|
|
1630
|
+
.searchService=${searchService}
|
|
1631
|
+
suppressResultCount
|
|
1613
1632
|
></collection-browser>`);
|
|
1614
1633
|
el.baseQuery = 'collection:foo';
|
|
1615
1634
|
await el.updateComplete;
|
|
@@ -1620,9 +1639,9 @@ describe('Collection Browser', () => {
|
|
|
1620
1639
|
it('can suppress presence of result tiles', async () => {
|
|
1621
1640
|
var _a;
|
|
1622
1641
|
const searchService = new MockSearchService();
|
|
1623
|
-
const el = await fixture(html `<collection-browser
|
|
1624
|
-
.searchService=${searchService}
|
|
1625
|
-
suppressResultTiles
|
|
1642
|
+
const el = await fixture(html `<collection-browser
|
|
1643
|
+
.searchService=${searchService}
|
|
1644
|
+
suppressResultTiles
|
|
1626
1645
|
></collection-browser>`);
|
|
1627
1646
|
el.baseQuery = 'collection:foo';
|
|
1628
1647
|
await el.updateComplete;
|
|
@@ -1635,7 +1654,7 @@ describe('Collection Browser', () => {
|
|
|
1635
1654
|
asyncResponse: true,
|
|
1636
1655
|
resultsSpy,
|
|
1637
1656
|
});
|
|
1638
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1657
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1639
1658
|
</collection-browser>`);
|
|
1640
1659
|
const numberOfPages = 15;
|
|
1641
1660
|
el.baseQuery = 'jack';
|
|
@@ -1648,10 +1667,10 @@ describe('Collection Browser', () => {
|
|
|
1648
1667
|
it('renders provided results header instead of default, when showing smart results', async () => {
|
|
1649
1668
|
var _a, _b;
|
|
1650
1669
|
const searchService = new MockSearchService();
|
|
1651
|
-
const el = await fixture(html `<collection-browser
|
|
1652
|
-
showSmartResults
|
|
1653
|
-
.searchService=${searchService}
|
|
1654
|
-
.resultsHeader=${'Foo Bar'}
|
|
1670
|
+
const el = await fixture(html `<collection-browser
|
|
1671
|
+
showSmartResults
|
|
1672
|
+
.searchService=${searchService}
|
|
1673
|
+
.resultsHeader=${'Foo Bar'}
|
|
1655
1674
|
></collection-browser>`);
|
|
1656
1675
|
el.baseQuery = 'foo';
|
|
1657
1676
|
await el.updateComplete;
|