@internetarchive/collection-browser 3.0.7-alpha-webdev7989.0 → 3.1.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.
@@ -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,20 +394,33 @@ 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;
404
404
  await el.initialSearchComplete;
405
405
  expect(emptyResultsSpy.callCount).to.equal(1);
406
406
  });
407
+ it('emits searchError event when search results in an error', async () => {
408
+ const searchService = new MockSearchService();
409
+ const searchErrorSpy = sinon.spy();
410
+ const el = await fixture(html `<collection-browser
411
+ .searchService=${searchService}
412
+ @searchError=${searchErrorSpy}
413
+ >
414
+ </collection-browser>`);
415
+ el.baseQuery = 'error';
416
+ await el.updateComplete;
417
+ await el.initialSearchComplete;
418
+ expect(searchErrorSpy.callCount).to.equal(1);
419
+ });
407
420
  it('applies loggedin flag to tile models if needed', async () => {
408
421
  var _a;
409
422
  const searchService = new MockSearchService();
410
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
423
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
411
424
  </collection-browser>`);
412
425
  el.baseQuery = 'loggedin';
413
426
  await el.updateComplete;
@@ -421,7 +434,7 @@ describe('Collection Browser', () => {
421
434
  it('applies no-preview flag to tile models if needed', async () => {
422
435
  var _a;
423
436
  const searchService = new MockSearchService();
424
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
437
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
425
438
  </collection-browser>`);
426
439
  el.baseQuery = 'no-preview';
427
440
  await el.updateComplete;
@@ -435,7 +448,7 @@ describe('Collection Browser', () => {
435
448
  it('both loggedin and no-preview flags can be set simultaneously', async () => {
436
449
  var _a, _b;
437
450
  const searchService = new MockSearchService();
438
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
451
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
439
452
  </collection-browser>`);
440
453
  el.baseQuery = 'loggedin-no-preview';
441
454
  await el.updateComplete;
@@ -450,7 +463,7 @@ describe('Collection Browser', () => {
450
463
  it('joins full description array into a single string with line breaks', async () => {
451
464
  var _a;
452
465
  const searchService = new MockSearchService();
453
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
466
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
454
467
  </collection-browser>`);
455
468
  // This query receives an array description like ['line1', 'line2']
456
469
  el.baseQuery = 'multi-line-description';
@@ -466,9 +479,9 @@ describe('Collection Browser', () => {
466
479
  it('can change search type', async () => {
467
480
  var _a;
468
481
  const searchService = new MockSearchService();
469
- const el = await fixture(html `<collection-browser
470
- .searchService=${searchService}
471
- .searchType=${SearchType.METADATA}
482
+ const el = await fixture(html `<collection-browser
483
+ .searchService=${searchService}
484
+ .searchType=${SearchType.METADATA}
472
485
  ></collection-browser>`);
473
486
  el.baseQuery = 'collection:foo';
474
487
  el.searchType = SearchType.FULLTEXT;
@@ -480,8 +493,8 @@ describe('Collection Browser', () => {
480
493
  it('trims queries of leading/trailing whitespace', async () => {
481
494
  var _a;
482
495
  const searchService = new MockSearchService();
483
- const el = await fixture(html `<collection-browser
484
- .searchService=${searchService}
496
+ const el = await fixture(html `<collection-browser
497
+ .searchService=${searchService}
485
498
  ></collection-browser>`);
486
499
  el.baseQuery = ' collection:foo ';
487
500
  await el.updateComplete;
@@ -491,8 +504,8 @@ describe('Collection Browser', () => {
491
504
  it('shows error message when error response received', async () => {
492
505
  var _a, _b;
493
506
  const searchService = new MockSearchService();
494
- const el = await fixture(html `<collection-browser
495
- .searchService=${searchService}
507
+ const el = await fixture(html `<collection-browser
508
+ .searchService=${searchService}
496
509
  ></collection-browser>`);
497
510
  el.baseQuery = 'error';
498
511
  await el.updateComplete;
@@ -505,8 +518,8 @@ describe('Collection Browser', () => {
505
518
  it('shows error message when error response received for a collection', async () => {
506
519
  var _a, _b;
507
520
  const searchService = new MockSearchService();
508
- const el = await fixture(html `<collection-browser
509
- .searchService=${searchService}
521
+ const el = await fixture(html `<collection-browser
522
+ .searchService=${searchService}
510
523
  ></collection-browser>`);
511
524
  el.withinCollection = 'error';
512
525
  await el.updateComplete;
@@ -521,8 +534,8 @@ describe('Collection Browser', () => {
521
534
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
522
535
  window.Sentry = { captureMessage: sentrySpy };
523
536
  const searchService = new MockSearchService();
524
- const el = await fixture(html `<collection-browser
525
- .searchService=${searchService}
537
+ const el = await fixture(html `<collection-browser
538
+ .searchService=${searchService}
526
539
  ></collection-browser>`);
527
540
  el.baseQuery = 'malformed';
528
541
  await el.updateComplete;
@@ -531,7 +544,7 @@ describe('Collection Browser', () => {
531
544
  });
532
545
  it('adds collection names to cache when present on response', async () => {
533
546
  const searchService = new MockSearchService();
534
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
547
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
535
548
  </collection-browser>`);
536
549
  el.baseQuery = 'collection-titles';
537
550
  await el.updateComplete;
@@ -543,7 +556,7 @@ describe('Collection Browser', () => {
543
556
  });
544
557
  it('adds tv channel aliases to cache when present on response', async () => {
545
558
  const searchService = new MockSearchService();
546
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
559
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
547
560
  </collection-browser>`);
548
561
  el.baseQuery = 'channel-aliases';
549
562
  await el.updateComplete;
@@ -557,7 +570,7 @@ describe('Collection Browser', () => {
557
570
  asyncResponse: true,
558
571
  resultsSpy,
559
572
  });
560
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
573
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
561
574
  </collection-browser>`);
562
575
  el.baseQuery = 'with-sort';
563
576
  el.selectedSort = SortField.date;
@@ -574,7 +587,7 @@ describe('Collection Browser', () => {
574
587
  asyncResponse: true,
575
588
  resultsSpy,
576
589
  });
577
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
590
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
578
591
  </collection-browser>`);
579
592
  el.baseQuery = 'with-sort';
580
593
  el.selectedSort = SortField.date;
@@ -596,7 +609,7 @@ describe('Collection Browser', () => {
596
609
  asyncResponse: true,
597
610
  resultsSpy,
598
611
  });
599
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
612
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
600
613
  </collection-browser>`);
601
614
  el.baseQuery = 'single-result';
602
615
  await el.updateComplete;
@@ -617,7 +630,7 @@ describe('Collection Browser', () => {
617
630
  asyncResponse: true,
618
631
  resultsSpy,
619
632
  });
620
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
633
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
621
634
  </collection-browser>`);
622
635
  el.baseQuery = 'with-sort';
623
636
  el.selectedSort = SortField.date;
@@ -636,7 +649,7 @@ describe('Collection Browser', () => {
636
649
  it('sets sort properties when user changes sort', async () => {
637
650
  var _a, _b, _c, _d, _e, _f;
638
651
  const searchService = new MockSearchService();
639
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
652
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
640
653
  </collection-browser>`);
641
654
  expect(el.selectedSort).to.equal(SortField.default);
642
655
  el.baseQuery = 'foo';
@@ -659,7 +672,7 @@ describe('Collection Browser', () => {
659
672
  it('sets sort filter properties when user selects title filter', async () => {
660
673
  var _a, _b, _c, _d;
661
674
  const searchService = new MockSearchService();
662
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
675
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
663
676
  </collection-browser>`);
664
677
  el.baseQuery = 'first-title';
665
678
  el.selectedSort = 'title';
@@ -673,7 +686,7 @@ describe('Collection Browser', () => {
673
686
  it('sets sort filter properties when user selects creator filter', async () => {
674
687
  var _a, _b, _c, _d;
675
688
  const searchService = new MockSearchService();
676
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
689
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
677
690
  </collection-browser>`);
678
691
  el.baseQuery = 'first-creator';
679
692
  el.selectedSort = 'creator';
@@ -696,7 +709,7 @@ describe('Collection Browser', () => {
696
709
  subject: {},
697
710
  year: {},
698
711
  };
699
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
712
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
700
713
  </collection-browser>`);
701
714
  el.baseQuery = 'first-creator';
702
715
  el.selectedSort = 'creator';
@@ -724,7 +737,7 @@ describe('Collection Browser', () => {
724
737
  it('applies correct search filter when TV clip filter set to commercials', async () => {
725
738
  var _a, _b, _c;
726
739
  const searchService = new MockSearchService();
727
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
740
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
728
741
  </collection-browser>`);
729
742
  el.baseQuery = 'tv-fields';
730
743
  el.searchType = SearchType.TV;
@@ -736,7 +749,7 @@ describe('Collection Browser', () => {
736
749
  it('applies correct search filter when TV clip filter set to factchecks', async () => {
737
750
  var _a, _b, _c;
738
751
  const searchService = new MockSearchService();
739
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
752
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
740
753
  </collection-browser>`);
741
754
  el.baseQuery = 'tv-fields';
742
755
  el.searchType = SearchType.TV;
@@ -748,7 +761,7 @@ describe('Collection Browser', () => {
748
761
  it('applies correct search filter when TV clip filter set to quotes', async () => {
749
762
  var _a, _b, _c;
750
763
  const searchService = new MockSearchService();
751
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
764
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
752
765
  </collection-browser>`);
753
766
  el.baseQuery = 'tv-fields';
754
767
  el.searchType = SearchType.TV;
@@ -760,7 +773,7 @@ describe('Collection Browser', () => {
760
773
  it('resets letter filters when query changes', async () => {
761
774
  var _a, _b, _c, _d, _e, _f, _g;
762
775
  const searchService = new MockSearchService();
763
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
776
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
764
777
  </collection-browser>`);
765
778
  el.baseQuery = 'first-creator';
766
779
  el.selectedSort = 'creator';
@@ -781,11 +794,11 @@ describe('Collection Browser', () => {
781
794
  var _a, _b, _c;
782
795
  const searchService = new MockSearchService();
783
796
  const mockAnalyticsHandler = new MockAnalyticsHandler();
784
- const el = await fixture(html `<collection-browser
785
- .searchService=${searchService}
786
- .analyticsHandler=${mockAnalyticsHandler}
787
- .suppressPlaceholders=${true}
788
- >
797
+ const el = await fixture(html `<collection-browser
798
+ .searchService=${searchService}
799
+ .analyticsHandler=${mockAnalyticsHandler}
800
+ .suppressPlaceholders=${true}
801
+ >
789
802
  </collection-browser>`);
790
803
  el.baseQuery = 'years'; // Includes year_histogram aggregation in response
791
804
  el.showHistogramDatePicker = true;
@@ -814,10 +827,10 @@ describe('Collection Browser', () => {
814
827
  it('sets date range query when monthly date picker selection changed', async () => {
815
828
  var _a, _b, _c;
816
829
  const searchService = new MockSearchService();
817
- const el = await fixture(html `<collection-browser
818
- .searchService=${searchService}
819
- .suppressPlaceholders=${true}
820
- >
830
+ const el = await fixture(html `<collection-browser
831
+ .searchService=${searchService}
832
+ .suppressPlaceholders=${true}
833
+ >
821
834
  </collection-browser>`);
822
835
  el.baseQuery = 'months'; // Includes date_histogram aggregation in response
823
836
  el.searchType = SearchType.TV;
@@ -848,9 +861,9 @@ describe('Collection Browser', () => {
848
861
  var _a, _b, _c, _d;
849
862
  const spy = sinon.spy();
850
863
  const searchService = new MockSearchService();
851
- const el = await fixture(html `<collection-browser
852
- .searchService=${searchService}
853
- @searchResultsLoadingChanged=${spy}
864
+ const el = await fixture(html `<collection-browser
865
+ .searchService=${searchService}
866
+ @searchResultsLoadingChanged=${spy}
854
867
  ></collection-browser>`);
855
868
  spy.resetHistory();
856
869
  el.baseQuery = 'collection:foo';
@@ -864,9 +877,9 @@ describe('Collection Browser', () => {
864
877
  it('collapses extra set of quotes around href field', async () => {
865
878
  var _a;
866
879
  const searchService = new MockSearchService();
867
- const el = await fixture(html `<collection-browser
868
- .searchService=${searchService}
869
- .baseNavigationUrl=${''}
880
+ const el = await fixture(html `<collection-browser
881
+ .searchService=${searchService}
882
+ .baseNavigationUrl=${''}
870
883
  ></collection-browser>`);
871
884
  el.baseQuery = 'extra-quoted-href';
872
885
  await el.updateComplete;
@@ -879,9 +892,9 @@ describe('Collection Browser', () => {
879
892
  it('sets default sort from collection metadata', async () => {
880
893
  var _a;
881
894
  const searchService = new MockSearchService();
882
- const el = await fixture(html `<collection-browser
883
- .searchService=${searchService}
884
- .baseNavigationUrl=${''}
895
+ const el = await fixture(html `<collection-browser
896
+ .searchService=${searchService}
897
+ .baseNavigationUrl=${''}
885
898
  ></collection-browser>`);
886
899
  el.withinCollection = 'default-sort';
887
900
  await el.updateComplete;
@@ -898,9 +911,9 @@ describe('Collection Browser', () => {
898
911
  it('sets default sort from collection metadata in "-field" format', async () => {
899
912
  var _a;
900
913
  const searchService = new MockSearchService();
901
- const el = await fixture(html `<collection-browser
902
- .searchService=${searchService}
903
- .baseNavigationUrl=${''}
914
+ const el = await fixture(html `<collection-browser
915
+ .searchService=${searchService}
916
+ .baseNavigationUrl=${''}
904
917
  ></collection-browser>`);
905
918
  el.withinCollection = 'default-sort-concise';
906
919
  await el.updateComplete;
@@ -915,8 +928,8 @@ describe('Collection Browser', () => {
915
928
  expect(sortBar.sortDirection).to.be.null;
916
929
  });
917
930
  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'}
931
+ const el = await fixture(html `<collection-browser
932
+ .withinProfile=${'@foobar'}
920
933
  ></collection-browser>`);
921
934
  el.applyDefaultProfileSort();
922
935
  expect(el.defaultSortParam).to.deep.equal({
@@ -927,9 +940,9 @@ describe('Collection Browser', () => {
927
940
  it('uses relevance sort as default when a query is set', async () => {
928
941
  var _a;
929
942
  const searchService = new MockSearchService();
930
- const el = await fixture(html `<collection-browser
931
- .searchService=${searchService}
932
- .baseNavigationUrl=${''}
943
+ const el = await fixture(html `<collection-browser
944
+ .searchService=${searchService}
945
+ .baseNavigationUrl=${''}
933
946
  ></collection-browser>`);
934
947
  el.withinCollection = 'default-sort';
935
948
  el.baseQuery = 'default-sort';
@@ -947,9 +960,9 @@ describe('Collection Browser', () => {
947
960
  it('uses date favorited sort as default when targeting fav- collection', async () => {
948
961
  var _a;
949
962
  const searchService = new MockSearchService();
950
- const el = await fixture(html `<collection-browser
951
- .searchService=${searchService}
952
- .baseNavigationUrl=${''}
963
+ const el = await fixture(html `<collection-browser
964
+ .searchService=${searchService}
965
+ .baseNavigationUrl=${''}
953
966
  ></collection-browser>`);
954
967
  el.withinCollection = 'fav-sort';
955
968
  await el.updateComplete;
@@ -966,7 +979,7 @@ describe('Collection Browser', () => {
966
979
  it('scrolls to page', async () => {
967
980
  var _a;
968
981
  const searchService = new MockSearchService();
969
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
982
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
970
983
  </collection-browser>`);
971
984
  // Infinite scroller won't exist unless there's a base query.
972
985
  // First ensure that we don't throw errors when it doesn't exist.
@@ -988,9 +1001,9 @@ describe('Collection Browser', () => {
988
1001
  it('shows mobile facets in mobile view', async () => {
989
1002
  var _a, _b;
990
1003
  const searchService = new MockSearchService();
991
- const el = await fixture(html `<collection-browser
992
- .searchService=${searchService}
993
- .mobileBreakpoint=${9999}
1004
+ const el = await fixture(html `<collection-browser
1005
+ .searchService=${searchService}
1006
+ .mobileBreakpoint=${9999}
994
1007
  ></collection-browser>`);
995
1008
  el.baseQuery = 'collection:foo';
996
1009
  await el.updateComplete;
@@ -1010,11 +1023,11 @@ describe('Collection Browser', () => {
1010
1023
  var _a, _b;
1011
1024
  const searchService = new MockSearchService();
1012
1025
  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}
1026
+ const el = await fixture(html `<collection-browser
1027
+ .searchService=${searchService}
1028
+ .analyticsHandler=${analyticsHandler}
1029
+ .searchContext=${'foobar-context'}
1030
+ .mobileBreakpoint=${9999}
1018
1031
  ></collection-browser>`);
1019
1032
  el.baseQuery = 'collection:foo';
1020
1033
  await el.updateComplete;
@@ -1054,9 +1067,9 @@ describe('Collection Browser', () => {
1054
1067
  });
1055
1068
  it('sets parent collections to prop when searching a collection', async () => {
1056
1069
  const searchService = new MockSearchService();
1057
- const el = await fixture(html `<collection-browser
1058
- .searchService=${searchService}
1059
- .withinCollection=${'fake'}
1070
+ const el = await fixture(html `<collection-browser
1071
+ .searchService=${searchService}
1072
+ .withinCollection=${'fake'}
1060
1073
  ></collection-browser>`);
1061
1074
  el.baseQuery = 'parent-collections';
1062
1075
  await el.updateComplete;
@@ -1066,9 +1079,9 @@ describe('Collection Browser', () => {
1066
1079
  });
1067
1080
  it('recognizes TV collections', async () => {
1068
1081
  const searchService = new MockSearchService();
1069
- const el = await fixture(html `<collection-browser
1070
- .searchService=${searchService}
1071
- .withinCollection=${'TV-FOO'}
1082
+ const el = await fixture(html `<collection-browser
1083
+ .searchService=${searchService}
1084
+ .withinCollection=${'TV-FOO'}
1072
1085
  ></collection-browser>`);
1073
1086
  el.baseQuery = 'tv-collection';
1074
1087
  await el.updateComplete;
@@ -1080,9 +1093,9 @@ describe('Collection Browser', () => {
1080
1093
  var _a;
1081
1094
  const mockAnalyticsHandler = new MockAnalyticsHandler();
1082
1095
  const searchService = new MockSearchService();
1083
- const el = await fixture(html `<collection-browser
1084
- .analyticsHandler=${mockAnalyticsHandler}
1085
- .searchService=${searchService}
1096
+ const el = await fixture(html `<collection-browser
1097
+ .analyticsHandler=${mockAnalyticsHandler}
1098
+ .searchService=${searchService}
1086
1099
  ></collection-browser>`);
1087
1100
  const infiniteScrollerRefreshSpy = sinon.spy();
1088
1101
  // Infinite scroller won't exist unless there's a base query
@@ -1128,7 +1141,7 @@ describe('Collection Browser', () => {
1128
1141
  it('query the search service for single result', async () => {
1129
1142
  var _a, _b;
1130
1143
  const searchService = new MockSearchService();
1131
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1144
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1132
1145
  </collection-browser>`);
1133
1146
  el.baseQuery = 'single-result';
1134
1147
  await el.updateComplete;
@@ -1157,7 +1170,7 @@ describe('Collection Browser', () => {
1157
1170
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1158
1171
  window.history.replaceState({}, '', url);
1159
1172
  const searchService = new MockSearchService();
1160
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1173
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1161
1174
  </collection-browser>`);
1162
1175
  await el.initialSearchComplete;
1163
1176
  await el.updateComplete;
@@ -1183,10 +1196,10 @@ describe('Collection Browser', () => {
1183
1196
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1184
1197
  window.history.replaceState({}, '', url);
1185
1198
  const searchService = new MockSearchService();
1186
- const el = await fixture(html `<collection-browser
1187
- .searchService=${searchService}
1188
- .withinCollection=${'foobar'}
1189
- >
1199
+ const el = await fixture(html `<collection-browser
1200
+ .searchService=${searchService}
1201
+ .withinCollection=${'foobar'}
1202
+ >
1190
1203
  </collection-browser>`);
1191
1204
  await el.initialSearchComplete;
1192
1205
  await el.updateComplete;
@@ -1211,11 +1224,11 @@ describe('Collection Browser', () => {
1211
1224
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1212
1225
  window.history.replaceState({}, '', url);
1213
1226
  const searchService = new MockSearchService();
1214
- const el = await fixture(html `<collection-browser
1215
- .searchService=${searchService}
1216
- .withinProfile=${'@foobar'}
1217
- .profileElement=${'uploads'}
1218
- >
1227
+ const el = await fixture(html `<collection-browser
1228
+ .searchService=${searchService}
1229
+ .withinProfile=${'@foobar'}
1230
+ .profileElement=${'uploads'}
1231
+ >
1219
1232
  </collection-browser>`);
1220
1233
  await el.initialSearchComplete;
1221
1234
  await el.updateComplete;
@@ -1242,7 +1255,7 @@ describe('Collection Browser', () => {
1242
1255
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1243
1256
  window.history.replaceState({}, '', url);
1244
1257
  const searchService = new MockSearchService();
1245
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1258
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1246
1259
  </collection-browser>`);
1247
1260
  await el.initialSearchComplete;
1248
1261
  await el.updateComplete;
@@ -1270,10 +1283,10 @@ describe('Collection Browser', () => {
1270
1283
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1271
1284
  window.history.replaceState({}, '', url);
1272
1285
  const searchService = new MockSearchService();
1273
- const el = await fixture(html `<collection-browser
1274
- .searchService=${searchService}
1275
- .withinCollection=${'foobar'}
1276
- >
1286
+ const el = await fixture(html `<collection-browser
1287
+ .searchService=${searchService}
1288
+ .withinCollection=${'foobar'}
1289
+ >
1277
1290
  </collection-browser>`);
1278
1291
  el.baseQuery = 'bar';
1279
1292
  await el.updateComplete;
@@ -1300,10 +1313,10 @@ describe('Collection Browser', () => {
1300
1313
  searchParams.append('and[]', 'year:[2000 TO 2010]');
1301
1314
  window.history.replaceState({}, '', url);
1302
1315
  const searchService = new MockSearchService();
1303
- const el = await fixture(html `<collection-browser
1304
- .searchService=${searchService}
1305
- .withinCollection=${'foobar'}
1306
- >
1316
+ const el = await fixture(html `<collection-browser
1317
+ .searchService=${searchService}
1318
+ .withinCollection=${'foobar'}
1319
+ >
1307
1320
  </collection-browser>`);
1308
1321
  el.withinCollection = 'bar';
1309
1322
  await el.updateComplete;
@@ -1320,11 +1333,11 @@ describe('Collection Browser', () => {
1320
1333
  it('correctly retrieves web archive hits', async () => {
1321
1334
  var _a, _b, _c;
1322
1335
  const searchService = new MockSearchService();
1323
- const el = await fixture(html `<collection-browser
1324
- .searchService=${searchService}
1325
- .withinProfile=${'@foo'}
1326
- .profileElement=${'web_archives'}
1327
- >
1336
+ const el = await fixture(html `<collection-browser
1337
+ .searchService=${searchService}
1338
+ .withinProfile=${'@foo'}
1339
+ .profileElement=${'web_archives'}
1340
+ >
1328
1341
  </collection-browser>`);
1329
1342
  el.baseQuery = 'web-archive';
1330
1343
  await el.updateComplete;
@@ -1338,10 +1351,10 @@ describe('Collection Browser', () => {
1338
1351
  it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
1339
1352
  var _a;
1340
1353
  const searchService = new MockSearchService();
1341
- const el = await fixture(html `<collection-browser
1342
- .searchService=${searchService}
1343
- facetLoadStrategy=${'opt-in'}
1344
- >
1354
+ const el = await fixture(html `<collection-browser
1355
+ .searchService=${searchService}
1356
+ facetLoadStrategy=${'opt-in'}
1357
+ >
1345
1358
  </collection-browser>`);
1346
1359
  el.baseQuery = 'foo';
1347
1360
  await el.updateComplete;
@@ -1352,10 +1365,10 @@ describe('Collection Browser', () => {
1352
1365
  it('shows temporarily unavailable message when facets suppressed', async () => {
1353
1366
  var _a, _b;
1354
1367
  const searchService = new MockSearchService();
1355
- const el = await fixture(html `<collection-browser
1356
- .searchService=${searchService}
1357
- facetLoadStrategy=${'off'}
1358
- >
1368
+ const el = await fixture(html `<collection-browser
1369
+ .searchService=${searchService}
1370
+ facetLoadStrategy=${'off'}
1371
+ >
1359
1372
  </collection-browser>`);
1360
1373
  el.baseQuery = 'foo';
1361
1374
  await el.updateComplete;
@@ -1367,7 +1380,7 @@ describe('Collection Browser', () => {
1367
1380
  it('shows manage bar interface instead of sort bar when in manage view', async () => {
1368
1381
  var _a, _b, _c, _d;
1369
1382
  const searchService = new MockSearchService();
1370
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1383
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1371
1384
  </collection-browser>`);
1372
1385
  el.baseQuery = 'foo';
1373
1386
  await el.updateComplete;
@@ -1383,11 +1396,11 @@ describe('Collection Browser', () => {
1383
1396
  });
1384
1397
  it('switches to grid display mode when manage view activated', async () => {
1385
1398
  const searchService = new MockSearchService();
1386
- const el = await fixture(html `<collection-browser
1387
- .searchService=${searchService}
1388
- .baseQuery=${'foo'}
1389
- .displayMode=${'list-detail'}
1390
- >
1399
+ const el = await fixture(html `<collection-browser
1400
+ .searchService=${searchService}
1401
+ .baseQuery=${'foo'}
1402
+ .displayMode=${'list-detail'}
1403
+ >
1391
1404
  </collection-browser>`);
1392
1405
  el.isManageView = true;
1393
1406
  await el.updateComplete;
@@ -1396,10 +1409,10 @@ describe('Collection Browser', () => {
1396
1409
  it('can remove all checked tiles', async () => {
1397
1410
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1398
1411
  const searchService = new MockSearchService();
1399
- const el = await fixture(html `<collection-browser
1400
- .searchService=${searchService}
1401
- .baseNavigationUrl=${''}
1402
- >
1412
+ const el = await fixture(html `<collection-browser
1413
+ .searchService=${searchService}
1414
+ .baseNavigationUrl=${''}
1415
+ >
1403
1416
  </collection-browser>`);
1404
1417
  el.baseQuery = 'foo';
1405
1418
  el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
@@ -1435,10 +1448,10 @@ describe('Collection Browser', () => {
1435
1448
  });
1436
1449
  it('can check/uncheck all tiles', async () => {
1437
1450
  const searchService = new MockSearchService();
1438
- const el = await fixture(html `<collection-browser
1439
- .searchService=${searchService}
1440
- .baseNavigationUrl=${''}
1441
- >
1451
+ const el = await fixture(html `<collection-browser
1452
+ .searchService=${searchService}
1453
+ .baseNavigationUrl=${''}
1454
+ >
1442
1455
  </collection-browser>`);
1443
1456
  el.baseQuery = 'foo';
1444
1457
  await el.updateComplete;
@@ -1458,10 +1471,10 @@ describe('Collection Browser', () => {
1458
1471
  var _a, _b;
1459
1472
  const spy = sinon.spy();
1460
1473
  const searchService = new MockSearchService();
1461
- const el = await fixture(html `<collection-browser
1462
- .searchService=${searchService}
1463
- .baseNavigationUrl=${''}
1464
- @manageModeChanged=${spy}
1474
+ const el = await fixture(html `<collection-browser
1475
+ .searchService=${searchService}
1476
+ .baseNavigationUrl=${''}
1477
+ @manageModeChanged=${spy}
1465
1478
  ></collection-browser>`);
1466
1479
  el.isManageView = true;
1467
1480
  await el.updateComplete;
@@ -1476,11 +1489,11 @@ describe('Collection Browser', () => {
1476
1489
  var _a, _b, _c, _d, _e;
1477
1490
  const spy = sinon.spy();
1478
1491
  const searchService = new MockSearchService();
1479
- const el = await fixture(html `<collection-browser
1480
- .searchService=${searchService}
1481
- .baseNavigationUrl=${''}
1482
- @itemRemovalRequested=${spy}
1483
- >
1492
+ const el = await fixture(html `<collection-browser
1493
+ .searchService=${searchService}
1494
+ .baseNavigationUrl=${''}
1495
+ @itemRemovalRequested=${spy}
1496
+ >
1484
1497
  </collection-browser>`);
1485
1498
  el.baseQuery = 'foo';
1486
1499
  await el.updateComplete;
@@ -1510,10 +1523,10 @@ describe('Collection Browser', () => {
1510
1523
  it('disables manage view when manage bar cancelled', async () => {
1511
1524
  var _a;
1512
1525
  const searchService = new MockSearchService();
1513
- const el = await fixture(html `<collection-browser
1514
- .searchService=${searchService}
1515
- .baseNavigationUrl=${''}
1516
- >
1526
+ const el = await fixture(html `<collection-browser
1527
+ .searchService=${searchService}
1528
+ .baseNavigationUrl=${''}
1529
+ >
1517
1530
  </collection-browser>`);
1518
1531
  el.baseQuery = 'foo';
1519
1532
  await el.updateComplete;
@@ -1530,7 +1543,7 @@ describe('Collection Browser', () => {
1530
1543
  it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
1531
1544
  var _a, _b, _c, _d;
1532
1545
  const searchService = new MockSearchService();
1533
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1546
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1534
1547
  </collection-browser>`);
1535
1548
  el.baseQuery = 'foo';
1536
1549
  await el.updateComplete;
@@ -1558,10 +1571,10 @@ describe('Collection Browser', () => {
1558
1571
  it('shows Blurring checkbox for admin users', async () => {
1559
1572
  var _a;
1560
1573
  const searchService = new MockSearchService();
1561
- const el = await fixture(html `<collection-browser
1562
- .baseNavigationUrl=${''}
1563
- .searchService=${searchService}
1564
- >
1574
+ const el = await fixture(html `<collection-browser
1575
+ .baseNavigationUrl=${''}
1576
+ .searchService=${searchService}
1577
+ >
1565
1578
  </collection-browser>`);
1566
1579
  el.baseQuery = 'archive-org-user-loggedin';
1567
1580
  await el.updateComplete;
@@ -1573,10 +1586,10 @@ describe('Collection Browser', () => {
1573
1586
  it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
1574
1587
  var _a;
1575
1588
  const searchService = new MockSearchService();
1576
- const el = await fixture(html `<collection-browser
1577
- .baseNavigationUrl=${''}
1578
- .searchService=${searchService}
1579
- >
1589
+ const el = await fixture(html `<collection-browser
1590
+ .baseNavigationUrl=${''}
1591
+ .searchService=${searchService}
1592
+ >
1580
1593
  </collection-browser>`);
1581
1594
  el.baseQuery = 'archive-org-user-loggedin-noblur';
1582
1595
  await el.updateComplete;
@@ -1588,10 +1601,10 @@ describe('Collection Browser', () => {
1588
1601
  it('toggles blur state when Blurring checkbox is toggled', async () => {
1589
1602
  var _a, _b, _c;
1590
1603
  const searchService = new MockSearchService();
1591
- const el = await fixture(html `<collection-browser
1592
- .baseNavigationUrl=${''}
1593
- .searchService=${searchService}
1594
- >
1604
+ const el = await fixture(html `<collection-browser
1605
+ .baseNavigationUrl=${''}
1606
+ .searchService=${searchService}
1607
+ >
1595
1608
  </collection-browser>`);
1596
1609
  el.baseQuery = 'archive-org-user-loggedin';
1597
1610
  await el.updateComplete;
@@ -1607,11 +1620,11 @@ describe('Collection Browser', () => {
1607
1620
  it('applies loans tab properties to sort bar', async () => {
1608
1621
  var _a;
1609
1622
  const searchService = new MockSearchService();
1610
- const el = await fixture(html `<collection-browser
1611
- .baseNavigationUrl=${''}
1612
- .searchService=${searchService}
1613
- .enableSortOptionsSlot=${true}
1614
- >
1623
+ const el = await fixture(html `<collection-browser
1624
+ .baseNavigationUrl=${''}
1625
+ .searchService=${searchService}
1626
+ .enableSortOptionsSlot=${true}
1627
+ >
1615
1628
  </collection-browser>`);
1616
1629
  el.baseQuery = 'collection:foo';
1617
1630
  await el.updateComplete;
@@ -1626,9 +1639,9 @@ describe('Collection Browser', () => {
1626
1639
  it('can suppress presence of result count', async () => {
1627
1640
  var _a;
1628
1641
  const searchService = new MockSearchService();
1629
- const el = await fixture(html `<collection-browser
1630
- .searchService=${searchService}
1631
- suppressResultCount
1642
+ const el = await fixture(html `<collection-browser
1643
+ .searchService=${searchService}
1644
+ suppressResultCount
1632
1645
  ></collection-browser>`);
1633
1646
  el.baseQuery = 'collection:foo';
1634
1647
  await el.updateComplete;
@@ -1639,9 +1652,9 @@ describe('Collection Browser', () => {
1639
1652
  it('can suppress presence of result tiles', async () => {
1640
1653
  var _a;
1641
1654
  const searchService = new MockSearchService();
1642
- const el = await fixture(html `<collection-browser
1643
- .searchService=${searchService}
1644
- suppressResultTiles
1655
+ const el = await fixture(html `<collection-browser
1656
+ .searchService=${searchService}
1657
+ suppressResultTiles
1645
1658
  ></collection-browser>`);
1646
1659
  el.baseQuery = 'collection:foo';
1647
1660
  await el.updateComplete;
@@ -1654,7 +1667,7 @@ describe('Collection Browser', () => {
1654
1667
  asyncResponse: true,
1655
1668
  resultsSpy,
1656
1669
  });
1657
- const el = await fixture(html `<collection-browser .searchService=${searchService}>
1670
+ const el = await fixture(html `<collection-browser .searchService=${searchService}>
1658
1671
  </collection-browser>`);
1659
1672
  const numberOfPages = 15;
1660
1673
  el.baseQuery = 'jack';