@internetarchive/collection-browser 3.3.0 → 3.3.1-alpha3
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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/src/collection-browser.js +683 -683
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.js +118 -118
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +266 -266
- package/dist/src/collection-facets.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/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +36 -36
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +77 -77
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +137 -137
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +99 -99
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +297 -297
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +203 -203
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/test/collection-browser.test.js +189 -189
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +77 -77
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +70 -70
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +126 -126
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +117 -117
- package/renovate.json +6 -6
- package/src/collection-browser.ts +2829 -2829
- package/src/collection-facets/more-facets-content.ts +639 -639
- package/src/collection-facets.ts +995 -995
- package/src/data-source/collection-browser-data-source.ts +1401 -1401
- package/src/data-source/collection-browser-query-state.ts +65 -65
- package/src/data-source/models.ts +43 -43
- package/src/tiles/base-tile-component.ts +65 -65
- package/src/tiles/grid/account-tile.ts +113 -113
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/list/tile-list-compact.ts +239 -239
- package/src/tiles/list/tile-list.ts +700 -700
- package/src/tiles/tile-dispatcher.ts +490 -490
- package/src/utils/format-date.ts +62 -62
- package/test/collection-browser.test.ts +2403 -2403
- package/test/tiles/grid/item-tile.test.ts +520 -520
- package/test/tiles/list/tile-list-compact.test.ts +282 -282
- package/test/tiles/list/tile-list.test.ts +552 -552
- package/test/utils/format-date.test.ts +89 -89
- package/tsconfig.json +20 -20
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -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 when given a list of identifiers and no query', 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.identifiers = ['foo', 'bar'];
|
|
236
236
|
await el.updateComplete;
|
|
@@ -244,7 +244,7 @@ describe('Collection Browser', () => {
|
|
|
244
244
|
it('queries the search service when given a list of identifiers with a query', async () => {
|
|
245
245
|
var _a, _b, _c, _d;
|
|
246
246
|
const searchService = new MockSearchService();
|
|
247
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
247
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
248
248
|
</collection-browser>`);
|
|
249
249
|
el.baseQuery = 'collection:foo';
|
|
250
250
|
el.identifiers = ['foo', 'bar'];
|
|
@@ -260,7 +260,7 @@ describe('Collection Browser', () => {
|
|
|
260
260
|
it('queries the search service with a metadata search', async () => {
|
|
261
261
|
var _a, _b, _c;
|
|
262
262
|
const searchService = new MockSearchService();
|
|
263
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
263
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
264
264
|
</collection-browser>`);
|
|
265
265
|
el.searchType = SearchType.METADATA;
|
|
266
266
|
await el.updateComplete;
|
|
@@ -273,7 +273,7 @@ describe('Collection Browser', () => {
|
|
|
273
273
|
});
|
|
274
274
|
it('can change search type', async () => {
|
|
275
275
|
const searchService = new MockSearchService();
|
|
276
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
276
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
277
277
|
</collection-browser>`);
|
|
278
278
|
el.baseQuery = 'collection:foo';
|
|
279
279
|
await el.updateComplete;
|
|
@@ -285,7 +285,7 @@ describe('Collection Browser', () => {
|
|
|
285
285
|
it('queries the search service with a fulltext search', async () => {
|
|
286
286
|
var _a, _b, _c;
|
|
287
287
|
const searchService = new MockSearchService();
|
|
288
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
288
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
289
289
|
</collection-browser>`);
|
|
290
290
|
el.searchType = SearchType.FULLTEXT;
|
|
291
291
|
await el.updateComplete;
|
|
@@ -299,7 +299,7 @@ describe('Collection Browser', () => {
|
|
|
299
299
|
it('queries the search service with a radio search', async () => {
|
|
300
300
|
var _a, _b, _c;
|
|
301
301
|
const searchService = new MockSearchService();
|
|
302
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
302
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
303
303
|
</collection-browser>`);
|
|
304
304
|
el.searchType = SearchType.RADIO;
|
|
305
305
|
await el.updateComplete;
|
|
@@ -313,7 +313,7 @@ describe('Collection Browser', () => {
|
|
|
313
313
|
it('queries the search service with a TV search', async () => {
|
|
314
314
|
var _a, _b, _c;
|
|
315
315
|
const searchService = new MockSearchService();
|
|
316
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
316
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
317
317
|
</collection-browser>`);
|
|
318
318
|
el.searchType = SearchType.TV;
|
|
319
319
|
await el.updateComplete;
|
|
@@ -353,7 +353,7 @@ describe('Collection Browser', () => {
|
|
|
353
353
|
collection: {},
|
|
354
354
|
year: {},
|
|
355
355
|
};
|
|
356
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
356
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
357
357
|
</collection-browser>`);
|
|
358
358
|
el.baseQuery = 'collection:foo';
|
|
359
359
|
el.selectedFacets = selectedFacets;
|
|
@@ -386,7 +386,7 @@ describe('Collection Browser', () => {
|
|
|
386
386
|
url.searchParams.append('sin', 'TXT');
|
|
387
387
|
window.history.replaceState({}, '', url);
|
|
388
388
|
const searchService = new MockSearchService();
|
|
389
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
389
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
390
390
|
</collection-browser>`);
|
|
391
391
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
392
392
|
});
|
|
@@ -396,10 +396,10 @@ describe('Collection Browser', () => {
|
|
|
396
396
|
url.searchParams.append('sin', 'TXT');
|
|
397
397
|
window.history.replaceState({}, '', url);
|
|
398
398
|
const searchService = new MockSearchService();
|
|
399
|
-
const el = await fixture(html `<collection-browser
|
|
400
|
-
.searchService=${searchService}
|
|
401
|
-
suppressURLSinParam
|
|
402
|
-
>
|
|
399
|
+
const el = await fixture(html `<collection-browser
|
|
400
|
+
.searchService=${searchService}
|
|
401
|
+
suppressURLSinParam
|
|
402
|
+
>
|
|
403
403
|
</collection-browser>`);
|
|
404
404
|
url = new URL(window.location.href);
|
|
405
405
|
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
@@ -411,7 +411,7 @@ describe('Collection Browser', () => {
|
|
|
411
411
|
});
|
|
412
412
|
it('can construct tile models with many fields present', async () => {
|
|
413
413
|
const searchService = new MockSearchService();
|
|
414
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
414
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
415
415
|
</collection-browser>`);
|
|
416
416
|
el.baseQuery = 'many-fields';
|
|
417
417
|
await el.updateComplete;
|
|
@@ -424,10 +424,10 @@ describe('Collection Browser', () => {
|
|
|
424
424
|
it('emits empty results event when search fetches no results', async () => {
|
|
425
425
|
const searchService = new MockSearchService();
|
|
426
426
|
const emptyResultsSpy = sinon.spy();
|
|
427
|
-
const el = await fixture(html `<collection-browser
|
|
428
|
-
.searchService=${searchService}
|
|
429
|
-
@emptyResults=${emptyResultsSpy}
|
|
430
|
-
>
|
|
427
|
+
const el = await fixture(html `<collection-browser
|
|
428
|
+
.searchService=${searchService}
|
|
429
|
+
@emptyResults=${emptyResultsSpy}
|
|
430
|
+
>
|
|
431
431
|
</collection-browser>`);
|
|
432
432
|
el.baseQuery = 'no-results';
|
|
433
433
|
await el.updateComplete;
|
|
@@ -437,10 +437,10 @@ describe('Collection Browser', () => {
|
|
|
437
437
|
it('emits searchError event when search results in an error', async () => {
|
|
438
438
|
const searchService = new MockSearchService();
|
|
439
439
|
const searchErrorSpy = sinon.spy();
|
|
440
|
-
const el = await fixture(html `<collection-browser
|
|
441
|
-
.searchService=${searchService}
|
|
442
|
-
@searchError=${searchErrorSpy}
|
|
443
|
-
>
|
|
440
|
+
const el = await fixture(html `<collection-browser
|
|
441
|
+
.searchService=${searchService}
|
|
442
|
+
@searchError=${searchErrorSpy}
|
|
443
|
+
>
|
|
444
444
|
</collection-browser>`);
|
|
445
445
|
el.baseQuery = 'error';
|
|
446
446
|
await el.updateComplete;
|
|
@@ -450,7 +450,7 @@ describe('Collection Browser', () => {
|
|
|
450
450
|
it('applies loggedin flag to tile models if needed', 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
|
el.baseQuery = 'loggedin';
|
|
456
456
|
await el.updateComplete;
|
|
@@ -464,7 +464,7 @@ describe('Collection Browser', () => {
|
|
|
464
464
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
465
465
|
var _a;
|
|
466
466
|
const searchService = new MockSearchService();
|
|
467
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
467
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
468
468
|
</collection-browser>`);
|
|
469
469
|
el.baseQuery = 'no-preview';
|
|
470
470
|
await el.updateComplete;
|
|
@@ -478,7 +478,7 @@ describe('Collection Browser', () => {
|
|
|
478
478
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
479
479
|
var _a, _b;
|
|
480
480
|
const searchService = new MockSearchService();
|
|
481
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
481
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
482
482
|
</collection-browser>`);
|
|
483
483
|
el.baseQuery = 'loggedin-no-preview';
|
|
484
484
|
await el.updateComplete;
|
|
@@ -493,7 +493,7 @@ describe('Collection Browser', () => {
|
|
|
493
493
|
it('joins full description array into a single string with line breaks', async () => {
|
|
494
494
|
var _a;
|
|
495
495
|
const searchService = new MockSearchService();
|
|
496
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
496
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
497
497
|
</collection-browser>`);
|
|
498
498
|
// This query receives an array description like ['line1', 'line2']
|
|
499
499
|
el.baseQuery = 'multi-line-description';
|
|
@@ -509,9 +509,9 @@ describe('Collection Browser', () => {
|
|
|
509
509
|
it('can change search type', async () => {
|
|
510
510
|
var _a;
|
|
511
511
|
const searchService = new MockSearchService();
|
|
512
|
-
const el = await fixture(html `<collection-browser
|
|
513
|
-
.searchService=${searchService}
|
|
514
|
-
.searchType=${SearchType.METADATA}
|
|
512
|
+
const el = await fixture(html `<collection-browser
|
|
513
|
+
.searchService=${searchService}
|
|
514
|
+
.searchType=${SearchType.METADATA}
|
|
515
515
|
></collection-browser>`);
|
|
516
516
|
el.baseQuery = 'collection:foo';
|
|
517
517
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -523,8 +523,8 @@ describe('Collection Browser', () => {
|
|
|
523
523
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
524
524
|
var _a;
|
|
525
525
|
const searchService = new MockSearchService();
|
|
526
|
-
const el = await fixture(html `<collection-browser
|
|
527
|
-
.searchService=${searchService}
|
|
526
|
+
const el = await fixture(html `<collection-browser
|
|
527
|
+
.searchService=${searchService}
|
|
528
528
|
></collection-browser>`);
|
|
529
529
|
el.baseQuery = ' collection:foo ';
|
|
530
530
|
await el.updateComplete;
|
|
@@ -534,8 +534,8 @@ describe('Collection Browser', () => {
|
|
|
534
534
|
it('shows error message when error response received', async () => {
|
|
535
535
|
var _a, _b;
|
|
536
536
|
const searchService = new MockSearchService();
|
|
537
|
-
const el = await fixture(html `<collection-browser
|
|
538
|
-
.searchService=${searchService}
|
|
537
|
+
const el = await fixture(html `<collection-browser
|
|
538
|
+
.searchService=${searchService}
|
|
539
539
|
></collection-browser>`);
|
|
540
540
|
el.baseQuery = 'error';
|
|
541
541
|
await el.updateComplete;
|
|
@@ -548,8 +548,8 @@ describe('Collection Browser', () => {
|
|
|
548
548
|
it('shows error message when error response received for a collection', async () => {
|
|
549
549
|
var _a, _b;
|
|
550
550
|
const searchService = new MockSearchService();
|
|
551
|
-
const el = await fixture(html `<collection-browser
|
|
552
|
-
.searchService=${searchService}
|
|
551
|
+
const el = await fixture(html `<collection-browser
|
|
552
|
+
.searchService=${searchService}
|
|
553
553
|
></collection-browser>`);
|
|
554
554
|
el.withinCollection = 'error';
|
|
555
555
|
await el.updateComplete;
|
|
@@ -564,8 +564,8 @@ describe('Collection Browser', () => {
|
|
|
564
564
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
565
565
|
window.Sentry = { captureMessage: sentrySpy };
|
|
566
566
|
const searchService = new MockSearchService();
|
|
567
|
-
const el = await fixture(html `<collection-browser
|
|
568
|
-
.searchService=${searchService}
|
|
567
|
+
const el = await fixture(html `<collection-browser
|
|
568
|
+
.searchService=${searchService}
|
|
569
569
|
></collection-browser>`);
|
|
570
570
|
el.baseQuery = 'malformed';
|
|
571
571
|
await el.updateComplete;
|
|
@@ -574,7 +574,7 @@ describe('Collection Browser', () => {
|
|
|
574
574
|
});
|
|
575
575
|
it('adds collection names to cache when present on response', async () => {
|
|
576
576
|
const searchService = new MockSearchService();
|
|
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 = 'collection-titles';
|
|
580
580
|
await el.updateComplete;
|
|
@@ -586,7 +586,7 @@ describe('Collection Browser', () => {
|
|
|
586
586
|
});
|
|
587
587
|
it('adds tv channel aliases to cache when present on response', async () => {
|
|
588
588
|
const searchService = new MockSearchService();
|
|
589
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
589
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
590
590
|
</collection-browser>`);
|
|
591
591
|
el.baseQuery = 'channel-aliases';
|
|
592
592
|
await el.updateComplete;
|
|
@@ -600,7 +600,7 @@ describe('Collection Browser', () => {
|
|
|
600
600
|
asyncResponse: true,
|
|
601
601
|
resultsSpy,
|
|
602
602
|
});
|
|
603
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
603
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
604
604
|
</collection-browser>`);
|
|
605
605
|
el.baseQuery = 'with-sort';
|
|
606
606
|
el.selectedSort = SortField.date;
|
|
@@ -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;
|
|
@@ -639,7 +639,7 @@ describe('Collection Browser', () => {
|
|
|
639
639
|
asyncResponse: true,
|
|
640
640
|
resultsSpy,
|
|
641
641
|
});
|
|
642
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
642
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
643
643
|
</collection-browser>`);
|
|
644
644
|
el.baseQuery = 'single-result';
|
|
645
645
|
await el.updateComplete;
|
|
@@ -660,7 +660,7 @@ describe('Collection Browser', () => {
|
|
|
660
660
|
asyncResponse: true,
|
|
661
661
|
resultsSpy,
|
|
662
662
|
});
|
|
663
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
663
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
664
664
|
</collection-browser>`);
|
|
665
665
|
el.baseQuery = 'with-sort';
|
|
666
666
|
el.selectedSort = SortField.date;
|
|
@@ -679,7 +679,7 @@ describe('Collection Browser', () => {
|
|
|
679
679
|
it('sets sort properties when user changes sort', async () => {
|
|
680
680
|
var _a, _b, _c, _d, _e, _f;
|
|
681
681
|
const searchService = new MockSearchService();
|
|
682
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
682
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
683
683
|
</collection-browser>`);
|
|
684
684
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
685
685
|
el.baseQuery = 'foo';
|
|
@@ -702,7 +702,7 @@ describe('Collection Browser', () => {
|
|
|
702
702
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
703
703
|
var _a, _b, _c, _d;
|
|
704
704
|
const searchService = new MockSearchService();
|
|
705
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
705
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
706
706
|
</collection-browser>`);
|
|
707
707
|
el.baseQuery = 'first-title';
|
|
708
708
|
el.selectedSort = 'title';
|
|
@@ -716,7 +716,7 @@ describe('Collection Browser', () => {
|
|
|
716
716
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
717
717
|
var _a, _b, _c, _d;
|
|
718
718
|
const searchService = new MockSearchService();
|
|
719
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
719
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
720
720
|
</collection-browser>`);
|
|
721
721
|
el.baseQuery = 'first-creator';
|
|
722
722
|
el.selectedSort = 'creator';
|
|
@@ -739,7 +739,7 @@ describe('Collection Browser', () => {
|
|
|
739
739
|
subject: {},
|
|
740
740
|
year: {},
|
|
741
741
|
};
|
|
742
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
742
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
743
743
|
</collection-browser>`);
|
|
744
744
|
el.baseQuery = 'first-creator';
|
|
745
745
|
el.selectedSort = 'creator';
|
|
@@ -767,7 +767,7 @@ describe('Collection Browser', () => {
|
|
|
767
767
|
it('applies correct search filter when TV clip filter set to commercials', async () => {
|
|
768
768
|
var _a, _b, _c;
|
|
769
769
|
const searchService = new MockSearchService();
|
|
770
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
770
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
771
771
|
</collection-browser>`);
|
|
772
772
|
el.baseQuery = 'tv-fields';
|
|
773
773
|
el.searchType = SearchType.TV;
|
|
@@ -779,7 +779,7 @@ describe('Collection Browser', () => {
|
|
|
779
779
|
it('applies correct search filter when TV clip filter set to factchecks', async () => {
|
|
780
780
|
var _a, _b, _c;
|
|
781
781
|
const searchService = new MockSearchService();
|
|
782
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
782
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
783
783
|
</collection-browser>`);
|
|
784
784
|
el.baseQuery = 'tv-fields';
|
|
785
785
|
el.searchType = SearchType.TV;
|
|
@@ -791,7 +791,7 @@ describe('Collection Browser', () => {
|
|
|
791
791
|
it('applies correct search filter when TV clip filter set to quotes', async () => {
|
|
792
792
|
var _a, _b, _c;
|
|
793
793
|
const searchService = new MockSearchService();
|
|
794
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
794
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
795
795
|
</collection-browser>`);
|
|
796
796
|
el.baseQuery = 'tv-fields';
|
|
797
797
|
el.searchType = SearchType.TV;
|
|
@@ -803,7 +803,7 @@ describe('Collection Browser', () => {
|
|
|
803
803
|
it('resets letter filters when query changes', async () => {
|
|
804
804
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
805
805
|
const searchService = new MockSearchService();
|
|
806
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
806
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
807
807
|
</collection-browser>`);
|
|
808
808
|
el.baseQuery = 'first-creator';
|
|
809
809
|
el.selectedSort = 'creator';
|
|
@@ -824,11 +824,11 @@ describe('Collection Browser', () => {
|
|
|
824
824
|
var _a, _b, _c;
|
|
825
825
|
const searchService = new MockSearchService();
|
|
826
826
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
827
|
-
const el = await fixture(html `<collection-browser
|
|
828
|
-
.searchService=${searchService}
|
|
829
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
830
|
-
.suppressPlaceholders=${true}
|
|
831
|
-
>
|
|
827
|
+
const el = await fixture(html `<collection-browser
|
|
828
|
+
.searchService=${searchService}
|
|
829
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
830
|
+
.suppressPlaceholders=${true}
|
|
831
|
+
>
|
|
832
832
|
</collection-browser>`);
|
|
833
833
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
834
834
|
el.showHistogramDatePicker = true;
|
|
@@ -857,10 +857,10 @@ describe('Collection Browser', () => {
|
|
|
857
857
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
858
858
|
var _a, _b, _c;
|
|
859
859
|
const searchService = new MockSearchService();
|
|
860
|
-
const el = await fixture(html `<collection-browser
|
|
861
|
-
.searchService=${searchService}
|
|
862
|
-
.suppressPlaceholders=${true}
|
|
863
|
-
>
|
|
860
|
+
const el = await fixture(html `<collection-browser
|
|
861
|
+
.searchService=${searchService}
|
|
862
|
+
.suppressPlaceholders=${true}
|
|
863
|
+
>
|
|
864
864
|
</collection-browser>`);
|
|
865
865
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
866
866
|
el.searchType = SearchType.TV;
|
|
@@ -891,9 +891,9 @@ describe('Collection Browser', () => {
|
|
|
891
891
|
var _a, _b, _c, _d;
|
|
892
892
|
const spy = sinon.spy();
|
|
893
893
|
const searchService = new MockSearchService();
|
|
894
|
-
const el = await fixture(html `<collection-browser
|
|
895
|
-
.searchService=${searchService}
|
|
896
|
-
@searchResultsLoadingChanged=${spy}
|
|
894
|
+
const el = await fixture(html `<collection-browser
|
|
895
|
+
.searchService=${searchService}
|
|
896
|
+
@searchResultsLoadingChanged=${spy}
|
|
897
897
|
></collection-browser>`);
|
|
898
898
|
spy.resetHistory();
|
|
899
899
|
el.baseQuery = 'collection:foo';
|
|
@@ -907,9 +907,9 @@ describe('Collection Browser', () => {
|
|
|
907
907
|
it('collapses extra set of quotes around href field', async () => {
|
|
908
908
|
var _a;
|
|
909
909
|
const searchService = new MockSearchService();
|
|
910
|
-
const el = await fixture(html `<collection-browser
|
|
911
|
-
.searchService=${searchService}
|
|
912
|
-
.baseNavigationUrl=${''}
|
|
910
|
+
const el = await fixture(html `<collection-browser
|
|
911
|
+
.searchService=${searchService}
|
|
912
|
+
.baseNavigationUrl=${''}
|
|
913
913
|
></collection-browser>`);
|
|
914
914
|
el.baseQuery = 'extra-quoted-href';
|
|
915
915
|
await el.updateComplete;
|
|
@@ -922,9 +922,9 @@ describe('Collection Browser', () => {
|
|
|
922
922
|
it('sets default sort from collection metadata', async () => {
|
|
923
923
|
var _a;
|
|
924
924
|
const searchService = new MockSearchService();
|
|
925
|
-
const el = await fixture(html `<collection-browser
|
|
926
|
-
.searchService=${searchService}
|
|
927
|
-
.baseNavigationUrl=${''}
|
|
925
|
+
const el = await fixture(html `<collection-browser
|
|
926
|
+
.searchService=${searchService}
|
|
927
|
+
.baseNavigationUrl=${''}
|
|
928
928
|
></collection-browser>`);
|
|
929
929
|
el.withinCollection = 'default-sort';
|
|
930
930
|
await el.updateComplete;
|
|
@@ -941,9 +941,9 @@ describe('Collection Browser', () => {
|
|
|
941
941
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
942
942
|
var _a;
|
|
943
943
|
const searchService = new MockSearchService();
|
|
944
|
-
const el = await fixture(html `<collection-browser
|
|
945
|
-
.searchService=${searchService}
|
|
946
|
-
.baseNavigationUrl=${''}
|
|
944
|
+
const el = await fixture(html `<collection-browser
|
|
945
|
+
.searchService=${searchService}
|
|
946
|
+
.baseNavigationUrl=${''}
|
|
947
947
|
></collection-browser>`);
|
|
948
948
|
el.withinCollection = 'default-sort-concise';
|
|
949
949
|
await el.updateComplete;
|
|
@@ -958,8 +958,8 @@ describe('Collection Browser', () => {
|
|
|
958
958
|
expect(sortBar.sortDirection).to.be.null;
|
|
959
959
|
});
|
|
960
960
|
it('falls back to weekly views default sorting on profiles when tab not set', async () => {
|
|
961
|
-
const el = await fixture(html `<collection-browser
|
|
962
|
-
.withinProfile=${'@foobar'}
|
|
961
|
+
const el = await fixture(html `<collection-browser
|
|
962
|
+
.withinProfile=${'@foobar'}
|
|
963
963
|
></collection-browser>`);
|
|
964
964
|
el.applyDefaultProfileSort();
|
|
965
965
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -970,9 +970,9 @@ describe('Collection Browser', () => {
|
|
|
970
970
|
it('uses relevance sort as default when a query is set', async () => {
|
|
971
971
|
var _a;
|
|
972
972
|
const searchService = new MockSearchService();
|
|
973
|
-
const el = await fixture(html `<collection-browser
|
|
974
|
-
.searchService=${searchService}
|
|
975
|
-
.baseNavigationUrl=${''}
|
|
973
|
+
const el = await fixture(html `<collection-browser
|
|
974
|
+
.searchService=${searchService}
|
|
975
|
+
.baseNavigationUrl=${''}
|
|
976
976
|
></collection-browser>`);
|
|
977
977
|
el.withinCollection = 'default-sort';
|
|
978
978
|
el.baseQuery = 'default-sort';
|
|
@@ -990,9 +990,9 @@ describe('Collection Browser', () => {
|
|
|
990
990
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
991
991
|
var _a;
|
|
992
992
|
const searchService = new MockSearchService();
|
|
993
|
-
const el = await fixture(html `<collection-browser
|
|
994
|
-
.searchService=${searchService}
|
|
995
|
-
.baseNavigationUrl=${''}
|
|
993
|
+
const el = await fixture(html `<collection-browser
|
|
994
|
+
.searchService=${searchService}
|
|
995
|
+
.baseNavigationUrl=${''}
|
|
996
996
|
></collection-browser>`);
|
|
997
997
|
el.withinCollection = 'fav-sort';
|
|
998
998
|
await el.updateComplete;
|
|
@@ -1009,7 +1009,7 @@ describe('Collection Browser', () => {
|
|
|
1009
1009
|
it('scrolls to page', async () => {
|
|
1010
1010
|
var _a;
|
|
1011
1011
|
const searchService = new MockSearchService();
|
|
1012
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1012
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1013
1013
|
</collection-browser>`);
|
|
1014
1014
|
// Infinite scroller won't exist unless there's a base query.
|
|
1015
1015
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -1031,9 +1031,9 @@ describe('Collection Browser', () => {
|
|
|
1031
1031
|
it('shows mobile facets in mobile view', async () => {
|
|
1032
1032
|
var _a, _b;
|
|
1033
1033
|
const searchService = new MockSearchService();
|
|
1034
|
-
const el = await fixture(html `<collection-browser
|
|
1035
|
-
.searchService=${searchService}
|
|
1036
|
-
.mobileBreakpoint=${9999}
|
|
1034
|
+
const el = await fixture(html `<collection-browser
|
|
1035
|
+
.searchService=${searchService}
|
|
1036
|
+
.mobileBreakpoint=${9999}
|
|
1037
1037
|
></collection-browser>`);
|
|
1038
1038
|
el.baseQuery = 'collection:foo';
|
|
1039
1039
|
await el.updateComplete;
|
|
@@ -1053,11 +1053,11 @@ describe('Collection Browser', () => {
|
|
|
1053
1053
|
var _a, _b;
|
|
1054
1054
|
const searchService = new MockSearchService();
|
|
1055
1055
|
const analyticsHandler = new MockAnalyticsHandler();
|
|
1056
|
-
const el = await fixture(html `<collection-browser
|
|
1057
|
-
.searchService=${searchService}
|
|
1058
|
-
.analyticsHandler=${analyticsHandler}
|
|
1059
|
-
.searchContext=${'foobar-context'}
|
|
1060
|
-
.mobileBreakpoint=${9999}
|
|
1056
|
+
const el = await fixture(html `<collection-browser
|
|
1057
|
+
.searchService=${searchService}
|
|
1058
|
+
.analyticsHandler=${analyticsHandler}
|
|
1059
|
+
.searchContext=${'foobar-context'}
|
|
1060
|
+
.mobileBreakpoint=${9999}
|
|
1061
1061
|
></collection-browser>`);
|
|
1062
1062
|
el.baseQuery = 'collection:foo';
|
|
1063
1063
|
await el.updateComplete;
|
|
@@ -1097,9 +1097,9 @@ describe('Collection Browser', () => {
|
|
|
1097
1097
|
});
|
|
1098
1098
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1099
1099
|
const searchService = new MockSearchService();
|
|
1100
|
-
const el = await fixture(html `<collection-browser
|
|
1101
|
-
.searchService=${searchService}
|
|
1102
|
-
.withinCollection=${'fake'}
|
|
1100
|
+
const el = await fixture(html `<collection-browser
|
|
1101
|
+
.searchService=${searchService}
|
|
1102
|
+
.withinCollection=${'fake'}
|
|
1103
1103
|
></collection-browser>`);
|
|
1104
1104
|
el.baseQuery = 'parent-collections';
|
|
1105
1105
|
await el.updateComplete;
|
|
@@ -1109,9 +1109,9 @@ describe('Collection Browser', () => {
|
|
|
1109
1109
|
});
|
|
1110
1110
|
it('recognizes TV collections', async () => {
|
|
1111
1111
|
const searchService = new MockSearchService();
|
|
1112
|
-
const el = await fixture(html `<collection-browser
|
|
1113
|
-
.searchService=${searchService}
|
|
1114
|
-
.withinCollection=${'TV-FOO'}
|
|
1112
|
+
const el = await fixture(html `<collection-browser
|
|
1113
|
+
.searchService=${searchService}
|
|
1114
|
+
.withinCollection=${'TV-FOO'}
|
|
1115
1115
|
></collection-browser>`);
|
|
1116
1116
|
el.baseQuery = 'tv-collection';
|
|
1117
1117
|
await el.updateComplete;
|
|
@@ -1123,9 +1123,9 @@ describe('Collection Browser', () => {
|
|
|
1123
1123
|
var _a;
|
|
1124
1124
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1125
1125
|
const searchService = new MockSearchService();
|
|
1126
|
-
const el = await fixture(html `<collection-browser
|
|
1127
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1128
|
-
.searchService=${searchService}
|
|
1126
|
+
const el = await fixture(html `<collection-browser
|
|
1127
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1128
|
+
.searchService=${searchService}
|
|
1129
1129
|
></collection-browser>`);
|
|
1130
1130
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1131
1131
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1171,7 +1171,7 @@ describe('Collection Browser', () => {
|
|
|
1171
1171
|
it('query the search service for single result', async () => {
|
|
1172
1172
|
var _a, _b;
|
|
1173
1173
|
const searchService = new MockSearchService();
|
|
1174
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1174
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1175
1175
|
</collection-browser>`);
|
|
1176
1176
|
el.baseQuery = 'single-result';
|
|
1177
1177
|
await el.updateComplete;
|
|
@@ -1200,7 +1200,7 @@ describe('Collection Browser', () => {
|
|
|
1200
1200
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1201
1201
|
window.history.replaceState({}, '', url);
|
|
1202
1202
|
const searchService = new MockSearchService();
|
|
1203
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1203
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1204
1204
|
</collection-browser>`);
|
|
1205
1205
|
await el.initialSearchComplete;
|
|
1206
1206
|
await el.updateComplete;
|
|
@@ -1226,10 +1226,10 @@ describe('Collection Browser', () => {
|
|
|
1226
1226
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1227
1227
|
window.history.replaceState({}, '', url);
|
|
1228
1228
|
const searchService = new MockSearchService();
|
|
1229
|
-
const el = await fixture(html `<collection-browser
|
|
1230
|
-
.searchService=${searchService}
|
|
1231
|
-
.withinCollection=${'foobar'}
|
|
1232
|
-
>
|
|
1229
|
+
const el = await fixture(html `<collection-browser
|
|
1230
|
+
.searchService=${searchService}
|
|
1231
|
+
.withinCollection=${'foobar'}
|
|
1232
|
+
>
|
|
1233
1233
|
</collection-browser>`);
|
|
1234
1234
|
await el.initialSearchComplete;
|
|
1235
1235
|
await el.updateComplete;
|
|
@@ -1254,11 +1254,11 @@ describe('Collection Browser', () => {
|
|
|
1254
1254
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1255
1255
|
window.history.replaceState({}, '', url);
|
|
1256
1256
|
const searchService = new MockSearchService();
|
|
1257
|
-
const el = await fixture(html `<collection-browser
|
|
1258
|
-
.searchService=${searchService}
|
|
1259
|
-
.withinProfile=${'@foobar'}
|
|
1260
|
-
.profileElement=${'uploads'}
|
|
1261
|
-
>
|
|
1257
|
+
const el = await fixture(html `<collection-browser
|
|
1258
|
+
.searchService=${searchService}
|
|
1259
|
+
.withinProfile=${'@foobar'}
|
|
1260
|
+
.profileElement=${'uploads'}
|
|
1261
|
+
>
|
|
1262
1262
|
</collection-browser>`);
|
|
1263
1263
|
await el.initialSearchComplete;
|
|
1264
1264
|
await el.updateComplete;
|
|
@@ -1285,7 +1285,7 @@ describe('Collection Browser', () => {
|
|
|
1285
1285
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1286
1286
|
window.history.replaceState({}, '', url);
|
|
1287
1287
|
const searchService = new MockSearchService();
|
|
1288
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1288
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1289
1289
|
</collection-browser>`);
|
|
1290
1290
|
await el.initialSearchComplete;
|
|
1291
1291
|
await el.updateComplete;
|
|
@@ -1313,10 +1313,10 @@ describe('Collection Browser', () => {
|
|
|
1313
1313
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1314
1314
|
window.history.replaceState({}, '', url);
|
|
1315
1315
|
const searchService = new MockSearchService();
|
|
1316
|
-
const el = await fixture(html `<collection-browser
|
|
1317
|
-
.searchService=${searchService}
|
|
1318
|
-
.withinCollection=${'foobar'}
|
|
1319
|
-
>
|
|
1316
|
+
const el = await fixture(html `<collection-browser
|
|
1317
|
+
.searchService=${searchService}
|
|
1318
|
+
.withinCollection=${'foobar'}
|
|
1319
|
+
>
|
|
1320
1320
|
</collection-browser>`);
|
|
1321
1321
|
el.baseQuery = 'bar';
|
|
1322
1322
|
await el.updateComplete;
|
|
@@ -1343,10 +1343,10 @@ describe('Collection Browser', () => {
|
|
|
1343
1343
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1344
1344
|
window.history.replaceState({}, '', url);
|
|
1345
1345
|
const searchService = new MockSearchService();
|
|
1346
|
-
const el = await fixture(html `<collection-browser
|
|
1347
|
-
.searchService=${searchService}
|
|
1348
|
-
.withinCollection=${'foobar'}
|
|
1349
|
-
>
|
|
1346
|
+
const el = await fixture(html `<collection-browser
|
|
1347
|
+
.searchService=${searchService}
|
|
1348
|
+
.withinCollection=${'foobar'}
|
|
1349
|
+
>
|
|
1350
1350
|
</collection-browser>`);
|
|
1351
1351
|
el.withinCollection = 'bar';
|
|
1352
1352
|
await el.updateComplete;
|
|
@@ -1363,11 +1363,11 @@ describe('Collection Browser', () => {
|
|
|
1363
1363
|
it('correctly retrieves web archive hits', async () => {
|
|
1364
1364
|
var _a, _b, _c;
|
|
1365
1365
|
const searchService = new MockSearchService();
|
|
1366
|
-
const el = await fixture(html `<collection-browser
|
|
1367
|
-
.searchService=${searchService}
|
|
1368
|
-
.withinProfile=${'@foo'}
|
|
1369
|
-
.profileElement=${'web_archives'}
|
|
1370
|
-
>
|
|
1366
|
+
const el = await fixture(html `<collection-browser
|
|
1367
|
+
.searchService=${searchService}
|
|
1368
|
+
.withinProfile=${'@foo'}
|
|
1369
|
+
.profileElement=${'web_archives'}
|
|
1370
|
+
>
|
|
1371
1371
|
</collection-browser>`);
|
|
1372
1372
|
el.baseQuery = 'web-archive';
|
|
1373
1373
|
await el.updateComplete;
|
|
@@ -1381,10 +1381,10 @@ describe('Collection Browser', () => {
|
|
|
1381
1381
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1382
1382
|
var _a;
|
|
1383
1383
|
const searchService = new MockSearchService();
|
|
1384
|
-
const el = await fixture(html `<collection-browser
|
|
1385
|
-
.searchService=${searchService}
|
|
1386
|
-
facetLoadStrategy=${'opt-in'}
|
|
1387
|
-
>
|
|
1384
|
+
const el = await fixture(html `<collection-browser
|
|
1385
|
+
.searchService=${searchService}
|
|
1386
|
+
facetLoadStrategy=${'opt-in'}
|
|
1387
|
+
>
|
|
1388
1388
|
</collection-browser>`);
|
|
1389
1389
|
el.baseQuery = 'foo';
|
|
1390
1390
|
await el.updateComplete;
|
|
@@ -1395,10 +1395,10 @@ describe('Collection Browser', () => {
|
|
|
1395
1395
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1396
1396
|
var _a, _b;
|
|
1397
1397
|
const searchService = new MockSearchService();
|
|
1398
|
-
const el = await fixture(html `<collection-browser
|
|
1399
|
-
.searchService=${searchService}
|
|
1400
|
-
facetLoadStrategy=${'off'}
|
|
1401
|
-
>
|
|
1398
|
+
const el = await fixture(html `<collection-browser
|
|
1399
|
+
.searchService=${searchService}
|
|
1400
|
+
facetLoadStrategy=${'off'}
|
|
1401
|
+
>
|
|
1402
1402
|
</collection-browser>`);
|
|
1403
1403
|
el.baseQuery = 'foo';
|
|
1404
1404
|
await el.updateComplete;
|
|
@@ -1410,7 +1410,7 @@ describe('Collection Browser', () => {
|
|
|
1410
1410
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1411
1411
|
var _a, _b, _c, _d;
|
|
1412
1412
|
const searchService = new MockSearchService();
|
|
1413
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1413
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1414
1414
|
</collection-browser>`);
|
|
1415
1415
|
el.baseQuery = 'foo';
|
|
1416
1416
|
await el.updateComplete;
|
|
@@ -1426,11 +1426,11 @@ describe('Collection Browser', () => {
|
|
|
1426
1426
|
});
|
|
1427
1427
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1428
1428
|
const searchService = new MockSearchService();
|
|
1429
|
-
const el = await fixture(html `<collection-browser
|
|
1430
|
-
.searchService=${searchService}
|
|
1431
|
-
.baseQuery=${'foo'}
|
|
1432
|
-
.displayMode=${'list-detail'}
|
|
1433
|
-
>
|
|
1429
|
+
const el = await fixture(html `<collection-browser
|
|
1430
|
+
.searchService=${searchService}
|
|
1431
|
+
.baseQuery=${'foo'}
|
|
1432
|
+
.displayMode=${'list-detail'}
|
|
1433
|
+
>
|
|
1434
1434
|
</collection-browser>`);
|
|
1435
1435
|
el.isManageView = true;
|
|
1436
1436
|
await el.updateComplete;
|
|
@@ -1439,10 +1439,10 @@ describe('Collection Browser', () => {
|
|
|
1439
1439
|
it('can remove all checked tiles', async () => {
|
|
1440
1440
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1441
1441
|
const searchService = new MockSearchService();
|
|
1442
|
-
const el = await fixture(html `<collection-browser
|
|
1443
|
-
.searchService=${searchService}
|
|
1444
|
-
.baseNavigationUrl=${''}
|
|
1445
|
-
>
|
|
1442
|
+
const el = await fixture(html `<collection-browser
|
|
1443
|
+
.searchService=${searchService}
|
|
1444
|
+
.baseNavigationUrl=${''}
|
|
1445
|
+
>
|
|
1446
1446
|
</collection-browser>`);
|
|
1447
1447
|
el.baseQuery = 'foo';
|
|
1448
1448
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1478,10 +1478,10 @@ describe('Collection Browser', () => {
|
|
|
1478
1478
|
});
|
|
1479
1479
|
it('can check/uncheck all tiles', async () => {
|
|
1480
1480
|
const searchService = new MockSearchService();
|
|
1481
|
-
const el = await fixture(html `<collection-browser
|
|
1482
|
-
.searchService=${searchService}
|
|
1483
|
-
.baseNavigationUrl=${''}
|
|
1484
|
-
>
|
|
1481
|
+
const el = await fixture(html `<collection-browser
|
|
1482
|
+
.searchService=${searchService}
|
|
1483
|
+
.baseNavigationUrl=${''}
|
|
1484
|
+
>
|
|
1485
1485
|
</collection-browser>`);
|
|
1486
1486
|
el.baseQuery = 'foo';
|
|
1487
1487
|
await el.updateComplete;
|
|
@@ -1501,10 +1501,10 @@ describe('Collection Browser', () => {
|
|
|
1501
1501
|
var _a, _b;
|
|
1502
1502
|
const spy = sinon.spy();
|
|
1503
1503
|
const searchService = new MockSearchService();
|
|
1504
|
-
const el = await fixture(html `<collection-browser
|
|
1505
|
-
.searchService=${searchService}
|
|
1506
|
-
.baseNavigationUrl=${''}
|
|
1507
|
-
@manageModeChanged=${spy}
|
|
1504
|
+
const el = await fixture(html `<collection-browser
|
|
1505
|
+
.searchService=${searchService}
|
|
1506
|
+
.baseNavigationUrl=${''}
|
|
1507
|
+
@manageModeChanged=${spy}
|
|
1508
1508
|
></collection-browser>`);
|
|
1509
1509
|
el.isManageView = true;
|
|
1510
1510
|
await el.updateComplete;
|
|
@@ -1519,11 +1519,11 @@ describe('Collection Browser', () => {
|
|
|
1519
1519
|
var _a, _b, _c, _d, _e;
|
|
1520
1520
|
const spy = sinon.spy();
|
|
1521
1521
|
const searchService = new MockSearchService();
|
|
1522
|
-
const el = await fixture(html `<collection-browser
|
|
1523
|
-
.searchService=${searchService}
|
|
1524
|
-
.baseNavigationUrl=${''}
|
|
1525
|
-
@itemRemovalRequested=${spy}
|
|
1526
|
-
>
|
|
1522
|
+
const el = await fixture(html `<collection-browser
|
|
1523
|
+
.searchService=${searchService}
|
|
1524
|
+
.baseNavigationUrl=${''}
|
|
1525
|
+
@itemRemovalRequested=${spy}
|
|
1526
|
+
>
|
|
1527
1527
|
</collection-browser>`);
|
|
1528
1528
|
el.baseQuery = 'foo';
|
|
1529
1529
|
await el.updateComplete;
|
|
@@ -1553,10 +1553,10 @@ describe('Collection Browser', () => {
|
|
|
1553
1553
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1554
1554
|
var _a;
|
|
1555
1555
|
const searchService = new MockSearchService();
|
|
1556
|
-
const el = await fixture(html `<collection-browser
|
|
1557
|
-
.searchService=${searchService}
|
|
1558
|
-
.baseNavigationUrl=${''}
|
|
1559
|
-
>
|
|
1556
|
+
const el = await fixture(html `<collection-browser
|
|
1557
|
+
.searchService=${searchService}
|
|
1558
|
+
.baseNavigationUrl=${''}
|
|
1559
|
+
>
|
|
1560
1560
|
</collection-browser>`);
|
|
1561
1561
|
el.baseQuery = 'foo';
|
|
1562
1562
|
await el.updateComplete;
|
|
@@ -1573,7 +1573,7 @@ describe('Collection Browser', () => {
|
|
|
1573
1573
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1574
1574
|
var _a, _b, _c, _d;
|
|
1575
1575
|
const searchService = new MockSearchService();
|
|
1576
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1576
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1577
1577
|
</collection-browser>`);
|
|
1578
1578
|
el.baseQuery = 'foo';
|
|
1579
1579
|
await el.updateComplete;
|
|
@@ -1601,10 +1601,10 @@ describe('Collection Browser', () => {
|
|
|
1601
1601
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1602
1602
|
var _a;
|
|
1603
1603
|
const searchService = new MockSearchService();
|
|
1604
|
-
const el = await fixture(html `<collection-browser
|
|
1605
|
-
.baseNavigationUrl=${''}
|
|
1606
|
-
.searchService=${searchService}
|
|
1607
|
-
>
|
|
1604
|
+
const el = await fixture(html `<collection-browser
|
|
1605
|
+
.baseNavigationUrl=${''}
|
|
1606
|
+
.searchService=${searchService}
|
|
1607
|
+
>
|
|
1608
1608
|
</collection-browser>`);
|
|
1609
1609
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1610
1610
|
await el.updateComplete;
|
|
@@ -1616,10 +1616,10 @@ describe('Collection Browser', () => {
|
|
|
1616
1616
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1617
1617
|
var _a;
|
|
1618
1618
|
const searchService = new MockSearchService();
|
|
1619
|
-
const el = await fixture(html `<collection-browser
|
|
1620
|
-
.baseNavigationUrl=${''}
|
|
1621
|
-
.searchService=${searchService}
|
|
1622
|
-
>
|
|
1619
|
+
const el = await fixture(html `<collection-browser
|
|
1620
|
+
.baseNavigationUrl=${''}
|
|
1621
|
+
.searchService=${searchService}
|
|
1622
|
+
>
|
|
1623
1623
|
</collection-browser>`);
|
|
1624
1624
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1625
1625
|
await el.updateComplete;
|
|
@@ -1631,10 +1631,10 @@ describe('Collection Browser', () => {
|
|
|
1631
1631
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1632
1632
|
var _a, _b, _c;
|
|
1633
1633
|
const searchService = new MockSearchService();
|
|
1634
|
-
const el = await fixture(html `<collection-browser
|
|
1635
|
-
.baseNavigationUrl=${''}
|
|
1636
|
-
.searchService=${searchService}
|
|
1637
|
-
>
|
|
1634
|
+
const el = await fixture(html `<collection-browser
|
|
1635
|
+
.baseNavigationUrl=${''}
|
|
1636
|
+
.searchService=${searchService}
|
|
1637
|
+
>
|
|
1638
1638
|
</collection-browser>`);
|
|
1639
1639
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1640
1640
|
await el.updateComplete;
|
|
@@ -1650,11 +1650,11 @@ describe('Collection Browser', () => {
|
|
|
1650
1650
|
it('applies loans tab properties to sort bar', async () => {
|
|
1651
1651
|
var _a;
|
|
1652
1652
|
const searchService = new MockSearchService();
|
|
1653
|
-
const el = await fixture(html `<collection-browser
|
|
1654
|
-
.baseNavigationUrl=${''}
|
|
1655
|
-
.searchService=${searchService}
|
|
1656
|
-
.enableSortOptionsSlot=${true}
|
|
1657
|
-
>
|
|
1653
|
+
const el = await fixture(html `<collection-browser
|
|
1654
|
+
.baseNavigationUrl=${''}
|
|
1655
|
+
.searchService=${searchService}
|
|
1656
|
+
.enableSortOptionsSlot=${true}
|
|
1657
|
+
>
|
|
1658
1658
|
</collection-browser>`);
|
|
1659
1659
|
el.baseQuery = 'collection:foo';
|
|
1660
1660
|
await el.updateComplete;
|
|
@@ -1669,9 +1669,9 @@ describe('Collection Browser', () => {
|
|
|
1669
1669
|
it('can suppress presence of result count', async () => {
|
|
1670
1670
|
var _a;
|
|
1671
1671
|
const searchService = new MockSearchService();
|
|
1672
|
-
const el = await fixture(html `<collection-browser
|
|
1673
|
-
.searchService=${searchService}
|
|
1674
|
-
suppressResultCount
|
|
1672
|
+
const el = await fixture(html `<collection-browser
|
|
1673
|
+
.searchService=${searchService}
|
|
1674
|
+
suppressResultCount
|
|
1675
1675
|
></collection-browser>`);
|
|
1676
1676
|
el.baseQuery = 'collection:foo';
|
|
1677
1677
|
await el.updateComplete;
|
|
@@ -1682,9 +1682,9 @@ describe('Collection Browser', () => {
|
|
|
1682
1682
|
it('can suppress presence of result tiles', async () => {
|
|
1683
1683
|
var _a;
|
|
1684
1684
|
const searchService = new MockSearchService();
|
|
1685
|
-
const el = await fixture(html `<collection-browser
|
|
1686
|
-
.searchService=${searchService}
|
|
1687
|
-
suppressResultTiles
|
|
1685
|
+
const el = await fixture(html `<collection-browser
|
|
1686
|
+
.searchService=${searchService}
|
|
1687
|
+
suppressResultTiles
|
|
1688
1688
|
></collection-browser>`);
|
|
1689
1689
|
el.baseQuery = 'collection:foo';
|
|
1690
1690
|
await el.updateComplete;
|
|
@@ -1697,7 +1697,7 @@ describe('Collection Browser', () => {
|
|
|
1697
1697
|
asyncResponse: true,
|
|
1698
1698
|
resultsSpy,
|
|
1699
1699
|
});
|
|
1700
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1700
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1701
1701
|
</collection-browser>`);
|
|
1702
1702
|
const numberOfPages = 15;
|
|
1703
1703
|
el.baseQuery = 'jack';
|