@internetarchive/collection-browser 3.5.2-alpha-webdev8160.0 → 3.5.2-alpha-webdev8093.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +764 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +140 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +23 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
- package/dist/src/collection-facets/more-facets-content.js +126 -127
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +267 -267
- 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.d.ts +0 -4
- package/dist/src/models.js +0 -8
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.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/hover/hover-pane-controller.d.ts +8 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +215 -215
- package/dist/src/tiles/tile-dispatcher.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/collection-facets/more-facets-content.test.js +28 -28
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +3075 -3075
- package/src/collection-facets/facet-row.ts +299 -299
- package/src/collection-facets/facets-template.ts +83 -83
- package/src/collection-facets/more-facets-content.ts +642 -644
- package/src/collection-facets.ts +1010 -1010
- package/src/data-source/collection-browser-data-source-interface.ts +345 -345
- package/src/data-source/collection-browser-data-source.ts +1441 -1441
- package/src/data-source/collection-browser-query-state.ts +59 -59
- package/src/data-source/models.ts +56 -56
- package/src/models.ts +0 -9
- package/src/restoration-state-handler.ts +546 -546
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +15 -1
- package/src/tiles/models.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +517 -517
- package/test/collection-browser.test.ts +2413 -2413
- package/test/collection-facets/more-facets-content.test.ts +231 -231
- package/test/restoration-state-handler.test.ts +480 -480
- package/vite.config.ts +29 -29
|
@@ -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;
|
|
@@ -203,7 +203,7 @@ describe('Collection Browser', () => {
|
|
|
203
203
|
});
|
|
204
204
|
it('should render with a sort bar, facets, and infinite scroller', async () => {
|
|
205
205
|
const searchService = new MockSearchService();
|
|
206
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
206
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
207
207
|
</collection-browser>`);
|
|
208
208
|
el.baseQuery = 'hello';
|
|
209
209
|
await el.updateComplete;
|
|
@@ -217,7 +217,7 @@ describe('Collection Browser', () => {
|
|
|
217
217
|
});
|
|
218
218
|
it('queries the search service when given a base query', async () => {
|
|
219
219
|
const searchService = new MockSearchService();
|
|
220
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
220
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
221
221
|
</collection-browser>`);
|
|
222
222
|
el.baseQuery = 'collection:foo';
|
|
223
223
|
await el.updateComplete;
|
|
@@ -227,7 +227,7 @@ describe('Collection Browser', () => {
|
|
|
227
227
|
});
|
|
228
228
|
it('queries the search service when given a list of identifiers and no query', async () => {
|
|
229
229
|
const searchService = new MockSearchService();
|
|
230
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
230
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
231
231
|
</collection-browser>`);
|
|
232
232
|
el.identifiers = ['foo', 'bar'];
|
|
233
233
|
await el.updateComplete;
|
|
@@ -240,7 +240,7 @@ describe('Collection Browser', () => {
|
|
|
240
240
|
});
|
|
241
241
|
it('queries the search service when given a list of identifiers with a query', async () => {
|
|
242
242
|
const searchService = new MockSearchService();
|
|
243
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
243
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
244
244
|
</collection-browser>`);
|
|
245
245
|
el.baseQuery = 'collection:foo';
|
|
246
246
|
el.identifiers = ['foo', 'bar'];
|
|
@@ -255,7 +255,7 @@ describe('Collection Browser', () => {
|
|
|
255
255
|
});
|
|
256
256
|
it('queries the search service with a metadata search', async () => {
|
|
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.METADATA;
|
|
261
261
|
await el.updateComplete;
|
|
@@ -268,7 +268,7 @@ describe('Collection Browser', () => {
|
|
|
268
268
|
});
|
|
269
269
|
it('can change search type', async () => {
|
|
270
270
|
const searchService = new MockSearchService();
|
|
271
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
271
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
272
272
|
</collection-browser>`);
|
|
273
273
|
el.baseQuery = 'collection:foo';
|
|
274
274
|
await el.updateComplete;
|
|
@@ -279,7 +279,7 @@ describe('Collection Browser', () => {
|
|
|
279
279
|
});
|
|
280
280
|
it('queries the search service with a fulltext search', async () => {
|
|
281
281
|
const searchService = new MockSearchService();
|
|
282
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
282
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
283
283
|
</collection-browser>`);
|
|
284
284
|
el.searchType = SearchType.FULLTEXT;
|
|
285
285
|
await el.updateComplete;
|
|
@@ -292,7 +292,7 @@ describe('Collection Browser', () => {
|
|
|
292
292
|
});
|
|
293
293
|
it('queries the search service with a radio search', async () => {
|
|
294
294
|
const searchService = new MockSearchService();
|
|
295
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
295
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
296
296
|
</collection-browser>`);
|
|
297
297
|
el.searchType = SearchType.RADIO;
|
|
298
298
|
await el.updateComplete;
|
|
@@ -305,7 +305,7 @@ describe('Collection Browser', () => {
|
|
|
305
305
|
});
|
|
306
306
|
it('queries the search service with a TV search', async () => {
|
|
307
307
|
const searchService = new MockSearchService();
|
|
308
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
308
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
309
309
|
</collection-browser>`);
|
|
310
310
|
el.searchType = SearchType.TV;
|
|
311
311
|
await el.updateComplete;
|
|
@@ -344,7 +344,7 @@ describe('Collection Browser', () => {
|
|
|
344
344
|
collection: {},
|
|
345
345
|
year: {},
|
|
346
346
|
};
|
|
347
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
347
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
348
348
|
</collection-browser>`);
|
|
349
349
|
el.baseQuery = 'collection:foo';
|
|
350
350
|
el.selectedFacets = selectedFacets;
|
|
@@ -376,7 +376,7 @@ describe('Collection Browser', () => {
|
|
|
376
376
|
url.searchParams.append('sin', 'TXT');
|
|
377
377
|
window.history.replaceState({}, '', url);
|
|
378
378
|
const searchService = new MockSearchService();
|
|
379
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
379
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
380
380
|
</collection-browser>`);
|
|
381
381
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
382
382
|
});
|
|
@@ -386,10 +386,10 @@ 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
|
|
390
|
-
.searchService=${searchService}
|
|
391
|
-
suppressURLSinParam
|
|
392
|
-
>
|
|
389
|
+
const el = await fixture(html `<collection-browser
|
|
390
|
+
.searchService=${searchService}
|
|
391
|
+
suppressURLSinParam
|
|
392
|
+
>
|
|
393
393
|
</collection-browser>`);
|
|
394
394
|
url = new URL(window.location.href);
|
|
395
395
|
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
@@ -401,7 +401,7 @@ describe('Collection Browser', () => {
|
|
|
401
401
|
});
|
|
402
402
|
it('can construct tile models with many fields present', async () => {
|
|
403
403
|
const searchService = new MockSearchService();
|
|
404
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
404
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
405
405
|
</collection-browser>`);
|
|
406
406
|
el.baseQuery = 'many-fields';
|
|
407
407
|
await el.updateComplete;
|
|
@@ -414,10 +414,10 @@ describe('Collection Browser', () => {
|
|
|
414
414
|
it('emits empty results event when search fetches no results', async () => {
|
|
415
415
|
const searchService = new MockSearchService();
|
|
416
416
|
const emptyResultsSpy = sinon.spy();
|
|
417
|
-
const el = await fixture(html `<collection-browser
|
|
418
|
-
.searchService=${searchService}
|
|
419
|
-
@emptyResults=${emptyResultsSpy}
|
|
420
|
-
>
|
|
417
|
+
const el = await fixture(html `<collection-browser
|
|
418
|
+
.searchService=${searchService}
|
|
419
|
+
@emptyResults=${emptyResultsSpy}
|
|
420
|
+
>
|
|
421
421
|
</collection-browser>`);
|
|
422
422
|
el.baseQuery = 'no-results';
|
|
423
423
|
await el.updateComplete;
|
|
@@ -427,10 +427,10 @@ describe('Collection Browser', () => {
|
|
|
427
427
|
it('emits searchError event when search results in an error', async () => {
|
|
428
428
|
const searchService = new MockSearchService();
|
|
429
429
|
const searchErrorSpy = sinon.spy();
|
|
430
|
-
const el = await fixture(html `<collection-browser
|
|
431
|
-
.searchService=${searchService}
|
|
432
|
-
@searchError=${searchErrorSpy}
|
|
433
|
-
>
|
|
430
|
+
const el = await fixture(html `<collection-browser
|
|
431
|
+
.searchService=${searchService}
|
|
432
|
+
@searchError=${searchErrorSpy}
|
|
433
|
+
>
|
|
434
434
|
</collection-browser>`);
|
|
435
435
|
el.baseQuery = 'error';
|
|
436
436
|
await el.updateComplete;
|
|
@@ -439,7 +439,7 @@ describe('Collection Browser', () => {
|
|
|
439
439
|
});
|
|
440
440
|
it('applies loggedin flag to tile models if needed', async () => {
|
|
441
441
|
const searchService = new MockSearchService();
|
|
442
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
442
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
443
443
|
</collection-browser>`);
|
|
444
444
|
el.baseQuery = 'loggedin';
|
|
445
445
|
await el.updateComplete;
|
|
@@ -452,7 +452,7 @@ describe('Collection Browser', () => {
|
|
|
452
452
|
});
|
|
453
453
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
454
454
|
const searchService = new MockSearchService();
|
|
455
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
455
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
456
456
|
</collection-browser>`);
|
|
457
457
|
el.baseQuery = 'no-preview';
|
|
458
458
|
await el.updateComplete;
|
|
@@ -465,7 +465,7 @@ describe('Collection Browser', () => {
|
|
|
465
465
|
});
|
|
466
466
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
467
467
|
const searchService = new MockSearchService();
|
|
468
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
468
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
469
469
|
</collection-browser>`);
|
|
470
470
|
el.baseQuery = 'loggedin-no-preview';
|
|
471
471
|
await el.updateComplete;
|
|
@@ -479,7 +479,7 @@ describe('Collection Browser', () => {
|
|
|
479
479
|
});
|
|
480
480
|
it('joins full description array into a single string with line breaks', async () => {
|
|
481
481
|
const searchService = new MockSearchService();
|
|
482
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
482
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
483
483
|
</collection-browser>`);
|
|
484
484
|
// This query receives an array description like ['line1', 'line2']
|
|
485
485
|
el.baseQuery = 'multi-line-description';
|
|
@@ -494,9 +494,9 @@ describe('Collection Browser', () => {
|
|
|
494
494
|
});
|
|
495
495
|
it('can change search type', async () => {
|
|
496
496
|
const searchService = new MockSearchService();
|
|
497
|
-
const el = await fixture(html `<collection-browser
|
|
498
|
-
.searchService=${searchService}
|
|
499
|
-
.searchType=${SearchType.METADATA}
|
|
497
|
+
const el = await fixture(html `<collection-browser
|
|
498
|
+
.searchService=${searchService}
|
|
499
|
+
.searchType=${SearchType.METADATA}
|
|
500
500
|
></collection-browser>`);
|
|
501
501
|
el.baseQuery = 'collection:foo';
|
|
502
502
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -507,8 +507,8 @@ describe('Collection Browser', () => {
|
|
|
507
507
|
});
|
|
508
508
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
509
509
|
const searchService = new MockSearchService();
|
|
510
|
-
const el = await fixture(html `<collection-browser
|
|
511
|
-
.searchService=${searchService}
|
|
510
|
+
const el = await fixture(html `<collection-browser
|
|
511
|
+
.searchService=${searchService}
|
|
512
512
|
></collection-browser>`);
|
|
513
513
|
el.baseQuery = ' collection:foo ';
|
|
514
514
|
await el.updateComplete;
|
|
@@ -517,8 +517,8 @@ describe('Collection Browser', () => {
|
|
|
517
517
|
});
|
|
518
518
|
it('shows error message when error response received', async () => {
|
|
519
519
|
const searchService = new MockSearchService();
|
|
520
|
-
const el = await fixture(html `<collection-browser
|
|
521
|
-
.searchService=${searchService}
|
|
520
|
+
const el = await fixture(html `<collection-browser
|
|
521
|
+
.searchService=${searchService}
|
|
522
522
|
></collection-browser>`);
|
|
523
523
|
el.baseQuery = 'error';
|
|
524
524
|
await el.updateComplete;
|
|
@@ -530,8 +530,8 @@ describe('Collection Browser', () => {
|
|
|
530
530
|
});
|
|
531
531
|
it('shows error message when error response received for a collection', async () => {
|
|
532
532
|
const searchService = new MockSearchService();
|
|
533
|
-
const el = await fixture(html `<collection-browser
|
|
534
|
-
.searchService=${searchService}
|
|
533
|
+
const el = await fixture(html `<collection-browser
|
|
534
|
+
.searchService=${searchService}
|
|
535
535
|
></collection-browser>`);
|
|
536
536
|
el.withinCollection = 'error';
|
|
537
537
|
await el.updateComplete;
|
|
@@ -546,8 +546,8 @@ describe('Collection Browser', () => {
|
|
|
546
546
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
547
547
|
window.Sentry = { captureMessage: sentrySpy };
|
|
548
548
|
const searchService = new MockSearchService();
|
|
549
|
-
const el = await fixture(html `<collection-browser
|
|
550
|
-
.searchService=${searchService}
|
|
549
|
+
const el = await fixture(html `<collection-browser
|
|
550
|
+
.searchService=${searchService}
|
|
551
551
|
></collection-browser>`);
|
|
552
552
|
el.baseQuery = 'malformed';
|
|
553
553
|
await el.updateComplete;
|
|
@@ -556,7 +556,7 @@ describe('Collection Browser', () => {
|
|
|
556
556
|
});
|
|
557
557
|
it('adds collection names to cache when present on response', async () => {
|
|
558
558
|
const searchService = new MockSearchService();
|
|
559
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
559
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
560
560
|
</collection-browser>`);
|
|
561
561
|
el.baseQuery = 'collection-titles';
|
|
562
562
|
await el.updateComplete;
|
|
@@ -568,7 +568,7 @@ describe('Collection Browser', () => {
|
|
|
568
568
|
});
|
|
569
569
|
it('adds tv channel aliases to cache when present on response', async () => {
|
|
570
570
|
const searchService = new MockSearchService();
|
|
571
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
571
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
572
572
|
</collection-browser>`);
|
|
573
573
|
el.baseQuery = 'channel-aliases';
|
|
574
574
|
await el.updateComplete;
|
|
@@ -582,7 +582,7 @@ describe('Collection Browser', () => {
|
|
|
582
582
|
asyncResponse: true,
|
|
583
583
|
resultsSpy,
|
|
584
584
|
});
|
|
585
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
585
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
586
586
|
</collection-browser>`);
|
|
587
587
|
el.baseQuery = 'with-sort';
|
|
588
588
|
el.selectedSort = SortField.date;
|
|
@@ -599,7 +599,7 @@ describe('Collection Browser', () => {
|
|
|
599
599
|
asyncResponse: true,
|
|
600
600
|
resultsSpy,
|
|
601
601
|
});
|
|
602
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
602
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
603
603
|
</collection-browser>`);
|
|
604
604
|
el.baseQuery = 'with-sort';
|
|
605
605
|
el.selectedSort = SortField.date;
|
|
@@ -621,7 +621,7 @@ describe('Collection Browser', () => {
|
|
|
621
621
|
asyncResponse: true,
|
|
622
622
|
resultsSpy,
|
|
623
623
|
});
|
|
624
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
624
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
625
625
|
</collection-browser>`);
|
|
626
626
|
el.baseQuery = 'single-result';
|
|
627
627
|
await el.updateComplete;
|
|
@@ -642,7 +642,7 @@ describe('Collection Browser', () => {
|
|
|
642
642
|
asyncResponse: true,
|
|
643
643
|
resultsSpy,
|
|
644
644
|
});
|
|
645
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
645
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
646
646
|
</collection-browser>`);
|
|
647
647
|
el.baseQuery = 'with-sort';
|
|
648
648
|
el.selectedSort = SortField.date;
|
|
@@ -660,7 +660,7 @@ describe('Collection Browser', () => {
|
|
|
660
660
|
});
|
|
661
661
|
it('sets sort properties when user changes sort', async () => {
|
|
662
662
|
const searchService = new MockSearchService();
|
|
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
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
666
666
|
el.baseQuery = 'foo';
|
|
@@ -686,7 +686,7 @@ describe('Collection Browser', () => {
|
|
|
686
686
|
});
|
|
687
687
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
688
688
|
const searchService = new MockSearchService();
|
|
689
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
689
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
690
690
|
</collection-browser>`);
|
|
691
691
|
el.baseQuery = 'first-title';
|
|
692
692
|
el.selectedSort = 'title';
|
|
@@ -699,7 +699,7 @@ describe('Collection Browser', () => {
|
|
|
699
699
|
});
|
|
700
700
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
701
701
|
const searchService = new MockSearchService();
|
|
702
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
702
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
703
703
|
</collection-browser>`);
|
|
704
704
|
el.baseQuery = 'first-creator';
|
|
705
705
|
el.selectedSort = 'creator';
|
|
@@ -721,7 +721,7 @@ describe('Collection Browser', () => {
|
|
|
721
721
|
subject: {},
|
|
722
722
|
year: {},
|
|
723
723
|
};
|
|
724
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
724
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
725
725
|
</collection-browser>`);
|
|
726
726
|
el.baseQuery = 'first-creator';
|
|
727
727
|
el.selectedSort = 'creator';
|
|
@@ -748,7 +748,7 @@ describe('Collection Browser', () => {
|
|
|
748
748
|
});
|
|
749
749
|
it('applies correct TV search filter for commercials', async () => {
|
|
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;
|
|
@@ -763,7 +763,7 @@ describe('Collection Browser', () => {
|
|
|
763
763
|
});
|
|
764
764
|
it('applies correct TV search filter for fact checks', async () => {
|
|
765
765
|
const searchService = new MockSearchService();
|
|
766
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
766
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
767
767
|
</collection-browser>`);
|
|
768
768
|
el.baseQuery = 'tv-fields';
|
|
769
769
|
el.searchType = SearchType.TV;
|
|
@@ -778,7 +778,7 @@ describe('Collection Browser', () => {
|
|
|
778
778
|
});
|
|
779
779
|
it('applies correct TV search filter for quotes', async () => {
|
|
780
780
|
const searchService = new MockSearchService();
|
|
781
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
781
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
782
782
|
</collection-browser>`);
|
|
783
783
|
el.baseQuery = 'tv-fields';
|
|
784
784
|
el.searchType = SearchType.TV;
|
|
@@ -791,7 +791,7 @@ describe('Collection Browser', () => {
|
|
|
791
791
|
});
|
|
792
792
|
it('resets letter filters when query changes', async () => {
|
|
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 = 'first-creator';
|
|
797
797
|
el.selectedSort = 'creator';
|
|
@@ -811,11 +811,11 @@ describe('Collection Browser', () => {
|
|
|
811
811
|
it('sets date range query when date picker selection changed', async () => {
|
|
812
812
|
const searchService = new MockSearchService();
|
|
813
813
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
814
|
-
const el = await fixture(html `<collection-browser
|
|
815
|
-
.searchService=${searchService}
|
|
816
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
817
|
-
.suppressPlaceholders=${true}
|
|
818
|
-
>
|
|
814
|
+
const el = await fixture(html `<collection-browser
|
|
815
|
+
.searchService=${searchService}
|
|
816
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
817
|
+
.suppressPlaceholders=${true}
|
|
818
|
+
>
|
|
819
819
|
</collection-browser>`);
|
|
820
820
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
821
821
|
el.showHistogramDatePicker = true;
|
|
@@ -843,10 +843,10 @@ describe('Collection Browser', () => {
|
|
|
843
843
|
});
|
|
844
844
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
845
845
|
const searchService = new MockSearchService();
|
|
846
|
-
const el = await fixture(html `<collection-browser
|
|
847
|
-
.searchService=${searchService}
|
|
848
|
-
.suppressPlaceholders=${true}
|
|
849
|
-
>
|
|
846
|
+
const el = await fixture(html `<collection-browser
|
|
847
|
+
.searchService=${searchService}
|
|
848
|
+
.suppressPlaceholders=${true}
|
|
849
|
+
>
|
|
850
850
|
</collection-browser>`);
|
|
851
851
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
852
852
|
el.searchType = SearchType.TV;
|
|
@@ -876,9 +876,9 @@ describe('Collection Browser', () => {
|
|
|
876
876
|
it('emits event when results start and end loading', async () => {
|
|
877
877
|
const spy = sinon.spy();
|
|
878
878
|
const searchService = new MockSearchService();
|
|
879
|
-
const el = await fixture(html `<collection-browser
|
|
880
|
-
.searchService=${searchService}
|
|
881
|
-
@searchResultsLoadingChanged=${spy}
|
|
879
|
+
const el = await fixture(html `<collection-browser
|
|
880
|
+
.searchService=${searchService}
|
|
881
|
+
@searchResultsLoadingChanged=${spy}
|
|
882
882
|
></collection-browser>`);
|
|
883
883
|
spy.resetHistory();
|
|
884
884
|
el.baseQuery = 'collection:foo';
|
|
@@ -891,9 +891,9 @@ describe('Collection Browser', () => {
|
|
|
891
891
|
});
|
|
892
892
|
it('collapses extra set of quotes around href field', async () => {
|
|
893
893
|
const searchService = new MockSearchService();
|
|
894
|
-
const el = await fixture(html `<collection-browser
|
|
895
|
-
.searchService=${searchService}
|
|
896
|
-
.baseNavigationUrl=${''}
|
|
894
|
+
const el = await fixture(html `<collection-browser
|
|
895
|
+
.searchService=${searchService}
|
|
896
|
+
.baseNavigationUrl=${''}
|
|
897
897
|
></collection-browser>`);
|
|
898
898
|
el.baseQuery = 'extra-quoted-href';
|
|
899
899
|
await el.updateComplete;
|
|
@@ -905,9 +905,9 @@ describe('Collection Browser', () => {
|
|
|
905
905
|
});
|
|
906
906
|
it('sets default sort from collection metadata', async () => {
|
|
907
907
|
const searchService = new MockSearchService();
|
|
908
|
-
const el = await fixture(html `<collection-browser
|
|
909
|
-
.searchService=${searchService}
|
|
910
|
-
.baseNavigationUrl=${''}
|
|
908
|
+
const el = await fixture(html `<collection-browser
|
|
909
|
+
.searchService=${searchService}
|
|
910
|
+
.baseNavigationUrl=${''}
|
|
911
911
|
></collection-browser>`);
|
|
912
912
|
el.withinCollection = 'default-sort';
|
|
913
913
|
await el.updateComplete;
|
|
@@ -923,9 +923,9 @@ describe('Collection Browser', () => {
|
|
|
923
923
|
});
|
|
924
924
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
925
925
|
const searchService = new MockSearchService();
|
|
926
|
-
const el = await fixture(html `<collection-browser
|
|
927
|
-
.searchService=${searchService}
|
|
928
|
-
.baseNavigationUrl=${''}
|
|
926
|
+
const el = await fixture(html `<collection-browser
|
|
927
|
+
.searchService=${searchService}
|
|
928
|
+
.baseNavigationUrl=${''}
|
|
929
929
|
></collection-browser>`);
|
|
930
930
|
el.withinCollection = 'default-sort-concise';
|
|
931
931
|
await el.updateComplete;
|
|
@@ -940,8 +940,8 @@ describe('Collection Browser', () => {
|
|
|
940
940
|
expect(sortBar.sortDirection).to.be.null;
|
|
941
941
|
});
|
|
942
942
|
it('falls back to weekly views default sorting on profiles when tab not set', async () => {
|
|
943
|
-
const el = await fixture(html `<collection-browser
|
|
944
|
-
.withinProfile=${'@foobar'}
|
|
943
|
+
const el = await fixture(html `<collection-browser
|
|
944
|
+
.withinProfile=${'@foobar'}
|
|
945
945
|
></collection-browser>`);
|
|
946
946
|
el.applyDefaultProfileSort();
|
|
947
947
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -951,9 +951,9 @@ describe('Collection Browser', () => {
|
|
|
951
951
|
});
|
|
952
952
|
it('uses relevance sort as default when a query is set', async () => {
|
|
953
953
|
const searchService = new MockSearchService();
|
|
954
|
-
const el = await fixture(html `<collection-browser
|
|
955
|
-
.searchService=${searchService}
|
|
956
|
-
.baseNavigationUrl=${''}
|
|
954
|
+
const el = await fixture(html `<collection-browser
|
|
955
|
+
.searchService=${searchService}
|
|
956
|
+
.baseNavigationUrl=${''}
|
|
957
957
|
></collection-browser>`);
|
|
958
958
|
el.withinCollection = 'default-sort';
|
|
959
959
|
el.baseQuery = 'default-sort';
|
|
@@ -970,9 +970,9 @@ describe('Collection Browser', () => {
|
|
|
970
970
|
});
|
|
971
971
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
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 = 'fav-sort';
|
|
978
978
|
await el.updateComplete;
|
|
@@ -988,7 +988,7 @@ describe('Collection Browser', () => {
|
|
|
988
988
|
});
|
|
989
989
|
it('scrolls to page', async () => {
|
|
990
990
|
const searchService = new MockSearchService();
|
|
991
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
991
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
992
992
|
</collection-browser>`);
|
|
993
993
|
// Infinite scroller won't exist unless there's a base query.
|
|
994
994
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -1009,9 +1009,9 @@ describe('Collection Browser', () => {
|
|
|
1009
1009
|
});
|
|
1010
1010
|
it('shows mobile facets in mobile view', async () => {
|
|
1011
1011
|
const searchService = new MockSearchService();
|
|
1012
|
-
const el = await fixture(html `<collection-browser
|
|
1013
|
-
.searchService=${searchService}
|
|
1014
|
-
.mobileBreakpoint=${9999}
|
|
1012
|
+
const el = await fixture(html `<collection-browser
|
|
1013
|
+
.searchService=${searchService}
|
|
1014
|
+
.mobileBreakpoint=${9999}
|
|
1015
1015
|
></collection-browser>`);
|
|
1016
1016
|
el.baseQuery = 'collection:foo';
|
|
1017
1017
|
await el.updateComplete;
|
|
@@ -1030,11 +1030,11 @@ describe('Collection Browser', () => {
|
|
|
1030
1030
|
it('fires analytics when mobile facets toggled', async () => {
|
|
1031
1031
|
const searchService = new MockSearchService();
|
|
1032
1032
|
const analyticsHandler = new MockAnalyticsHandler();
|
|
1033
|
-
const el = await fixture(html `<collection-browser
|
|
1034
|
-
.searchService=${searchService}
|
|
1035
|
-
.analyticsHandler=${analyticsHandler}
|
|
1036
|
-
.searchContext=${'foobar-context'}
|
|
1037
|
-
.mobileBreakpoint=${9999}
|
|
1033
|
+
const el = await fixture(html `<collection-browser
|
|
1034
|
+
.searchService=${searchService}
|
|
1035
|
+
.analyticsHandler=${analyticsHandler}
|
|
1036
|
+
.searchContext=${'foobar-context'}
|
|
1037
|
+
.mobileBreakpoint=${9999}
|
|
1038
1038
|
></collection-browser>`);
|
|
1039
1039
|
el.baseQuery = 'collection:foo';
|
|
1040
1040
|
await el.updateComplete;
|
|
@@ -1074,9 +1074,9 @@ describe('Collection Browser', () => {
|
|
|
1074
1074
|
});
|
|
1075
1075
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1076
1076
|
const searchService = new MockSearchService();
|
|
1077
|
-
const el = await fixture(html `<collection-browser
|
|
1078
|
-
.searchService=${searchService}
|
|
1079
|
-
.withinCollection=${'fake'}
|
|
1077
|
+
const el = await fixture(html `<collection-browser
|
|
1078
|
+
.searchService=${searchService}
|
|
1079
|
+
.withinCollection=${'fake'}
|
|
1080
1080
|
></collection-browser>`);
|
|
1081
1081
|
el.baseQuery = 'parent-collections';
|
|
1082
1082
|
await el.updateComplete;
|
|
@@ -1086,9 +1086,9 @@ describe('Collection Browser', () => {
|
|
|
1086
1086
|
});
|
|
1087
1087
|
it('recognizes TV collections', async () => {
|
|
1088
1088
|
const searchService = new MockSearchService();
|
|
1089
|
-
const el = await fixture(html `<collection-browser
|
|
1090
|
-
.searchService=${searchService}
|
|
1091
|
-
.withinCollection=${'TV-FOO'}
|
|
1089
|
+
const el = await fixture(html `<collection-browser
|
|
1090
|
+
.searchService=${searchService}
|
|
1091
|
+
.withinCollection=${'TV-FOO'}
|
|
1092
1092
|
></collection-browser>`);
|
|
1093
1093
|
el.baseQuery = 'tv-collection';
|
|
1094
1094
|
await el.updateComplete;
|
|
@@ -1099,9 +1099,9 @@ describe('Collection Browser', () => {
|
|
|
1099
1099
|
it('refreshes when certain properties change - with some analytics event sampling', async () => {
|
|
1100
1100
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1101
1101
|
const searchService = new MockSearchService();
|
|
1102
|
-
const el = await fixture(html `<collection-browser
|
|
1103
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1104
|
-
.searchService=${searchService}
|
|
1102
|
+
const el = await fixture(html `<collection-browser
|
|
1103
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1104
|
+
.searchService=${searchService}
|
|
1105
1105
|
></collection-browser>`);
|
|
1106
1106
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1107
1107
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1146,7 +1146,7 @@ describe('Collection Browser', () => {
|
|
|
1146
1146
|
});
|
|
1147
1147
|
it('query the search service for single result', async () => {
|
|
1148
1148
|
const searchService = new MockSearchService();
|
|
1149
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1149
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1150
1150
|
</collection-browser>`);
|
|
1151
1151
|
el.baseQuery = 'single-result';
|
|
1152
1152
|
await el.updateComplete;
|
|
@@ -1174,7 +1174,7 @@ describe('Collection Browser', () => {
|
|
|
1174
1174
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1175
1175
|
window.history.replaceState({}, '', url);
|
|
1176
1176
|
const searchService = new MockSearchService();
|
|
1177
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1177
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1178
1178
|
</collection-browser>`);
|
|
1179
1179
|
await el.initialSearchComplete;
|
|
1180
1180
|
await el.updateComplete;
|
|
@@ -1199,10 +1199,10 @@ describe('Collection Browser', () => {
|
|
|
1199
1199
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1200
1200
|
window.history.replaceState({}, '', url);
|
|
1201
1201
|
const searchService = new MockSearchService();
|
|
1202
|
-
const el = await fixture(html `<collection-browser
|
|
1203
|
-
.searchService=${searchService}
|
|
1204
|
-
.withinCollection=${'foobar'}
|
|
1205
|
-
>
|
|
1202
|
+
const el = await fixture(html `<collection-browser
|
|
1203
|
+
.searchService=${searchService}
|
|
1204
|
+
.withinCollection=${'foobar'}
|
|
1205
|
+
>
|
|
1206
1206
|
</collection-browser>`);
|
|
1207
1207
|
await el.initialSearchComplete;
|
|
1208
1208
|
await el.updateComplete;
|
|
@@ -1226,11 +1226,11 @@ 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
|
-
.withinProfile=${'@foobar'}
|
|
1232
|
-
.profileElement=${'uploads'}
|
|
1233
|
-
>
|
|
1229
|
+
const el = await fixture(html `<collection-browser
|
|
1230
|
+
.searchService=${searchService}
|
|
1231
|
+
.withinProfile=${'@foobar'}
|
|
1232
|
+
.profileElement=${'uploads'}
|
|
1233
|
+
>
|
|
1234
1234
|
</collection-browser>`);
|
|
1235
1235
|
await el.initialSearchComplete;
|
|
1236
1236
|
await el.updateComplete;
|
|
@@ -1256,7 +1256,7 @@ describe('Collection Browser', () => {
|
|
|
1256
1256
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1257
1257
|
window.history.replaceState({}, '', url);
|
|
1258
1258
|
const searchService = new MockSearchService();
|
|
1259
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1259
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1260
1260
|
</collection-browser>`);
|
|
1261
1261
|
await el.initialSearchComplete;
|
|
1262
1262
|
await el.updateComplete;
|
|
@@ -1283,10 +1283,10 @@ describe('Collection Browser', () => {
|
|
|
1283
1283
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1284
1284
|
window.history.replaceState({}, '', url);
|
|
1285
1285
|
const searchService = new MockSearchService();
|
|
1286
|
-
const el = await fixture(html `<collection-browser
|
|
1287
|
-
.searchService=${searchService}
|
|
1288
|
-
.withinCollection=${'foobar'}
|
|
1289
|
-
>
|
|
1286
|
+
const el = await fixture(html `<collection-browser
|
|
1287
|
+
.searchService=${searchService}
|
|
1288
|
+
.withinCollection=${'foobar'}
|
|
1289
|
+
>
|
|
1290
1290
|
</collection-browser>`);
|
|
1291
1291
|
el.baseQuery = 'bar';
|
|
1292
1292
|
await el.updateComplete;
|
|
@@ -1312,10 +1312,10 @@ describe('Collection Browser', () => {
|
|
|
1312
1312
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1313
1313
|
window.history.replaceState({}, '', url);
|
|
1314
1314
|
const searchService = new MockSearchService();
|
|
1315
|
-
const el = await fixture(html `<collection-browser
|
|
1316
|
-
.searchService=${searchService}
|
|
1317
|
-
.withinCollection=${'foobar'}
|
|
1318
|
-
>
|
|
1315
|
+
const el = await fixture(html `<collection-browser
|
|
1316
|
+
.searchService=${searchService}
|
|
1317
|
+
.withinCollection=${'foobar'}
|
|
1318
|
+
>
|
|
1319
1319
|
</collection-browser>`);
|
|
1320
1320
|
el.withinCollection = 'bar';
|
|
1321
1321
|
await el.updateComplete;
|
|
@@ -1331,11 +1331,11 @@ describe('Collection Browser', () => {
|
|
|
1331
1331
|
});
|
|
1332
1332
|
it('correctly retrieves web archive hits', async () => {
|
|
1333
1333
|
const searchService = new MockSearchService();
|
|
1334
|
-
const el = await fixture(html `<collection-browser
|
|
1335
|
-
.searchService=${searchService}
|
|
1336
|
-
.withinProfile=${'@foo'}
|
|
1337
|
-
.profileElement=${'web_archives'}
|
|
1338
|
-
>
|
|
1334
|
+
const el = await fixture(html `<collection-browser
|
|
1335
|
+
.searchService=${searchService}
|
|
1336
|
+
.withinProfile=${'@foo'}
|
|
1337
|
+
.profileElement=${'web_archives'}
|
|
1338
|
+
>
|
|
1339
1339
|
</collection-browser>`);
|
|
1340
1340
|
el.baseQuery = 'web-archive';
|
|
1341
1341
|
await el.updateComplete;
|
|
@@ -1348,10 +1348,10 @@ describe('Collection Browser', () => {
|
|
|
1348
1348
|
});
|
|
1349
1349
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1350
1350
|
const searchService = new MockSearchService();
|
|
1351
|
-
const el = await fixture(html `<collection-browser
|
|
1352
|
-
.searchService=${searchService}
|
|
1353
|
-
facetLoadStrategy=${'opt-in'}
|
|
1354
|
-
>
|
|
1351
|
+
const el = await fixture(html `<collection-browser
|
|
1352
|
+
.searchService=${searchService}
|
|
1353
|
+
facetLoadStrategy=${'opt-in'}
|
|
1354
|
+
>
|
|
1355
1355
|
</collection-browser>`);
|
|
1356
1356
|
el.baseQuery = 'foo';
|
|
1357
1357
|
await el.updateComplete;
|
|
@@ -1361,10 +1361,10 @@ describe('Collection Browser', () => {
|
|
|
1361
1361
|
});
|
|
1362
1362
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1363
1363
|
const searchService = new MockSearchService();
|
|
1364
|
-
const el = await fixture(html `<collection-browser
|
|
1365
|
-
.searchService=${searchService}
|
|
1366
|
-
facetLoadStrategy=${'off'}
|
|
1367
|
-
>
|
|
1364
|
+
const el = await fixture(html `<collection-browser
|
|
1365
|
+
.searchService=${searchService}
|
|
1366
|
+
facetLoadStrategy=${'off'}
|
|
1367
|
+
>
|
|
1368
1368
|
</collection-browser>`);
|
|
1369
1369
|
el.baseQuery = 'foo';
|
|
1370
1370
|
await el.updateComplete;
|
|
@@ -1375,7 +1375,7 @@ describe('Collection Browser', () => {
|
|
|
1375
1375
|
});
|
|
1376
1376
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1377
1377
|
const searchService = new MockSearchService();
|
|
1378
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1378
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1379
1379
|
</collection-browser>`);
|
|
1380
1380
|
el.baseQuery = 'foo';
|
|
1381
1381
|
await el.updateComplete;
|
|
@@ -1391,11 +1391,11 @@ describe('Collection Browser', () => {
|
|
|
1391
1391
|
});
|
|
1392
1392
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1393
1393
|
const searchService = new MockSearchService();
|
|
1394
|
-
const el = await fixture(html `<collection-browser
|
|
1395
|
-
.searchService=${searchService}
|
|
1396
|
-
.baseQuery=${'foo'}
|
|
1397
|
-
.displayMode=${'list-detail'}
|
|
1398
|
-
>
|
|
1394
|
+
const el = await fixture(html `<collection-browser
|
|
1395
|
+
.searchService=${searchService}
|
|
1396
|
+
.baseQuery=${'foo'}
|
|
1397
|
+
.displayMode=${'list-detail'}
|
|
1398
|
+
>
|
|
1399
1399
|
</collection-browser>`);
|
|
1400
1400
|
el.isManageView = true;
|
|
1401
1401
|
await el.updateComplete;
|
|
@@ -1403,10 +1403,10 @@ describe('Collection Browser', () => {
|
|
|
1403
1403
|
});
|
|
1404
1404
|
it('can remove all checked tiles', async () => {
|
|
1405
1405
|
const searchService = new MockSearchService();
|
|
1406
|
-
const el = await fixture(html `<collection-browser
|
|
1407
|
-
.searchService=${searchService}
|
|
1408
|
-
.baseNavigationUrl=${''}
|
|
1409
|
-
>
|
|
1406
|
+
const el = await fixture(html `<collection-browser
|
|
1407
|
+
.searchService=${searchService}
|
|
1408
|
+
.baseNavigationUrl=${''}
|
|
1409
|
+
>
|
|
1410
1410
|
</collection-browser>`);
|
|
1411
1411
|
el.baseQuery = 'foo';
|
|
1412
1412
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1444,10 +1444,10 @@ describe('Collection Browser', () => {
|
|
|
1444
1444
|
});
|
|
1445
1445
|
it('can check/uncheck all tiles', async () => {
|
|
1446
1446
|
const searchService = new MockSearchService();
|
|
1447
|
-
const el = await fixture(html `<collection-browser
|
|
1448
|
-
.searchService=${searchService}
|
|
1449
|
-
.baseNavigationUrl=${''}
|
|
1450
|
-
>
|
|
1447
|
+
const el = await fixture(html `<collection-browser
|
|
1448
|
+
.searchService=${searchService}
|
|
1449
|
+
.baseNavigationUrl=${''}
|
|
1450
|
+
>
|
|
1451
1451
|
</collection-browser>`);
|
|
1452
1452
|
el.baseQuery = 'foo';
|
|
1453
1453
|
await el.updateComplete;
|
|
@@ -1466,10 +1466,10 @@ describe('Collection Browser', () => {
|
|
|
1466
1466
|
it('emits event when manage view state changes', async () => {
|
|
1467
1467
|
const spy = sinon.spy();
|
|
1468
1468
|
const searchService = new MockSearchService();
|
|
1469
|
-
const el = await fixture(html `<collection-browser
|
|
1470
|
-
.searchService=${searchService}
|
|
1471
|
-
.baseNavigationUrl=${''}
|
|
1472
|
-
@manageModeChanged=${spy}
|
|
1469
|
+
const el = await fixture(html `<collection-browser
|
|
1470
|
+
.searchService=${searchService}
|
|
1471
|
+
.baseNavigationUrl=${''}
|
|
1472
|
+
@manageModeChanged=${spy}
|
|
1473
1473
|
></collection-browser>`);
|
|
1474
1474
|
el.isManageView = true;
|
|
1475
1475
|
await el.updateComplete;
|
|
@@ -1483,11 +1483,11 @@ describe('Collection Browser', () => {
|
|
|
1483
1483
|
it('emits event when item removal requested', async () => {
|
|
1484
1484
|
const spy = sinon.spy();
|
|
1485
1485
|
const searchService = new MockSearchService();
|
|
1486
|
-
const el = await fixture(html `<collection-browser
|
|
1487
|
-
.searchService=${searchService}
|
|
1488
|
-
.baseNavigationUrl=${''}
|
|
1489
|
-
@itemRemovalRequested=${spy}
|
|
1490
|
-
>
|
|
1486
|
+
const el = await fixture(html `<collection-browser
|
|
1487
|
+
.searchService=${searchService}
|
|
1488
|
+
.baseNavigationUrl=${''}
|
|
1489
|
+
@itemRemovalRequested=${spy}
|
|
1490
|
+
>
|
|
1491
1491
|
</collection-browser>`);
|
|
1492
1492
|
el.baseQuery = 'foo';
|
|
1493
1493
|
await el.updateComplete;
|
|
@@ -1516,10 +1516,10 @@ describe('Collection Browser', () => {
|
|
|
1516
1516
|
});
|
|
1517
1517
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1518
1518
|
const searchService = new MockSearchService();
|
|
1519
|
-
const el = await fixture(html `<collection-browser
|
|
1520
|
-
.searchService=${searchService}
|
|
1521
|
-
.baseNavigationUrl=${''}
|
|
1522
|
-
>
|
|
1519
|
+
const el = await fixture(html `<collection-browser
|
|
1520
|
+
.searchService=${searchService}
|
|
1521
|
+
.baseNavigationUrl=${''}
|
|
1522
|
+
>
|
|
1523
1523
|
</collection-browser>`);
|
|
1524
1524
|
el.baseQuery = 'foo';
|
|
1525
1525
|
await el.updateComplete;
|
|
@@ -1535,7 +1535,7 @@ describe('Collection Browser', () => {
|
|
|
1535
1535
|
});
|
|
1536
1536
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1537
1537
|
const searchService = new MockSearchService();
|
|
1538
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1538
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1539
1539
|
</collection-browser>`);
|
|
1540
1540
|
el.baseQuery = 'foo';
|
|
1541
1541
|
await el.updateComplete;
|
|
@@ -1562,10 +1562,10 @@ describe('Collection Browser', () => {
|
|
|
1562
1562
|
});
|
|
1563
1563
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1564
1564
|
const searchService = new MockSearchService();
|
|
1565
|
-
const el = await fixture(html `<collection-browser
|
|
1566
|
-
.baseNavigationUrl=${''}
|
|
1567
|
-
.searchService=${searchService}
|
|
1568
|
-
>
|
|
1565
|
+
const el = await fixture(html `<collection-browser
|
|
1566
|
+
.baseNavigationUrl=${''}
|
|
1567
|
+
.searchService=${searchService}
|
|
1568
|
+
>
|
|
1569
1569
|
</collection-browser>`);
|
|
1570
1570
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1571
1571
|
await el.updateComplete;
|
|
@@ -1576,10 +1576,10 @@ describe('Collection Browser', () => {
|
|
|
1576
1576
|
});
|
|
1577
1577
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1578
1578
|
const searchService = new MockSearchService();
|
|
1579
|
-
const el = await fixture(html `<collection-browser
|
|
1580
|
-
.baseNavigationUrl=${''}
|
|
1581
|
-
.searchService=${searchService}
|
|
1582
|
-
>
|
|
1579
|
+
const el = await fixture(html `<collection-browser
|
|
1580
|
+
.baseNavigationUrl=${''}
|
|
1581
|
+
.searchService=${searchService}
|
|
1582
|
+
>
|
|
1583
1583
|
</collection-browser>`);
|
|
1584
1584
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1585
1585
|
await el.updateComplete;
|
|
@@ -1590,10 +1590,10 @@ describe('Collection Browser', () => {
|
|
|
1590
1590
|
});
|
|
1591
1591
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1592
1592
|
const searchService = new MockSearchService();
|
|
1593
|
-
const el = await fixture(html `<collection-browser
|
|
1594
|
-
.baseNavigationUrl=${''}
|
|
1595
|
-
.searchService=${searchService}
|
|
1596
|
-
>
|
|
1593
|
+
const el = await fixture(html `<collection-browser
|
|
1594
|
+
.baseNavigationUrl=${''}
|
|
1595
|
+
.searchService=${searchService}
|
|
1596
|
+
>
|
|
1597
1597
|
</collection-browser>`);
|
|
1598
1598
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1599
1599
|
await el.updateComplete;
|
|
@@ -1608,11 +1608,11 @@ describe('Collection Browser', () => {
|
|
|
1608
1608
|
});
|
|
1609
1609
|
it('applies loans tab properties to sort bar', async () => {
|
|
1610
1610
|
const searchService = new MockSearchService();
|
|
1611
|
-
const el = await fixture(html `<collection-browser
|
|
1612
|
-
.baseNavigationUrl=${''}
|
|
1613
|
-
.searchService=${searchService}
|
|
1614
|
-
.enableSortOptionsSlot=${true}
|
|
1615
|
-
>
|
|
1611
|
+
const el = await fixture(html `<collection-browser
|
|
1612
|
+
.baseNavigationUrl=${''}
|
|
1613
|
+
.searchService=${searchService}
|
|
1614
|
+
.enableSortOptionsSlot=${true}
|
|
1615
|
+
>
|
|
1616
1616
|
</collection-browser>`);
|
|
1617
1617
|
el.baseQuery = 'collection:foo';
|
|
1618
1618
|
await el.updateComplete;
|
|
@@ -1626,9 +1626,9 @@ describe('Collection Browser', () => {
|
|
|
1626
1626
|
});
|
|
1627
1627
|
it('can suppress presence of result count', async () => {
|
|
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;
|
|
@@ -1638,9 +1638,9 @@ describe('Collection Browser', () => {
|
|
|
1638
1638
|
});
|
|
1639
1639
|
it('can suppress presence of result tiles', async () => {
|
|
1640
1640
|
const searchService = new MockSearchService();
|
|
1641
|
-
const el = await fixture(html `<collection-browser
|
|
1642
|
-
.searchService=${searchService}
|
|
1643
|
-
suppressResultTiles
|
|
1641
|
+
const el = await fixture(html `<collection-browser
|
|
1642
|
+
.searchService=${searchService}
|
|
1643
|
+
suppressResultTiles
|
|
1644
1644
|
></collection-browser>`);
|
|
1645
1645
|
el.baseQuery = 'collection:foo';
|
|
1646
1646
|
await el.updateComplete;
|
|
@@ -1653,7 +1653,7 @@ describe('Collection Browser', () => {
|
|
|
1653
1653
|
asyncResponse: true,
|
|
1654
1654
|
resultsSpy,
|
|
1655
1655
|
});
|
|
1656
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1656
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1657
1657
|
</collection-browser>`);
|
|
1658
1658
|
const numberOfPages = 15;
|
|
1659
1659
|
el.baseQuery = 'jack';
|