@internetarchive/collection-browser 3.0.1 → 3.0.2-alpha-webdev7960.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/collection-browser.js +680 -680
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +130 -130
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets.js +263 -263
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/test/collection-browser.test.js +183 -183
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +2 -2
- package/src/collection-browser.ts +2775 -2775
- package/src/collection-facets/facet-row.ts +282 -282
- package/src/collection-facets.ts +990 -990
- package/src/data-source/collection-browser-data-source-interface.ts +333 -333
- package/src/data-source/collection-browser-data-source.ts +1390 -1390
- package/src/data-source/collection-browser-query-state.ts +63 -63
- package/src/data-source/models.ts +43 -43
- package/src/models.ts +870 -870
- package/src/restoration-state-handler.ts +544 -544
- package/test/collection-browser.test.ts +2340 -2340
- package/test/restoration-state-handler.test.ts +510 -510
|
@@ -71,7 +71,7 @@ describe('Collection Browser', () => {
|
|
|
71
71
|
});
|
|
72
72
|
it('filterBy creator with analytics', async () => {
|
|
73
73
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
74
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
74
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
75
75
|
</collection-browser>`);
|
|
76
76
|
el.searchContext = 'betaSearchService';
|
|
77
77
|
el.selectedSort = 'creator';
|
|
@@ -90,7 +90,7 @@ describe('Collection Browser', () => {
|
|
|
90
90
|
});
|
|
91
91
|
it('filterBy title with analytics', async () => {
|
|
92
92
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
93
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
93
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
94
94
|
</collection-browser>`);
|
|
95
95
|
el.searchContext = 'beta-search-service';
|
|
96
96
|
el.selectedSort = 'title';
|
|
@@ -119,7 +119,7 @@ describe('Collection Browser', () => {
|
|
|
119
119
|
collection: {},
|
|
120
120
|
year: {},
|
|
121
121
|
};
|
|
122
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
122
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
123
123
|
</collection-browser>`);
|
|
124
124
|
el.searchContext = 'search-service';
|
|
125
125
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -166,7 +166,7 @@ describe('Collection Browser', () => {
|
|
|
166
166
|
collection: {},
|
|
167
167
|
year: {},
|
|
168
168
|
};
|
|
169
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
169
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
170
170
|
</collection-browser>`);
|
|
171
171
|
el.searchContext = 'beta-search-service';
|
|
172
172
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -204,7 +204,7 @@ describe('Collection Browser', () => {
|
|
|
204
204
|
it('should render with a sort bar, facets, and infinite scroller', async () => {
|
|
205
205
|
var _a, _b, _c;
|
|
206
206
|
const searchService = new MockSearchService();
|
|
207
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
207
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
208
208
|
</collection-browser>`);
|
|
209
209
|
el.baseQuery = 'hello';
|
|
210
210
|
await el.updateComplete;
|
|
@@ -219,7 +219,7 @@ describe('Collection Browser', () => {
|
|
|
219
219
|
it('queries the search service when given a base query', async () => {
|
|
220
220
|
var _a, _b, _c;
|
|
221
221
|
const searchService = new MockSearchService();
|
|
222
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
222
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
223
223
|
</collection-browser>`);
|
|
224
224
|
el.baseQuery = 'collection:foo';
|
|
225
225
|
await el.updateComplete;
|
|
@@ -230,7 +230,7 @@ describe('Collection Browser', () => {
|
|
|
230
230
|
it('queries the search service with a metadata search', async () => {
|
|
231
231
|
var _a, _b, _c;
|
|
232
232
|
const searchService = new MockSearchService();
|
|
233
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
233
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
234
234
|
</collection-browser>`);
|
|
235
235
|
el.searchType = SearchType.METADATA;
|
|
236
236
|
await el.updateComplete;
|
|
@@ -243,7 +243,7 @@ describe('Collection Browser', () => {
|
|
|
243
243
|
});
|
|
244
244
|
it('can change search type', async () => {
|
|
245
245
|
const searchService = new MockSearchService();
|
|
246
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
246
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
247
247
|
</collection-browser>`);
|
|
248
248
|
el.baseQuery = 'collection:foo';
|
|
249
249
|
await el.updateComplete;
|
|
@@ -255,7 +255,7 @@ describe('Collection Browser', () => {
|
|
|
255
255
|
it('queries the search service with a fulltext search', async () => {
|
|
256
256
|
var _a, _b, _c;
|
|
257
257
|
const searchService = new MockSearchService();
|
|
258
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
258
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
259
259
|
</collection-browser>`);
|
|
260
260
|
el.searchType = SearchType.FULLTEXT;
|
|
261
261
|
await el.updateComplete;
|
|
@@ -269,7 +269,7 @@ describe('Collection Browser', () => {
|
|
|
269
269
|
it('queries the search service with a radio search', async () => {
|
|
270
270
|
var _a, _b, _c;
|
|
271
271
|
const searchService = new MockSearchService();
|
|
272
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
272
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
273
273
|
</collection-browser>`);
|
|
274
274
|
el.searchType = SearchType.RADIO;
|
|
275
275
|
await el.updateComplete;
|
|
@@ -283,7 +283,7 @@ describe('Collection Browser', () => {
|
|
|
283
283
|
it('queries the search service with a TV search', async () => {
|
|
284
284
|
var _a, _b, _c;
|
|
285
285
|
const searchService = new MockSearchService();
|
|
286
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
286
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
287
287
|
</collection-browser>`);
|
|
288
288
|
el.searchType = SearchType.TV;
|
|
289
289
|
await el.updateComplete;
|
|
@@ -323,7 +323,7 @@ describe('Collection Browser', () => {
|
|
|
323
323
|
collection: {},
|
|
324
324
|
year: {},
|
|
325
325
|
};
|
|
326
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
326
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
327
327
|
</collection-browser>`);
|
|
328
328
|
el.baseQuery = 'collection:foo';
|
|
329
329
|
el.selectedFacets = selectedFacets;
|
|
@@ -356,7 +356,7 @@ describe('Collection Browser', () => {
|
|
|
356
356
|
url.searchParams.append('sin', 'TXT');
|
|
357
357
|
window.history.replaceState({}, '', url);
|
|
358
358
|
const searchService = new MockSearchService();
|
|
359
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
359
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
360
360
|
</collection-browser>`);
|
|
361
361
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
362
362
|
});
|
|
@@ -366,10 +366,10 @@ describe('Collection Browser', () => {
|
|
|
366
366
|
url.searchParams.append('sin', 'TXT');
|
|
367
367
|
window.history.replaceState({}, '', url);
|
|
368
368
|
const searchService = new MockSearchService();
|
|
369
|
-
const el = await fixture(html `<collection-browser
|
|
370
|
-
.searchService=${searchService}
|
|
371
|
-
suppressURLSinParam
|
|
372
|
-
>
|
|
369
|
+
const el = await fixture(html `<collection-browser
|
|
370
|
+
.searchService=${searchService}
|
|
371
|
+
suppressURLSinParam
|
|
372
|
+
>
|
|
373
373
|
</collection-browser>`);
|
|
374
374
|
url = new URL(window.location.href);
|
|
375
375
|
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
@@ -381,7 +381,7 @@ describe('Collection Browser', () => {
|
|
|
381
381
|
});
|
|
382
382
|
it('can construct tile models with many fields present', async () => {
|
|
383
383
|
const searchService = new MockSearchService();
|
|
384
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
384
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
385
385
|
</collection-browser>`);
|
|
386
386
|
el.baseQuery = 'many-fields';
|
|
387
387
|
await el.updateComplete;
|
|
@@ -394,10 +394,10 @@ describe('Collection Browser', () => {
|
|
|
394
394
|
it('emits empty results event when search fetches no results', async () => {
|
|
395
395
|
const searchService = new MockSearchService();
|
|
396
396
|
const emptyResultsSpy = sinon.spy();
|
|
397
|
-
const el = await fixture(html `<collection-browser
|
|
398
|
-
.searchService=${searchService}
|
|
399
|
-
@emptyResults=${emptyResultsSpy}
|
|
400
|
-
>
|
|
397
|
+
const el = await fixture(html `<collection-browser
|
|
398
|
+
.searchService=${searchService}
|
|
399
|
+
@emptyResults=${emptyResultsSpy}
|
|
400
|
+
>
|
|
401
401
|
</collection-browser>`);
|
|
402
402
|
el.baseQuery = 'no-results';
|
|
403
403
|
await el.updateComplete;
|
|
@@ -407,7 +407,7 @@ describe('Collection Browser', () => {
|
|
|
407
407
|
it('applies loggedin flag to tile models if needed', async () => {
|
|
408
408
|
var _a;
|
|
409
409
|
const searchService = new MockSearchService();
|
|
410
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
410
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
411
411
|
</collection-browser>`);
|
|
412
412
|
el.baseQuery = 'loggedin';
|
|
413
413
|
await el.updateComplete;
|
|
@@ -421,7 +421,7 @@ describe('Collection Browser', () => {
|
|
|
421
421
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
422
422
|
var _a;
|
|
423
423
|
const searchService = new MockSearchService();
|
|
424
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
424
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
425
425
|
</collection-browser>`);
|
|
426
426
|
el.baseQuery = 'no-preview';
|
|
427
427
|
await el.updateComplete;
|
|
@@ -435,7 +435,7 @@ describe('Collection Browser', () => {
|
|
|
435
435
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
436
436
|
var _a, _b;
|
|
437
437
|
const searchService = new MockSearchService();
|
|
438
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
438
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
439
439
|
</collection-browser>`);
|
|
440
440
|
el.baseQuery = 'loggedin-no-preview';
|
|
441
441
|
await el.updateComplete;
|
|
@@ -450,7 +450,7 @@ describe('Collection Browser', () => {
|
|
|
450
450
|
it('joins full description array into a single string with line breaks', async () => {
|
|
451
451
|
var _a;
|
|
452
452
|
const searchService = new MockSearchService();
|
|
453
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
453
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
454
454
|
</collection-browser>`);
|
|
455
455
|
// This query receives an array description like ['line1', 'line2']
|
|
456
456
|
el.baseQuery = 'multi-line-description';
|
|
@@ -466,9 +466,9 @@ describe('Collection Browser', () => {
|
|
|
466
466
|
it('can change search type', async () => {
|
|
467
467
|
var _a;
|
|
468
468
|
const searchService = new MockSearchService();
|
|
469
|
-
const el = await fixture(html `<collection-browser
|
|
470
|
-
.searchService=${searchService}
|
|
471
|
-
.searchType=${SearchType.METADATA}
|
|
469
|
+
const el = await fixture(html `<collection-browser
|
|
470
|
+
.searchService=${searchService}
|
|
471
|
+
.searchType=${SearchType.METADATA}
|
|
472
472
|
></collection-browser>`);
|
|
473
473
|
el.baseQuery = 'collection:foo';
|
|
474
474
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -480,8 +480,8 @@ describe('Collection Browser', () => {
|
|
|
480
480
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
481
481
|
var _a;
|
|
482
482
|
const searchService = new MockSearchService();
|
|
483
|
-
const el = await fixture(html `<collection-browser
|
|
484
|
-
.searchService=${searchService}
|
|
483
|
+
const el = await fixture(html `<collection-browser
|
|
484
|
+
.searchService=${searchService}
|
|
485
485
|
></collection-browser>`);
|
|
486
486
|
el.baseQuery = ' collection:foo ';
|
|
487
487
|
await el.updateComplete;
|
|
@@ -491,8 +491,8 @@ describe('Collection Browser', () => {
|
|
|
491
491
|
it('shows error message when error response received', async () => {
|
|
492
492
|
var _a, _b;
|
|
493
493
|
const searchService = new MockSearchService();
|
|
494
|
-
const el = await fixture(html `<collection-browser
|
|
495
|
-
.searchService=${searchService}
|
|
494
|
+
const el = await fixture(html `<collection-browser
|
|
495
|
+
.searchService=${searchService}
|
|
496
496
|
></collection-browser>`);
|
|
497
497
|
el.baseQuery = 'error';
|
|
498
498
|
await el.updateComplete;
|
|
@@ -505,8 +505,8 @@ describe('Collection Browser', () => {
|
|
|
505
505
|
it('shows error message when error response received for a collection', async () => {
|
|
506
506
|
var _a, _b;
|
|
507
507
|
const searchService = new MockSearchService();
|
|
508
|
-
const el = await fixture(html `<collection-browser
|
|
509
|
-
.searchService=${searchService}
|
|
508
|
+
const el = await fixture(html `<collection-browser
|
|
509
|
+
.searchService=${searchService}
|
|
510
510
|
></collection-browser>`);
|
|
511
511
|
el.withinCollection = 'error';
|
|
512
512
|
await el.updateComplete;
|
|
@@ -521,8 +521,8 @@ describe('Collection Browser', () => {
|
|
|
521
521
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
522
522
|
window.Sentry = { captureMessage: sentrySpy };
|
|
523
523
|
const searchService = new MockSearchService();
|
|
524
|
-
const el = await fixture(html `<collection-browser
|
|
525
|
-
.searchService=${searchService}
|
|
524
|
+
const el = await fixture(html `<collection-browser
|
|
525
|
+
.searchService=${searchService}
|
|
526
526
|
></collection-browser>`);
|
|
527
527
|
el.baseQuery = 'malformed';
|
|
528
528
|
await el.updateComplete;
|
|
@@ -531,7 +531,7 @@ describe('Collection Browser', () => {
|
|
|
531
531
|
});
|
|
532
532
|
it('adds collection names to cache when present on response', async () => {
|
|
533
533
|
const searchService = new MockSearchService();
|
|
534
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
534
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
535
535
|
</collection-browser>`);
|
|
536
536
|
el.baseQuery = 'collection-titles';
|
|
537
537
|
await el.updateComplete;
|
|
@@ -543,7 +543,7 @@ describe('Collection Browser', () => {
|
|
|
543
543
|
});
|
|
544
544
|
it('adds tv channel aliases to cache when present on response', async () => {
|
|
545
545
|
const searchService = new MockSearchService();
|
|
546
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
546
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
547
547
|
</collection-browser>`);
|
|
548
548
|
el.baseQuery = 'channel-aliases';
|
|
549
549
|
await el.updateComplete;
|
|
@@ -557,7 +557,7 @@ describe('Collection Browser', () => {
|
|
|
557
557
|
asyncResponse: true,
|
|
558
558
|
resultsSpy,
|
|
559
559
|
});
|
|
560
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
560
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
561
561
|
</collection-browser>`);
|
|
562
562
|
el.baseQuery = 'with-sort';
|
|
563
563
|
el.selectedSort = SortField.date;
|
|
@@ -574,7 +574,7 @@ describe('Collection Browser', () => {
|
|
|
574
574
|
asyncResponse: true,
|
|
575
575
|
resultsSpy,
|
|
576
576
|
});
|
|
577
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
577
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
578
578
|
</collection-browser>`);
|
|
579
579
|
el.baseQuery = 'with-sort';
|
|
580
580
|
el.selectedSort = SortField.date;
|
|
@@ -596,7 +596,7 @@ describe('Collection Browser', () => {
|
|
|
596
596
|
asyncResponse: true,
|
|
597
597
|
resultsSpy,
|
|
598
598
|
});
|
|
599
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
599
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
600
600
|
</collection-browser>`);
|
|
601
601
|
el.baseQuery = 'single-result';
|
|
602
602
|
await el.updateComplete;
|
|
@@ -617,7 +617,7 @@ describe('Collection Browser', () => {
|
|
|
617
617
|
asyncResponse: true,
|
|
618
618
|
resultsSpy,
|
|
619
619
|
});
|
|
620
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
620
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
621
621
|
</collection-browser>`);
|
|
622
622
|
el.baseQuery = 'with-sort';
|
|
623
623
|
el.selectedSort = SortField.date;
|
|
@@ -636,7 +636,7 @@ describe('Collection Browser', () => {
|
|
|
636
636
|
it('sets sort properties when user changes sort', async () => {
|
|
637
637
|
var _a, _b, _c, _d, _e, _f;
|
|
638
638
|
const searchService = new MockSearchService();
|
|
639
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
639
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
640
640
|
</collection-browser>`);
|
|
641
641
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
642
642
|
el.baseQuery = 'foo';
|
|
@@ -659,7 +659,7 @@ describe('Collection Browser', () => {
|
|
|
659
659
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
660
660
|
var _a, _b, _c, _d;
|
|
661
661
|
const searchService = new MockSearchService();
|
|
662
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
662
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
663
663
|
</collection-browser>`);
|
|
664
664
|
el.baseQuery = 'first-title';
|
|
665
665
|
el.selectedSort = 'title';
|
|
@@ -673,7 +673,7 @@ describe('Collection Browser', () => {
|
|
|
673
673
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
674
674
|
var _a, _b, _c, _d;
|
|
675
675
|
const searchService = new MockSearchService();
|
|
676
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
676
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
677
677
|
</collection-browser>`);
|
|
678
678
|
el.baseQuery = 'first-creator';
|
|
679
679
|
el.selectedSort = 'creator';
|
|
@@ -696,7 +696,7 @@ describe('Collection Browser', () => {
|
|
|
696
696
|
subject: {},
|
|
697
697
|
year: {},
|
|
698
698
|
};
|
|
699
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
699
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
700
700
|
</collection-browser>`);
|
|
701
701
|
el.baseQuery = 'first-creator';
|
|
702
702
|
el.selectedSort = 'creator';
|
|
@@ -724,7 +724,7 @@ describe('Collection Browser', () => {
|
|
|
724
724
|
it('applies correct search filter when TV clip filter set to commercials', async () => {
|
|
725
725
|
var _a, _b, _c;
|
|
726
726
|
const searchService = new MockSearchService();
|
|
727
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
727
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
728
728
|
</collection-browser>`);
|
|
729
729
|
el.baseQuery = 'tv-fields';
|
|
730
730
|
el.searchType = SearchType.TV;
|
|
@@ -736,7 +736,7 @@ describe('Collection Browser', () => {
|
|
|
736
736
|
it('applies correct search filter when TV clip filter set to factchecks', async () => {
|
|
737
737
|
var _a, _b, _c;
|
|
738
738
|
const searchService = new MockSearchService();
|
|
739
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
739
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
740
740
|
</collection-browser>`);
|
|
741
741
|
el.baseQuery = 'tv-fields';
|
|
742
742
|
el.searchType = SearchType.TV;
|
|
@@ -748,7 +748,7 @@ describe('Collection Browser', () => {
|
|
|
748
748
|
it('applies correct search filter when TV clip filter set to quotes', async () => {
|
|
749
749
|
var _a, _b, _c;
|
|
750
750
|
const searchService = new MockSearchService();
|
|
751
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
751
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
752
752
|
</collection-browser>`);
|
|
753
753
|
el.baseQuery = 'tv-fields';
|
|
754
754
|
el.searchType = SearchType.TV;
|
|
@@ -760,7 +760,7 @@ describe('Collection Browser', () => {
|
|
|
760
760
|
it('resets letter filters when query changes', async () => {
|
|
761
761
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
762
762
|
const searchService = new MockSearchService();
|
|
763
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
763
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
764
764
|
</collection-browser>`);
|
|
765
765
|
el.baseQuery = 'first-creator';
|
|
766
766
|
el.selectedSort = 'creator';
|
|
@@ -781,11 +781,11 @@ describe('Collection Browser', () => {
|
|
|
781
781
|
var _a, _b, _c;
|
|
782
782
|
const searchService = new MockSearchService();
|
|
783
783
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
784
|
-
const el = await fixture(html `<collection-browser
|
|
785
|
-
.searchService=${searchService}
|
|
786
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
787
|
-
.suppressPlaceholders=${true}
|
|
788
|
-
>
|
|
784
|
+
const el = await fixture(html `<collection-browser
|
|
785
|
+
.searchService=${searchService}
|
|
786
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
787
|
+
.suppressPlaceholders=${true}
|
|
788
|
+
>
|
|
789
789
|
</collection-browser>`);
|
|
790
790
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
791
791
|
el.showHistogramDatePicker = true;
|
|
@@ -814,10 +814,10 @@ describe('Collection Browser', () => {
|
|
|
814
814
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
815
815
|
var _a, _b, _c;
|
|
816
816
|
const searchService = new MockSearchService();
|
|
817
|
-
const el = await fixture(html `<collection-browser
|
|
818
|
-
.searchService=${searchService}
|
|
819
|
-
.suppressPlaceholders=${true}
|
|
820
|
-
>
|
|
817
|
+
const el = await fixture(html `<collection-browser
|
|
818
|
+
.searchService=${searchService}
|
|
819
|
+
.suppressPlaceholders=${true}
|
|
820
|
+
>
|
|
821
821
|
</collection-browser>`);
|
|
822
822
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
823
823
|
el.searchType = SearchType.TV;
|
|
@@ -848,9 +848,9 @@ describe('Collection Browser', () => {
|
|
|
848
848
|
var _a, _b, _c, _d;
|
|
849
849
|
const spy = sinon.spy();
|
|
850
850
|
const searchService = new MockSearchService();
|
|
851
|
-
const el = await fixture(html `<collection-browser
|
|
852
|
-
.searchService=${searchService}
|
|
853
|
-
@searchResultsLoadingChanged=${spy}
|
|
851
|
+
const el = await fixture(html `<collection-browser
|
|
852
|
+
.searchService=${searchService}
|
|
853
|
+
@searchResultsLoadingChanged=${spy}
|
|
854
854
|
></collection-browser>`);
|
|
855
855
|
spy.resetHistory();
|
|
856
856
|
el.baseQuery = 'collection:foo';
|
|
@@ -864,9 +864,9 @@ describe('Collection Browser', () => {
|
|
|
864
864
|
it('collapses extra set of quotes around href field', async () => {
|
|
865
865
|
var _a;
|
|
866
866
|
const searchService = new MockSearchService();
|
|
867
|
-
const el = await fixture(html `<collection-browser
|
|
868
|
-
.searchService=${searchService}
|
|
869
|
-
.baseNavigationUrl=${''}
|
|
867
|
+
const el = await fixture(html `<collection-browser
|
|
868
|
+
.searchService=${searchService}
|
|
869
|
+
.baseNavigationUrl=${''}
|
|
870
870
|
></collection-browser>`);
|
|
871
871
|
el.baseQuery = 'extra-quoted-href';
|
|
872
872
|
await el.updateComplete;
|
|
@@ -879,9 +879,9 @@ describe('Collection Browser', () => {
|
|
|
879
879
|
it('sets default sort from collection metadata', async () => {
|
|
880
880
|
var _a;
|
|
881
881
|
const searchService = new MockSearchService();
|
|
882
|
-
const el = await fixture(html `<collection-browser
|
|
883
|
-
.searchService=${searchService}
|
|
884
|
-
.baseNavigationUrl=${''}
|
|
882
|
+
const el = await fixture(html `<collection-browser
|
|
883
|
+
.searchService=${searchService}
|
|
884
|
+
.baseNavigationUrl=${''}
|
|
885
885
|
></collection-browser>`);
|
|
886
886
|
el.withinCollection = 'default-sort';
|
|
887
887
|
await el.updateComplete;
|
|
@@ -898,9 +898,9 @@ describe('Collection Browser', () => {
|
|
|
898
898
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
899
899
|
var _a;
|
|
900
900
|
const searchService = new MockSearchService();
|
|
901
|
-
const el = await fixture(html `<collection-browser
|
|
902
|
-
.searchService=${searchService}
|
|
903
|
-
.baseNavigationUrl=${''}
|
|
901
|
+
const el = await fixture(html `<collection-browser
|
|
902
|
+
.searchService=${searchService}
|
|
903
|
+
.baseNavigationUrl=${''}
|
|
904
904
|
></collection-browser>`);
|
|
905
905
|
el.withinCollection = 'default-sort-concise';
|
|
906
906
|
await el.updateComplete;
|
|
@@ -915,8 +915,8 @@ describe('Collection Browser', () => {
|
|
|
915
915
|
expect(sortBar.sortDirection).to.be.null;
|
|
916
916
|
});
|
|
917
917
|
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'}
|
|
918
|
+
const el = await fixture(html `<collection-browser
|
|
919
|
+
.withinProfile=${'@foobar'}
|
|
920
920
|
></collection-browser>`);
|
|
921
921
|
el.applyDefaultProfileSort();
|
|
922
922
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -927,9 +927,9 @@ describe('Collection Browser', () => {
|
|
|
927
927
|
it('uses relevance sort as default when a query is set', async () => {
|
|
928
928
|
var _a;
|
|
929
929
|
const searchService = new MockSearchService();
|
|
930
|
-
const el = await fixture(html `<collection-browser
|
|
931
|
-
.searchService=${searchService}
|
|
932
|
-
.baseNavigationUrl=${''}
|
|
930
|
+
const el = await fixture(html `<collection-browser
|
|
931
|
+
.searchService=${searchService}
|
|
932
|
+
.baseNavigationUrl=${''}
|
|
933
933
|
></collection-browser>`);
|
|
934
934
|
el.withinCollection = 'default-sort';
|
|
935
935
|
el.baseQuery = 'default-sort';
|
|
@@ -947,9 +947,9 @@ describe('Collection Browser', () => {
|
|
|
947
947
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
948
948
|
var _a;
|
|
949
949
|
const searchService = new MockSearchService();
|
|
950
|
-
const el = await fixture(html `<collection-browser
|
|
951
|
-
.searchService=${searchService}
|
|
952
|
-
.baseNavigationUrl=${''}
|
|
950
|
+
const el = await fixture(html `<collection-browser
|
|
951
|
+
.searchService=${searchService}
|
|
952
|
+
.baseNavigationUrl=${''}
|
|
953
953
|
></collection-browser>`);
|
|
954
954
|
el.withinCollection = 'fav-sort';
|
|
955
955
|
await el.updateComplete;
|
|
@@ -966,7 +966,7 @@ describe('Collection Browser', () => {
|
|
|
966
966
|
it('scrolls to page', async () => {
|
|
967
967
|
var _a;
|
|
968
968
|
const searchService = new MockSearchService();
|
|
969
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
969
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
970
970
|
</collection-browser>`);
|
|
971
971
|
// Infinite scroller won't exist unless there's a base query.
|
|
972
972
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -988,9 +988,9 @@ describe('Collection Browser', () => {
|
|
|
988
988
|
it('shows mobile facets in mobile view', async () => {
|
|
989
989
|
var _a, _b;
|
|
990
990
|
const searchService = new MockSearchService();
|
|
991
|
-
const el = await fixture(html `<collection-browser
|
|
992
|
-
.searchService=${searchService}
|
|
993
|
-
.mobileBreakpoint=${9999}
|
|
991
|
+
const el = await fixture(html `<collection-browser
|
|
992
|
+
.searchService=${searchService}
|
|
993
|
+
.mobileBreakpoint=${9999}
|
|
994
994
|
></collection-browser>`);
|
|
995
995
|
el.baseQuery = 'collection:foo';
|
|
996
996
|
await el.updateComplete;
|
|
@@ -1010,11 +1010,11 @@ describe('Collection Browser', () => {
|
|
|
1010
1010
|
var _a, _b;
|
|
1011
1011
|
const searchService = new MockSearchService();
|
|
1012
1012
|
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}
|
|
1013
|
+
const el = await fixture(html `<collection-browser
|
|
1014
|
+
.searchService=${searchService}
|
|
1015
|
+
.analyticsHandler=${analyticsHandler}
|
|
1016
|
+
.searchContext=${'foobar-context'}
|
|
1017
|
+
.mobileBreakpoint=${9999}
|
|
1018
1018
|
></collection-browser>`);
|
|
1019
1019
|
el.baseQuery = 'collection:foo';
|
|
1020
1020
|
await el.updateComplete;
|
|
@@ -1054,9 +1054,9 @@ describe('Collection Browser', () => {
|
|
|
1054
1054
|
});
|
|
1055
1055
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1056
1056
|
const searchService = new MockSearchService();
|
|
1057
|
-
const el = await fixture(html `<collection-browser
|
|
1058
|
-
.searchService=${searchService}
|
|
1059
|
-
.withinCollection=${'fake'}
|
|
1057
|
+
const el = await fixture(html `<collection-browser
|
|
1058
|
+
.searchService=${searchService}
|
|
1059
|
+
.withinCollection=${'fake'}
|
|
1060
1060
|
></collection-browser>`);
|
|
1061
1061
|
el.baseQuery = 'parent-collections';
|
|
1062
1062
|
await el.updateComplete;
|
|
@@ -1066,9 +1066,9 @@ describe('Collection Browser', () => {
|
|
|
1066
1066
|
});
|
|
1067
1067
|
it('recognizes TV collections', async () => {
|
|
1068
1068
|
const searchService = new MockSearchService();
|
|
1069
|
-
const el = await fixture(html `<collection-browser
|
|
1070
|
-
.searchService=${searchService}
|
|
1071
|
-
.withinCollection=${'TV-FOO'}
|
|
1069
|
+
const el = await fixture(html `<collection-browser
|
|
1070
|
+
.searchService=${searchService}
|
|
1071
|
+
.withinCollection=${'TV-FOO'}
|
|
1072
1072
|
></collection-browser>`);
|
|
1073
1073
|
el.baseQuery = 'tv-collection';
|
|
1074
1074
|
await el.updateComplete;
|
|
@@ -1080,9 +1080,9 @@ describe('Collection Browser', () => {
|
|
|
1080
1080
|
var _a;
|
|
1081
1081
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1082
1082
|
const searchService = new MockSearchService();
|
|
1083
|
-
const el = await fixture(html `<collection-browser
|
|
1084
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1085
|
-
.searchService=${searchService}
|
|
1083
|
+
const el = await fixture(html `<collection-browser
|
|
1084
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1085
|
+
.searchService=${searchService}
|
|
1086
1086
|
></collection-browser>`);
|
|
1087
1087
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1088
1088
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1128,7 +1128,7 @@ describe('Collection Browser', () => {
|
|
|
1128
1128
|
it('query the search service for single result', async () => {
|
|
1129
1129
|
var _a, _b;
|
|
1130
1130
|
const searchService = new MockSearchService();
|
|
1131
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1131
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1132
1132
|
</collection-browser>`);
|
|
1133
1133
|
el.baseQuery = 'single-result';
|
|
1134
1134
|
await el.updateComplete;
|
|
@@ -1157,7 +1157,7 @@ describe('Collection Browser', () => {
|
|
|
1157
1157
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1158
1158
|
window.history.replaceState({}, '', url);
|
|
1159
1159
|
const searchService = new MockSearchService();
|
|
1160
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1160
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1161
1161
|
</collection-browser>`);
|
|
1162
1162
|
await el.initialSearchComplete;
|
|
1163
1163
|
await el.updateComplete;
|
|
@@ -1183,10 +1183,10 @@ describe('Collection Browser', () => {
|
|
|
1183
1183
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1184
1184
|
window.history.replaceState({}, '', url);
|
|
1185
1185
|
const searchService = new MockSearchService();
|
|
1186
|
-
const el = await fixture(html `<collection-browser
|
|
1187
|
-
.searchService=${searchService}
|
|
1188
|
-
.withinCollection=${'foobar'}
|
|
1189
|
-
>
|
|
1186
|
+
const el = await fixture(html `<collection-browser
|
|
1187
|
+
.searchService=${searchService}
|
|
1188
|
+
.withinCollection=${'foobar'}
|
|
1189
|
+
>
|
|
1190
1190
|
</collection-browser>`);
|
|
1191
1191
|
await el.initialSearchComplete;
|
|
1192
1192
|
await el.updateComplete;
|
|
@@ -1211,11 +1211,11 @@ describe('Collection Browser', () => {
|
|
|
1211
1211
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1212
1212
|
window.history.replaceState({}, '', url);
|
|
1213
1213
|
const searchService = new MockSearchService();
|
|
1214
|
-
const el = await fixture(html `<collection-browser
|
|
1215
|
-
.searchService=${searchService}
|
|
1216
|
-
.withinProfile=${'@foobar'}
|
|
1217
|
-
.profileElement=${'uploads'}
|
|
1218
|
-
>
|
|
1214
|
+
const el = await fixture(html `<collection-browser
|
|
1215
|
+
.searchService=${searchService}
|
|
1216
|
+
.withinProfile=${'@foobar'}
|
|
1217
|
+
.profileElement=${'uploads'}
|
|
1218
|
+
>
|
|
1219
1219
|
</collection-browser>`);
|
|
1220
1220
|
await el.initialSearchComplete;
|
|
1221
1221
|
await el.updateComplete;
|
|
@@ -1242,7 +1242,7 @@ describe('Collection Browser', () => {
|
|
|
1242
1242
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1243
1243
|
window.history.replaceState({}, '', url);
|
|
1244
1244
|
const searchService = new MockSearchService();
|
|
1245
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1245
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1246
1246
|
</collection-browser>`);
|
|
1247
1247
|
await el.initialSearchComplete;
|
|
1248
1248
|
await el.updateComplete;
|
|
@@ -1270,10 +1270,10 @@ describe('Collection Browser', () => {
|
|
|
1270
1270
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1271
1271
|
window.history.replaceState({}, '', url);
|
|
1272
1272
|
const searchService = new MockSearchService();
|
|
1273
|
-
const el = await fixture(html `<collection-browser
|
|
1274
|
-
.searchService=${searchService}
|
|
1275
|
-
.withinCollection=${'foobar'}
|
|
1276
|
-
>
|
|
1273
|
+
const el = await fixture(html `<collection-browser
|
|
1274
|
+
.searchService=${searchService}
|
|
1275
|
+
.withinCollection=${'foobar'}
|
|
1276
|
+
>
|
|
1277
1277
|
</collection-browser>`);
|
|
1278
1278
|
el.baseQuery = 'bar';
|
|
1279
1279
|
await el.updateComplete;
|
|
@@ -1300,10 +1300,10 @@ describe('Collection Browser', () => {
|
|
|
1300
1300
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1301
1301
|
window.history.replaceState({}, '', url);
|
|
1302
1302
|
const searchService = new MockSearchService();
|
|
1303
|
-
const el = await fixture(html `<collection-browser
|
|
1304
|
-
.searchService=${searchService}
|
|
1305
|
-
.withinCollection=${'foobar'}
|
|
1306
|
-
>
|
|
1303
|
+
const el = await fixture(html `<collection-browser
|
|
1304
|
+
.searchService=${searchService}
|
|
1305
|
+
.withinCollection=${'foobar'}
|
|
1306
|
+
>
|
|
1307
1307
|
</collection-browser>`);
|
|
1308
1308
|
el.withinCollection = 'bar';
|
|
1309
1309
|
await el.updateComplete;
|
|
@@ -1320,11 +1320,11 @@ describe('Collection Browser', () => {
|
|
|
1320
1320
|
it('correctly retrieves web archive hits', async () => {
|
|
1321
1321
|
var _a, _b, _c;
|
|
1322
1322
|
const searchService = new MockSearchService();
|
|
1323
|
-
const el = await fixture(html `<collection-browser
|
|
1324
|
-
.searchService=${searchService}
|
|
1325
|
-
.withinProfile=${'@foo'}
|
|
1326
|
-
.profileElement=${'web_archives'}
|
|
1327
|
-
>
|
|
1323
|
+
const el = await fixture(html `<collection-browser
|
|
1324
|
+
.searchService=${searchService}
|
|
1325
|
+
.withinProfile=${'@foo'}
|
|
1326
|
+
.profileElement=${'web_archives'}
|
|
1327
|
+
>
|
|
1328
1328
|
</collection-browser>`);
|
|
1329
1329
|
el.baseQuery = 'web-archive';
|
|
1330
1330
|
await el.updateComplete;
|
|
@@ -1338,10 +1338,10 @@ describe('Collection Browser', () => {
|
|
|
1338
1338
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1339
1339
|
var _a;
|
|
1340
1340
|
const searchService = new MockSearchService();
|
|
1341
|
-
const el = await fixture(html `<collection-browser
|
|
1342
|
-
.searchService=${searchService}
|
|
1343
|
-
facetLoadStrategy=${'opt-in'}
|
|
1344
|
-
>
|
|
1341
|
+
const el = await fixture(html `<collection-browser
|
|
1342
|
+
.searchService=${searchService}
|
|
1343
|
+
facetLoadStrategy=${'opt-in'}
|
|
1344
|
+
>
|
|
1345
1345
|
</collection-browser>`);
|
|
1346
1346
|
el.baseQuery = 'foo';
|
|
1347
1347
|
await el.updateComplete;
|
|
@@ -1352,10 +1352,10 @@ describe('Collection Browser', () => {
|
|
|
1352
1352
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1353
1353
|
var _a, _b;
|
|
1354
1354
|
const searchService = new MockSearchService();
|
|
1355
|
-
const el = await fixture(html `<collection-browser
|
|
1356
|
-
.searchService=${searchService}
|
|
1357
|
-
facetLoadStrategy=${'off'}
|
|
1358
|
-
>
|
|
1355
|
+
const el = await fixture(html `<collection-browser
|
|
1356
|
+
.searchService=${searchService}
|
|
1357
|
+
facetLoadStrategy=${'off'}
|
|
1358
|
+
>
|
|
1359
1359
|
</collection-browser>`);
|
|
1360
1360
|
el.baseQuery = 'foo';
|
|
1361
1361
|
await el.updateComplete;
|
|
@@ -1367,7 +1367,7 @@ describe('Collection Browser', () => {
|
|
|
1367
1367
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1368
1368
|
var _a, _b, _c, _d;
|
|
1369
1369
|
const searchService = new MockSearchService();
|
|
1370
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1370
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1371
1371
|
</collection-browser>`);
|
|
1372
1372
|
el.baseQuery = 'foo';
|
|
1373
1373
|
await el.updateComplete;
|
|
@@ -1383,11 +1383,11 @@ describe('Collection Browser', () => {
|
|
|
1383
1383
|
});
|
|
1384
1384
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1385
1385
|
const searchService = new MockSearchService();
|
|
1386
|
-
const el = await fixture(html `<collection-browser
|
|
1387
|
-
.searchService=${searchService}
|
|
1388
|
-
.baseQuery=${'foo'}
|
|
1389
|
-
.displayMode=${'list-detail'}
|
|
1390
|
-
>
|
|
1386
|
+
const el = await fixture(html `<collection-browser
|
|
1387
|
+
.searchService=${searchService}
|
|
1388
|
+
.baseQuery=${'foo'}
|
|
1389
|
+
.displayMode=${'list-detail'}
|
|
1390
|
+
>
|
|
1391
1391
|
</collection-browser>`);
|
|
1392
1392
|
el.isManageView = true;
|
|
1393
1393
|
await el.updateComplete;
|
|
@@ -1396,10 +1396,10 @@ describe('Collection Browser', () => {
|
|
|
1396
1396
|
it('can remove all checked tiles', async () => {
|
|
1397
1397
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1398
1398
|
const searchService = new MockSearchService();
|
|
1399
|
-
const el = await fixture(html `<collection-browser
|
|
1400
|
-
.searchService=${searchService}
|
|
1401
|
-
.baseNavigationUrl=${''}
|
|
1402
|
-
>
|
|
1399
|
+
const el = await fixture(html `<collection-browser
|
|
1400
|
+
.searchService=${searchService}
|
|
1401
|
+
.baseNavigationUrl=${''}
|
|
1402
|
+
>
|
|
1403
1403
|
</collection-browser>`);
|
|
1404
1404
|
el.baseQuery = 'foo';
|
|
1405
1405
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1435,10 +1435,10 @@ describe('Collection Browser', () => {
|
|
|
1435
1435
|
});
|
|
1436
1436
|
it('can check/uncheck all tiles', async () => {
|
|
1437
1437
|
const searchService = new MockSearchService();
|
|
1438
|
-
const el = await fixture(html `<collection-browser
|
|
1439
|
-
.searchService=${searchService}
|
|
1440
|
-
.baseNavigationUrl=${''}
|
|
1441
|
-
>
|
|
1438
|
+
const el = await fixture(html `<collection-browser
|
|
1439
|
+
.searchService=${searchService}
|
|
1440
|
+
.baseNavigationUrl=${''}
|
|
1441
|
+
>
|
|
1442
1442
|
</collection-browser>`);
|
|
1443
1443
|
el.baseQuery = 'foo';
|
|
1444
1444
|
await el.updateComplete;
|
|
@@ -1458,10 +1458,10 @@ describe('Collection Browser', () => {
|
|
|
1458
1458
|
var _a, _b;
|
|
1459
1459
|
const spy = sinon.spy();
|
|
1460
1460
|
const searchService = new MockSearchService();
|
|
1461
|
-
const el = await fixture(html `<collection-browser
|
|
1462
|
-
.searchService=${searchService}
|
|
1463
|
-
.baseNavigationUrl=${''}
|
|
1464
|
-
@manageModeChanged=${spy}
|
|
1461
|
+
const el = await fixture(html `<collection-browser
|
|
1462
|
+
.searchService=${searchService}
|
|
1463
|
+
.baseNavigationUrl=${''}
|
|
1464
|
+
@manageModeChanged=${spy}
|
|
1465
1465
|
></collection-browser>`);
|
|
1466
1466
|
el.isManageView = true;
|
|
1467
1467
|
await el.updateComplete;
|
|
@@ -1476,11 +1476,11 @@ describe('Collection Browser', () => {
|
|
|
1476
1476
|
var _a, _b, _c, _d, _e;
|
|
1477
1477
|
const spy = sinon.spy();
|
|
1478
1478
|
const searchService = new MockSearchService();
|
|
1479
|
-
const el = await fixture(html `<collection-browser
|
|
1480
|
-
.searchService=${searchService}
|
|
1481
|
-
.baseNavigationUrl=${''}
|
|
1482
|
-
@itemRemovalRequested=${spy}
|
|
1483
|
-
>
|
|
1479
|
+
const el = await fixture(html `<collection-browser
|
|
1480
|
+
.searchService=${searchService}
|
|
1481
|
+
.baseNavigationUrl=${''}
|
|
1482
|
+
@itemRemovalRequested=${spy}
|
|
1483
|
+
>
|
|
1484
1484
|
</collection-browser>`);
|
|
1485
1485
|
el.baseQuery = 'foo';
|
|
1486
1486
|
await el.updateComplete;
|
|
@@ -1510,10 +1510,10 @@ describe('Collection Browser', () => {
|
|
|
1510
1510
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1511
1511
|
var _a;
|
|
1512
1512
|
const searchService = new MockSearchService();
|
|
1513
|
-
const el = await fixture(html `<collection-browser
|
|
1514
|
-
.searchService=${searchService}
|
|
1515
|
-
.baseNavigationUrl=${''}
|
|
1516
|
-
>
|
|
1513
|
+
const el = await fixture(html `<collection-browser
|
|
1514
|
+
.searchService=${searchService}
|
|
1515
|
+
.baseNavigationUrl=${''}
|
|
1516
|
+
>
|
|
1517
1517
|
</collection-browser>`);
|
|
1518
1518
|
el.baseQuery = 'foo';
|
|
1519
1519
|
await el.updateComplete;
|
|
@@ -1530,7 +1530,7 @@ describe('Collection Browser', () => {
|
|
|
1530
1530
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1531
1531
|
var _a, _b, _c, _d;
|
|
1532
1532
|
const searchService = new MockSearchService();
|
|
1533
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1533
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1534
1534
|
</collection-browser>`);
|
|
1535
1535
|
el.baseQuery = 'foo';
|
|
1536
1536
|
await el.updateComplete;
|
|
@@ -1558,10 +1558,10 @@ describe('Collection Browser', () => {
|
|
|
1558
1558
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1559
1559
|
var _a;
|
|
1560
1560
|
const searchService = new MockSearchService();
|
|
1561
|
-
const el = await fixture(html `<collection-browser
|
|
1562
|
-
.baseNavigationUrl=${''}
|
|
1563
|
-
.searchService=${searchService}
|
|
1564
|
-
>
|
|
1561
|
+
const el = await fixture(html `<collection-browser
|
|
1562
|
+
.baseNavigationUrl=${''}
|
|
1563
|
+
.searchService=${searchService}
|
|
1564
|
+
>
|
|
1565
1565
|
</collection-browser>`);
|
|
1566
1566
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1567
1567
|
await el.updateComplete;
|
|
@@ -1573,10 +1573,10 @@ describe('Collection Browser', () => {
|
|
|
1573
1573
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1574
1574
|
var _a;
|
|
1575
1575
|
const searchService = new MockSearchService();
|
|
1576
|
-
const el = await fixture(html `<collection-browser
|
|
1577
|
-
.baseNavigationUrl=${''}
|
|
1578
|
-
.searchService=${searchService}
|
|
1579
|
-
>
|
|
1576
|
+
const el = await fixture(html `<collection-browser
|
|
1577
|
+
.baseNavigationUrl=${''}
|
|
1578
|
+
.searchService=${searchService}
|
|
1579
|
+
>
|
|
1580
1580
|
</collection-browser>`);
|
|
1581
1581
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1582
1582
|
await el.updateComplete;
|
|
@@ -1588,10 +1588,10 @@ describe('Collection Browser', () => {
|
|
|
1588
1588
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1589
1589
|
var _a, _b, _c;
|
|
1590
1590
|
const searchService = new MockSearchService();
|
|
1591
|
-
const el = await fixture(html `<collection-browser
|
|
1592
|
-
.baseNavigationUrl=${''}
|
|
1593
|
-
.searchService=${searchService}
|
|
1594
|
-
>
|
|
1591
|
+
const el = await fixture(html `<collection-browser
|
|
1592
|
+
.baseNavigationUrl=${''}
|
|
1593
|
+
.searchService=${searchService}
|
|
1594
|
+
>
|
|
1595
1595
|
</collection-browser>`);
|
|
1596
1596
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1597
1597
|
await el.updateComplete;
|
|
@@ -1607,11 +1607,11 @@ describe('Collection Browser', () => {
|
|
|
1607
1607
|
it('applies loans tab properties to sort bar', async () => {
|
|
1608
1608
|
var _a;
|
|
1609
1609
|
const searchService = new MockSearchService();
|
|
1610
|
-
const el = await fixture(html `<collection-browser
|
|
1611
|
-
.baseNavigationUrl=${''}
|
|
1612
|
-
.searchService=${searchService}
|
|
1613
|
-
.enableSortOptionsSlot=${true}
|
|
1614
|
-
>
|
|
1610
|
+
const el = await fixture(html `<collection-browser
|
|
1611
|
+
.baseNavigationUrl=${''}
|
|
1612
|
+
.searchService=${searchService}
|
|
1613
|
+
.enableSortOptionsSlot=${true}
|
|
1614
|
+
>
|
|
1615
1615
|
</collection-browser>`);
|
|
1616
1616
|
el.baseQuery = 'collection:foo';
|
|
1617
1617
|
await el.updateComplete;
|
|
@@ -1626,9 +1626,9 @@ describe('Collection Browser', () => {
|
|
|
1626
1626
|
it('can suppress presence of result count', async () => {
|
|
1627
1627
|
var _a;
|
|
1628
1628
|
const searchService = new MockSearchService();
|
|
1629
|
-
const el = await fixture(html `<collection-browser
|
|
1630
|
-
.searchService=${searchService}
|
|
1631
|
-
suppressResultCount
|
|
1629
|
+
const el = await fixture(html `<collection-browser
|
|
1630
|
+
.searchService=${searchService}
|
|
1631
|
+
suppressResultCount
|
|
1632
1632
|
></collection-browser>`);
|
|
1633
1633
|
el.baseQuery = 'collection:foo';
|
|
1634
1634
|
await el.updateComplete;
|
|
@@ -1639,9 +1639,9 @@ describe('Collection Browser', () => {
|
|
|
1639
1639
|
it('can suppress presence of result tiles', async () => {
|
|
1640
1640
|
var _a;
|
|
1641
1641
|
const searchService = new MockSearchService();
|
|
1642
|
-
const el = await fixture(html `<collection-browser
|
|
1643
|
-
.searchService=${searchService}
|
|
1644
|
-
suppressResultTiles
|
|
1642
|
+
const el = await fixture(html `<collection-browser
|
|
1643
|
+
.searchService=${searchService}
|
|
1644
|
+
suppressResultTiles
|
|
1645
1645
|
></collection-browser>`);
|
|
1646
1646
|
el.baseQuery = 'collection:foo';
|
|
1647
1647
|
await el.updateComplete;
|
|
@@ -1654,7 +1654,7 @@ describe('Collection Browser', () => {
|
|
|
1654
1654
|
asyncResponse: true,
|
|
1655
1655
|
resultsSpy,
|
|
1656
1656
|
});
|
|
1657
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1657
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1658
1658
|
</collection-browser>`);
|
|
1659
1659
|
const numberOfPages = 15;
|
|
1660
1660
|
el.baseQuery = 'jack';
|