@internetarchive/collection-browser 3.1.1-alpha-webdev6778.7 → 3.1.1-alpha-webdev6778.9
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.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/models.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +75 -75
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +54 -54
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.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 +1 -3
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/expanded-date-picker.js +52 -52
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/manage/manage-bar.js +77 -77
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +376 -376
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/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/search-tile.js +42 -42
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +119 -119
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +97 -97
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/utils/analytics-events.js.map +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/test/collection-browser.test.js +187 -187
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +23 -23
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +20 -20
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +37 -37
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +64 -64
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +57 -57
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/package.json +2 -2
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +1 -1
- package/src/collection-facets/facet-row.ts +296 -296
- package/src/collection-facets/models.ts +10 -10
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +437 -437
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +185 -185
- package/src/data-source/collection-browser-data-source-interface.ts +333 -333
- package/src/data-source/collection-browser-data-source.ts +2 -4
- package/src/data-source/models.ts +43 -43
- package/src/expanded-date-picker.ts +191 -191
- package/src/manage/manage-bar.ts +247 -247
- package/src/models.ts +870 -870
- package/src/sort-filter-bar/sort-filter-bar.ts +1283 -1283
- package/src/tiles/base-tile-component.ts +53 -53
- package/src/tiles/grid/account-tile.ts +112 -112
- package/src/tiles/grid/search-tile.ts +90 -90
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
- package/src/tiles/list/tile-list-compact.ts +236 -236
- package/src/utils/analytics-events.ts +29 -29
- package/src/utils/format-date.ts +42 -42
- package/test/collection-browser.test.ts +2359 -2359
- package/test/collection-facets/facet-row.test.ts +375 -375
- package/test/collection-facets.test.ts +928 -928
- package/test/sort-filter-bar/sort-filter-bar.test.ts +885 -885
- package/test/tiles/grid/item-tile.test.ts +464 -464
- package/test/tiles/list/tile-list-compact.test.ts +228 -228
- package/test/utils/format-date.test.ts +39 -39
|
@@ -71,7 +71,7 @@ describe('Collection Browser', () => {
|
|
|
71
71
|
});
|
|
72
72
|
it('filterBy creator with analytics', async () => {
|
|
73
73
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
74
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
74
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
75
75
|
</collection-browser>`);
|
|
76
76
|
el.searchContext = 'betaSearchService';
|
|
77
77
|
el.selectedSort = 'creator';
|
|
@@ -90,7 +90,7 @@ describe('Collection Browser', () => {
|
|
|
90
90
|
});
|
|
91
91
|
it('filterBy title with analytics', async () => {
|
|
92
92
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
93
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
93
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
94
94
|
</collection-browser>`);
|
|
95
95
|
el.searchContext = 'beta-search-service';
|
|
96
96
|
el.selectedSort = 'title';
|
|
@@ -119,7 +119,7 @@ describe('Collection Browser', () => {
|
|
|
119
119
|
collection: {},
|
|
120
120
|
year: {},
|
|
121
121
|
};
|
|
122
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
122
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
123
123
|
</collection-browser>`);
|
|
124
124
|
el.searchContext = 'search-service';
|
|
125
125
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -166,7 +166,7 @@ describe('Collection Browser', () => {
|
|
|
166
166
|
collection: {},
|
|
167
167
|
year: {},
|
|
168
168
|
};
|
|
169
|
-
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
169
|
+
const el = await fixture(html `<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
170
170
|
</collection-browser>`);
|
|
171
171
|
el.searchContext = 'beta-search-service';
|
|
172
172
|
el.selectedFacets = mockedSelectedFacets;
|
|
@@ -204,7 +204,7 @@ describe('Collection Browser', () => {
|
|
|
204
204
|
it('should render with a sort bar, facets, and infinite scroller', async () => {
|
|
205
205
|
var _a, _b, _c;
|
|
206
206
|
const searchService = new MockSearchService();
|
|
207
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
207
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
208
208
|
</collection-browser>`);
|
|
209
209
|
el.baseQuery = 'hello';
|
|
210
210
|
await el.updateComplete;
|
|
@@ -219,7 +219,7 @@ describe('Collection Browser', () => {
|
|
|
219
219
|
it('queries the search service when given a base query', async () => {
|
|
220
220
|
var _a, _b, _c;
|
|
221
221
|
const searchService = new MockSearchService();
|
|
222
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
222
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
223
223
|
</collection-browser>`);
|
|
224
224
|
el.baseQuery = 'collection:foo';
|
|
225
225
|
await el.updateComplete;
|
|
@@ -230,7 +230,7 @@ describe('Collection Browser', () => {
|
|
|
230
230
|
it('queries the search service with a metadata search', async () => {
|
|
231
231
|
var _a, _b, _c;
|
|
232
232
|
const searchService = new MockSearchService();
|
|
233
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
233
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
234
234
|
</collection-browser>`);
|
|
235
235
|
el.searchType = SearchType.METADATA;
|
|
236
236
|
await el.updateComplete;
|
|
@@ -243,7 +243,7 @@ describe('Collection Browser', () => {
|
|
|
243
243
|
});
|
|
244
244
|
it('can change search type', async () => {
|
|
245
245
|
const searchService = new MockSearchService();
|
|
246
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
246
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
247
247
|
</collection-browser>`);
|
|
248
248
|
el.baseQuery = 'collection:foo';
|
|
249
249
|
await el.updateComplete;
|
|
@@ -255,7 +255,7 @@ describe('Collection Browser', () => {
|
|
|
255
255
|
it('queries the search service with a fulltext search', async () => {
|
|
256
256
|
var _a, _b, _c;
|
|
257
257
|
const searchService = new MockSearchService();
|
|
258
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
258
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
259
259
|
</collection-browser>`);
|
|
260
260
|
el.searchType = SearchType.FULLTEXT;
|
|
261
261
|
await el.updateComplete;
|
|
@@ -269,7 +269,7 @@ describe('Collection Browser', () => {
|
|
|
269
269
|
it('queries the search service with a radio search', async () => {
|
|
270
270
|
var _a, _b, _c;
|
|
271
271
|
const searchService = new MockSearchService();
|
|
272
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
272
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
273
273
|
</collection-browser>`);
|
|
274
274
|
el.searchType = SearchType.RADIO;
|
|
275
275
|
await el.updateComplete;
|
|
@@ -283,7 +283,7 @@ describe('Collection Browser', () => {
|
|
|
283
283
|
it('queries the search service with a TV search', async () => {
|
|
284
284
|
var _a, _b, _c;
|
|
285
285
|
const searchService = new MockSearchService();
|
|
286
|
-
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
286
|
+
const el = await fixture(html ` <collection-browser .searchService=${searchService}>
|
|
287
287
|
</collection-browser>`);
|
|
288
288
|
el.searchType = SearchType.TV;
|
|
289
289
|
await el.updateComplete;
|
|
@@ -323,7 +323,7 @@ describe('Collection Browser', () => {
|
|
|
323
323
|
collection: {},
|
|
324
324
|
year: {},
|
|
325
325
|
};
|
|
326
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
326
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
327
327
|
</collection-browser>`);
|
|
328
328
|
el.baseQuery = 'collection:foo';
|
|
329
329
|
el.selectedFacets = selectedFacets;
|
|
@@ -356,7 +356,7 @@ describe('Collection Browser', () => {
|
|
|
356
356
|
url.searchParams.append('sin', 'TXT');
|
|
357
357
|
window.history.replaceState({}, '', url);
|
|
358
358
|
const searchService = new MockSearchService();
|
|
359
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
359
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
360
360
|
</collection-browser>`);
|
|
361
361
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
362
362
|
});
|
|
@@ -366,10 +366,10 @@ describe('Collection Browser', () => {
|
|
|
366
366
|
url.searchParams.append('sin', 'TXT');
|
|
367
367
|
window.history.replaceState({}, '', url);
|
|
368
368
|
const searchService = new MockSearchService();
|
|
369
|
-
const el = await fixture(html `<collection-browser
|
|
370
|
-
.searchService=${searchService}
|
|
371
|
-
suppressURLSinParam
|
|
372
|
-
>
|
|
369
|
+
const el = await fixture(html `<collection-browser
|
|
370
|
+
.searchService=${searchService}
|
|
371
|
+
suppressURLSinParam
|
|
372
|
+
>
|
|
373
373
|
</collection-browser>`);
|
|
374
374
|
url = new URL(window.location.href);
|
|
375
375
|
expect(el.searchType).to.equal(SearchType.DEFAULT);
|
|
@@ -381,7 +381,7 @@ describe('Collection Browser', () => {
|
|
|
381
381
|
});
|
|
382
382
|
it('can construct tile models with many fields present', async () => {
|
|
383
383
|
const searchService = new MockSearchService();
|
|
384
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
384
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
385
385
|
</collection-browser>`);
|
|
386
386
|
el.baseQuery = 'many-fields';
|
|
387
387
|
await el.updateComplete;
|
|
@@ -394,10 +394,10 @@ describe('Collection Browser', () => {
|
|
|
394
394
|
it('emits empty results event when search fetches no results', async () => {
|
|
395
395
|
const searchService = new MockSearchService();
|
|
396
396
|
const emptyResultsSpy = sinon.spy();
|
|
397
|
-
const el = await fixture(html `<collection-browser
|
|
398
|
-
.searchService=${searchService}
|
|
399
|
-
@emptyResults=${emptyResultsSpy}
|
|
400
|
-
>
|
|
397
|
+
const el = await fixture(html `<collection-browser
|
|
398
|
+
.searchService=${searchService}
|
|
399
|
+
@emptyResults=${emptyResultsSpy}
|
|
400
|
+
>
|
|
401
401
|
</collection-browser>`);
|
|
402
402
|
el.baseQuery = 'no-results';
|
|
403
403
|
await el.updateComplete;
|
|
@@ -407,10 +407,10 @@ describe('Collection Browser', () => {
|
|
|
407
407
|
it('emits searchError event when search results in an error', async () => {
|
|
408
408
|
const searchService = new MockSearchService();
|
|
409
409
|
const searchErrorSpy = sinon.spy();
|
|
410
|
-
const el = await fixture(html `<collection-browser
|
|
411
|
-
.searchService=${searchService}
|
|
412
|
-
@searchError=${searchErrorSpy}
|
|
413
|
-
>
|
|
410
|
+
const el = await fixture(html `<collection-browser
|
|
411
|
+
.searchService=${searchService}
|
|
412
|
+
@searchError=${searchErrorSpy}
|
|
413
|
+
>
|
|
414
414
|
</collection-browser>`);
|
|
415
415
|
el.baseQuery = 'error';
|
|
416
416
|
await el.updateComplete;
|
|
@@ -420,7 +420,7 @@ describe('Collection Browser', () => {
|
|
|
420
420
|
it('applies loggedin flag to tile models if needed', async () => {
|
|
421
421
|
var _a;
|
|
422
422
|
const searchService = new MockSearchService();
|
|
423
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
423
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
424
424
|
</collection-browser>`);
|
|
425
425
|
el.baseQuery = 'loggedin';
|
|
426
426
|
await el.updateComplete;
|
|
@@ -434,7 +434,7 @@ describe('Collection Browser', () => {
|
|
|
434
434
|
it('applies no-preview flag to tile models if needed', async () => {
|
|
435
435
|
var _a;
|
|
436
436
|
const searchService = new MockSearchService();
|
|
437
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
437
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
438
438
|
</collection-browser>`);
|
|
439
439
|
el.baseQuery = 'no-preview';
|
|
440
440
|
await el.updateComplete;
|
|
@@ -448,7 +448,7 @@ describe('Collection Browser', () => {
|
|
|
448
448
|
it('both loggedin and no-preview flags can be set simultaneously', async () => {
|
|
449
449
|
var _a, _b;
|
|
450
450
|
const searchService = new MockSearchService();
|
|
451
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
451
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
452
452
|
</collection-browser>`);
|
|
453
453
|
el.baseQuery = 'loggedin-no-preview';
|
|
454
454
|
await el.updateComplete;
|
|
@@ -463,7 +463,7 @@ describe('Collection Browser', () => {
|
|
|
463
463
|
it('joins full description array into a single string with line breaks', async () => {
|
|
464
464
|
var _a;
|
|
465
465
|
const searchService = new MockSearchService();
|
|
466
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
466
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
467
467
|
</collection-browser>`);
|
|
468
468
|
// This query receives an array description like ['line1', 'line2']
|
|
469
469
|
el.baseQuery = 'multi-line-description';
|
|
@@ -479,9 +479,9 @@ describe('Collection Browser', () => {
|
|
|
479
479
|
it('can change search type', async () => {
|
|
480
480
|
var _a;
|
|
481
481
|
const searchService = new MockSearchService();
|
|
482
|
-
const el = await fixture(html `<collection-browser
|
|
483
|
-
.searchService=${searchService}
|
|
484
|
-
.searchType=${SearchType.METADATA}
|
|
482
|
+
const el = await fixture(html `<collection-browser
|
|
483
|
+
.searchService=${searchService}
|
|
484
|
+
.searchType=${SearchType.METADATA}
|
|
485
485
|
></collection-browser>`);
|
|
486
486
|
el.baseQuery = 'collection:foo';
|
|
487
487
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -493,8 +493,8 @@ describe('Collection Browser', () => {
|
|
|
493
493
|
it('trims queries of leading/trailing whitespace', async () => {
|
|
494
494
|
var _a;
|
|
495
495
|
const searchService = new MockSearchService();
|
|
496
|
-
const el = await fixture(html `<collection-browser
|
|
497
|
-
.searchService=${searchService}
|
|
496
|
+
const el = await fixture(html `<collection-browser
|
|
497
|
+
.searchService=${searchService}
|
|
498
498
|
></collection-browser>`);
|
|
499
499
|
el.baseQuery = ' collection:foo ';
|
|
500
500
|
await el.updateComplete;
|
|
@@ -504,8 +504,8 @@ describe('Collection Browser', () => {
|
|
|
504
504
|
it('shows error message when error response received', async () => {
|
|
505
505
|
var _a, _b;
|
|
506
506
|
const searchService = new MockSearchService();
|
|
507
|
-
const el = await fixture(html `<collection-browser
|
|
508
|
-
.searchService=${searchService}
|
|
507
|
+
const el = await fixture(html `<collection-browser
|
|
508
|
+
.searchService=${searchService}
|
|
509
509
|
></collection-browser>`);
|
|
510
510
|
el.baseQuery = 'error';
|
|
511
511
|
await el.updateComplete;
|
|
@@ -518,8 +518,8 @@ describe('Collection Browser', () => {
|
|
|
518
518
|
it('shows error message when error response received for a collection', async () => {
|
|
519
519
|
var _a, _b;
|
|
520
520
|
const searchService = new MockSearchService();
|
|
521
|
-
const el = await fixture(html `<collection-browser
|
|
522
|
-
.searchService=${searchService}
|
|
521
|
+
const el = await fixture(html `<collection-browser
|
|
522
|
+
.searchService=${searchService}
|
|
523
523
|
></collection-browser>`);
|
|
524
524
|
el.withinCollection = 'error';
|
|
525
525
|
await el.updateComplete;
|
|
@@ -534,8 +534,8 @@ describe('Collection Browser', () => {
|
|
|
534
534
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
535
535
|
window.Sentry = { captureMessage: sentrySpy };
|
|
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 = 'malformed';
|
|
541
541
|
await el.updateComplete;
|
|
@@ -544,7 +544,7 @@ describe('Collection Browser', () => {
|
|
|
544
544
|
});
|
|
545
545
|
it('adds collection names to cache when present on response', async () => {
|
|
546
546
|
const searchService = new MockSearchService();
|
|
547
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
547
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
548
548
|
</collection-browser>`);
|
|
549
549
|
el.baseQuery = 'collection-titles';
|
|
550
550
|
await el.updateComplete;
|
|
@@ -556,7 +556,7 @@ describe('Collection Browser', () => {
|
|
|
556
556
|
});
|
|
557
557
|
it('adds tv channel aliases 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 = 'channel-aliases';
|
|
562
562
|
await el.updateComplete;
|
|
@@ -570,7 +570,7 @@ describe('Collection Browser', () => {
|
|
|
570
570
|
asyncResponse: true,
|
|
571
571
|
resultsSpy,
|
|
572
572
|
});
|
|
573
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
573
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
574
574
|
</collection-browser>`);
|
|
575
575
|
el.baseQuery = 'with-sort';
|
|
576
576
|
el.selectedSort = SortField.date;
|
|
@@ -587,7 +587,7 @@ describe('Collection Browser', () => {
|
|
|
587
587
|
asyncResponse: true,
|
|
588
588
|
resultsSpy,
|
|
589
589
|
});
|
|
590
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
590
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
591
591
|
</collection-browser>`);
|
|
592
592
|
el.baseQuery = 'with-sort';
|
|
593
593
|
el.selectedSort = SortField.date;
|
|
@@ -609,7 +609,7 @@ describe('Collection Browser', () => {
|
|
|
609
609
|
asyncResponse: true,
|
|
610
610
|
resultsSpy,
|
|
611
611
|
});
|
|
612
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
612
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
613
613
|
</collection-browser>`);
|
|
614
614
|
el.baseQuery = 'single-result';
|
|
615
615
|
await el.updateComplete;
|
|
@@ -630,7 +630,7 @@ describe('Collection Browser', () => {
|
|
|
630
630
|
asyncResponse: true,
|
|
631
631
|
resultsSpy,
|
|
632
632
|
});
|
|
633
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
633
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
634
634
|
</collection-browser>`);
|
|
635
635
|
el.baseQuery = 'with-sort';
|
|
636
636
|
el.selectedSort = SortField.date;
|
|
@@ -649,7 +649,7 @@ describe('Collection Browser', () => {
|
|
|
649
649
|
it('sets sort properties when user changes sort', async () => {
|
|
650
650
|
var _a, _b, _c, _d, _e, _f;
|
|
651
651
|
const searchService = new MockSearchService();
|
|
652
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
652
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
653
653
|
</collection-browser>`);
|
|
654
654
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
655
655
|
el.baseQuery = 'foo';
|
|
@@ -672,7 +672,7 @@ describe('Collection Browser', () => {
|
|
|
672
672
|
it('sets sort filter properties when user selects title filter', async () => {
|
|
673
673
|
var _a, _b, _c, _d;
|
|
674
674
|
const searchService = new MockSearchService();
|
|
675
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
675
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
676
676
|
</collection-browser>`);
|
|
677
677
|
el.baseQuery = 'first-title';
|
|
678
678
|
el.selectedSort = 'title';
|
|
@@ -686,7 +686,7 @@ describe('Collection Browser', () => {
|
|
|
686
686
|
it('sets sort filter properties when user selects creator filter', async () => {
|
|
687
687
|
var _a, _b, _c, _d;
|
|
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-creator';
|
|
692
692
|
el.selectedSort = 'creator';
|
|
@@ -709,7 +709,7 @@ describe('Collection Browser', () => {
|
|
|
709
709
|
subject: {},
|
|
710
710
|
year: {},
|
|
711
711
|
};
|
|
712
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
712
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
713
713
|
</collection-browser>`);
|
|
714
714
|
el.baseQuery = 'first-creator';
|
|
715
715
|
el.selectedSort = 'creator';
|
|
@@ -737,7 +737,7 @@ describe('Collection Browser', () => {
|
|
|
737
737
|
it('applies correct search filter when TV clip filter set to commercials', async () => {
|
|
738
738
|
var _a, _b, _c;
|
|
739
739
|
const searchService = new MockSearchService();
|
|
740
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
740
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
741
741
|
</collection-browser>`);
|
|
742
742
|
el.baseQuery = 'tv-fields';
|
|
743
743
|
el.searchType = SearchType.TV;
|
|
@@ -749,7 +749,7 @@ describe('Collection Browser', () => {
|
|
|
749
749
|
it('applies correct search filter when TV clip filter set to factchecks', async () => {
|
|
750
750
|
var _a, _b, _c;
|
|
751
751
|
const searchService = new MockSearchService();
|
|
752
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
752
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
753
753
|
</collection-browser>`);
|
|
754
754
|
el.baseQuery = 'tv-fields';
|
|
755
755
|
el.searchType = SearchType.TV;
|
|
@@ -761,7 +761,7 @@ describe('Collection Browser', () => {
|
|
|
761
761
|
it('applies correct search filter when TV clip filter set to quotes', async () => {
|
|
762
762
|
var _a, _b, _c;
|
|
763
763
|
const searchService = new MockSearchService();
|
|
764
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
764
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
765
765
|
</collection-browser>`);
|
|
766
766
|
el.baseQuery = 'tv-fields';
|
|
767
767
|
el.searchType = SearchType.TV;
|
|
@@ -773,7 +773,7 @@ describe('Collection Browser', () => {
|
|
|
773
773
|
it('resets letter filters when query changes', async () => {
|
|
774
774
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
775
775
|
const searchService = new MockSearchService();
|
|
776
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
776
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
777
777
|
</collection-browser>`);
|
|
778
778
|
el.baseQuery = 'first-creator';
|
|
779
779
|
el.selectedSort = 'creator';
|
|
@@ -794,11 +794,11 @@ describe('Collection Browser', () => {
|
|
|
794
794
|
var _a, _b, _c;
|
|
795
795
|
const searchService = new MockSearchService();
|
|
796
796
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
797
|
-
const el = await fixture(html `<collection-browser
|
|
798
|
-
.searchService=${searchService}
|
|
799
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
800
|
-
.suppressPlaceholders=${true}
|
|
801
|
-
>
|
|
797
|
+
const el = await fixture(html `<collection-browser
|
|
798
|
+
.searchService=${searchService}
|
|
799
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
800
|
+
.suppressPlaceholders=${true}
|
|
801
|
+
>
|
|
802
802
|
</collection-browser>`);
|
|
803
803
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
804
804
|
el.showHistogramDatePicker = true;
|
|
@@ -827,10 +827,10 @@ describe('Collection Browser', () => {
|
|
|
827
827
|
it('sets date range query when monthly date picker selection changed', async () => {
|
|
828
828
|
var _a, _b, _c;
|
|
829
829
|
const searchService = new MockSearchService();
|
|
830
|
-
const el = await fixture(html `<collection-browser
|
|
831
|
-
.searchService=${searchService}
|
|
832
|
-
.suppressPlaceholders=${true}
|
|
833
|
-
>
|
|
830
|
+
const el = await fixture(html `<collection-browser
|
|
831
|
+
.searchService=${searchService}
|
|
832
|
+
.suppressPlaceholders=${true}
|
|
833
|
+
>
|
|
834
834
|
</collection-browser>`);
|
|
835
835
|
el.baseQuery = 'months'; // Includes date_histogram aggregation in response
|
|
836
836
|
el.searchType = SearchType.TV;
|
|
@@ -861,9 +861,9 @@ describe('Collection Browser', () => {
|
|
|
861
861
|
var _a, _b, _c, _d;
|
|
862
862
|
const spy = sinon.spy();
|
|
863
863
|
const searchService = new MockSearchService();
|
|
864
|
-
const el = await fixture(html `<collection-browser
|
|
865
|
-
.searchService=${searchService}
|
|
866
|
-
@searchResultsLoadingChanged=${spy}
|
|
864
|
+
const el = await fixture(html `<collection-browser
|
|
865
|
+
.searchService=${searchService}
|
|
866
|
+
@searchResultsLoadingChanged=${spy}
|
|
867
867
|
></collection-browser>`);
|
|
868
868
|
spy.resetHistory();
|
|
869
869
|
el.baseQuery = 'collection:foo';
|
|
@@ -877,9 +877,9 @@ describe('Collection Browser', () => {
|
|
|
877
877
|
it('collapses extra set of quotes around href field', async () => {
|
|
878
878
|
var _a;
|
|
879
879
|
const searchService = new MockSearchService();
|
|
880
|
-
const el = await fixture(html `<collection-browser
|
|
881
|
-
.searchService=${searchService}
|
|
882
|
-
.baseNavigationUrl=${''}
|
|
880
|
+
const el = await fixture(html `<collection-browser
|
|
881
|
+
.searchService=${searchService}
|
|
882
|
+
.baseNavigationUrl=${''}
|
|
883
883
|
></collection-browser>`);
|
|
884
884
|
el.baseQuery = 'extra-quoted-href';
|
|
885
885
|
await el.updateComplete;
|
|
@@ -892,9 +892,9 @@ describe('Collection Browser', () => {
|
|
|
892
892
|
it('sets default sort from collection metadata', async () => {
|
|
893
893
|
var _a;
|
|
894
894
|
const searchService = new MockSearchService();
|
|
895
|
-
const el = await fixture(html `<collection-browser
|
|
896
|
-
.searchService=${searchService}
|
|
897
|
-
.baseNavigationUrl=${''}
|
|
895
|
+
const el = await fixture(html `<collection-browser
|
|
896
|
+
.searchService=${searchService}
|
|
897
|
+
.baseNavigationUrl=${''}
|
|
898
898
|
></collection-browser>`);
|
|
899
899
|
el.withinCollection = 'default-sort';
|
|
900
900
|
await el.updateComplete;
|
|
@@ -911,9 +911,9 @@ describe('Collection Browser', () => {
|
|
|
911
911
|
it('sets default sort from collection metadata in "-field" format', async () => {
|
|
912
912
|
var _a;
|
|
913
913
|
const searchService = new MockSearchService();
|
|
914
|
-
const el = await fixture(html `<collection-browser
|
|
915
|
-
.searchService=${searchService}
|
|
916
|
-
.baseNavigationUrl=${''}
|
|
914
|
+
const el = await fixture(html `<collection-browser
|
|
915
|
+
.searchService=${searchService}
|
|
916
|
+
.baseNavigationUrl=${''}
|
|
917
917
|
></collection-browser>`);
|
|
918
918
|
el.withinCollection = 'default-sort-concise';
|
|
919
919
|
await el.updateComplete;
|
|
@@ -928,8 +928,8 @@ describe('Collection Browser', () => {
|
|
|
928
928
|
expect(sortBar.sortDirection).to.be.null;
|
|
929
929
|
});
|
|
930
930
|
it('falls back to weekly views default sorting on profiles when tab not set', async () => {
|
|
931
|
-
const el = await fixture(html `<collection-browser
|
|
932
|
-
.withinProfile=${'@foobar'}
|
|
931
|
+
const el = await fixture(html `<collection-browser
|
|
932
|
+
.withinProfile=${'@foobar'}
|
|
933
933
|
></collection-browser>`);
|
|
934
934
|
el.applyDefaultProfileSort();
|
|
935
935
|
expect(el.defaultSortParam).to.deep.equal({
|
|
@@ -940,9 +940,9 @@ describe('Collection Browser', () => {
|
|
|
940
940
|
it('uses relevance sort as default when a query is set', async () => {
|
|
941
941
|
var _a;
|
|
942
942
|
const searchService = new MockSearchService();
|
|
943
|
-
const el = await fixture(html `<collection-browser
|
|
944
|
-
.searchService=${searchService}
|
|
945
|
-
.baseNavigationUrl=${''}
|
|
943
|
+
const el = await fixture(html `<collection-browser
|
|
944
|
+
.searchService=${searchService}
|
|
945
|
+
.baseNavigationUrl=${''}
|
|
946
946
|
></collection-browser>`);
|
|
947
947
|
el.withinCollection = 'default-sort';
|
|
948
948
|
el.baseQuery = 'default-sort';
|
|
@@ -960,9 +960,9 @@ describe('Collection Browser', () => {
|
|
|
960
960
|
it('uses date favorited sort as default when targeting fav- collection', async () => {
|
|
961
961
|
var _a;
|
|
962
962
|
const searchService = new MockSearchService();
|
|
963
|
-
const el = await fixture(html `<collection-browser
|
|
964
|
-
.searchService=${searchService}
|
|
965
|
-
.baseNavigationUrl=${''}
|
|
963
|
+
const el = await fixture(html `<collection-browser
|
|
964
|
+
.searchService=${searchService}
|
|
965
|
+
.baseNavigationUrl=${''}
|
|
966
966
|
></collection-browser>`);
|
|
967
967
|
el.withinCollection = 'fav-sort';
|
|
968
968
|
await el.updateComplete;
|
|
@@ -979,7 +979,7 @@ describe('Collection Browser', () => {
|
|
|
979
979
|
it('scrolls to page', async () => {
|
|
980
980
|
var _a;
|
|
981
981
|
const searchService = new MockSearchService();
|
|
982
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
982
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
983
983
|
</collection-browser>`);
|
|
984
984
|
// Infinite scroller won't exist unless there's a base query.
|
|
985
985
|
// First ensure that we don't throw errors when it doesn't exist.
|
|
@@ -1001,9 +1001,9 @@ describe('Collection Browser', () => {
|
|
|
1001
1001
|
it('shows mobile facets in mobile view', async () => {
|
|
1002
1002
|
var _a, _b;
|
|
1003
1003
|
const searchService = new MockSearchService();
|
|
1004
|
-
const el = await fixture(html `<collection-browser
|
|
1005
|
-
.searchService=${searchService}
|
|
1006
|
-
.mobileBreakpoint=${9999}
|
|
1004
|
+
const el = await fixture(html `<collection-browser
|
|
1005
|
+
.searchService=${searchService}
|
|
1006
|
+
.mobileBreakpoint=${9999}
|
|
1007
1007
|
></collection-browser>`);
|
|
1008
1008
|
el.baseQuery = 'collection:foo';
|
|
1009
1009
|
await el.updateComplete;
|
|
@@ -1023,11 +1023,11 @@ describe('Collection Browser', () => {
|
|
|
1023
1023
|
var _a, _b;
|
|
1024
1024
|
const searchService = new MockSearchService();
|
|
1025
1025
|
const analyticsHandler = new MockAnalyticsHandler();
|
|
1026
|
-
const el = await fixture(html `<collection-browser
|
|
1027
|
-
.searchService=${searchService}
|
|
1028
|
-
.analyticsHandler=${analyticsHandler}
|
|
1029
|
-
.searchContext=${'foobar-context'}
|
|
1030
|
-
.mobileBreakpoint=${9999}
|
|
1026
|
+
const el = await fixture(html `<collection-browser
|
|
1027
|
+
.searchService=${searchService}
|
|
1028
|
+
.analyticsHandler=${analyticsHandler}
|
|
1029
|
+
.searchContext=${'foobar-context'}
|
|
1030
|
+
.mobileBreakpoint=${9999}
|
|
1031
1031
|
></collection-browser>`);
|
|
1032
1032
|
el.baseQuery = 'collection:foo';
|
|
1033
1033
|
await el.updateComplete;
|
|
@@ -1067,9 +1067,9 @@ describe('Collection Browser', () => {
|
|
|
1067
1067
|
});
|
|
1068
1068
|
it('sets parent collections to prop when searching a collection', async () => {
|
|
1069
1069
|
const searchService = new MockSearchService();
|
|
1070
|
-
const el = await fixture(html `<collection-browser
|
|
1071
|
-
.searchService=${searchService}
|
|
1072
|
-
.withinCollection=${'fake'}
|
|
1070
|
+
const el = await fixture(html `<collection-browser
|
|
1071
|
+
.searchService=${searchService}
|
|
1072
|
+
.withinCollection=${'fake'}
|
|
1073
1073
|
></collection-browser>`);
|
|
1074
1074
|
el.baseQuery = 'parent-collections';
|
|
1075
1075
|
await el.updateComplete;
|
|
@@ -1079,9 +1079,9 @@ describe('Collection Browser', () => {
|
|
|
1079
1079
|
});
|
|
1080
1080
|
it('recognizes TV collections', async () => {
|
|
1081
1081
|
const searchService = new MockSearchService();
|
|
1082
|
-
const el = await fixture(html `<collection-browser
|
|
1083
|
-
.searchService=${searchService}
|
|
1084
|
-
.withinCollection=${'TV-FOO'}
|
|
1082
|
+
const el = await fixture(html `<collection-browser
|
|
1083
|
+
.searchService=${searchService}
|
|
1084
|
+
.withinCollection=${'TV-FOO'}
|
|
1085
1085
|
></collection-browser>`);
|
|
1086
1086
|
el.baseQuery = 'tv-collection';
|
|
1087
1087
|
await el.updateComplete;
|
|
@@ -1093,9 +1093,9 @@ describe('Collection Browser', () => {
|
|
|
1093
1093
|
var _a;
|
|
1094
1094
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
1095
1095
|
const searchService = new MockSearchService();
|
|
1096
|
-
const el = await fixture(html `<collection-browser
|
|
1097
|
-
.analyticsHandler=${mockAnalyticsHandler}
|
|
1098
|
-
.searchService=${searchService}
|
|
1096
|
+
const el = await fixture(html `<collection-browser
|
|
1097
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
1098
|
+
.searchService=${searchService}
|
|
1099
1099
|
></collection-browser>`);
|
|
1100
1100
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1101
1101
|
// Infinite scroller won't exist unless there's a base query
|
|
@@ -1141,7 +1141,7 @@ describe('Collection Browser', () => {
|
|
|
1141
1141
|
it('query the search service for single result', async () => {
|
|
1142
1142
|
var _a, _b;
|
|
1143
1143
|
const searchService = new MockSearchService();
|
|
1144
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1144
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1145
1145
|
</collection-browser>`);
|
|
1146
1146
|
el.baseQuery = 'single-result';
|
|
1147
1147
|
await el.updateComplete;
|
|
@@ -1170,7 +1170,7 @@ describe('Collection Browser', () => {
|
|
|
1170
1170
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1171
1171
|
window.history.replaceState({}, '', url);
|
|
1172
1172
|
const searchService = new MockSearchService();
|
|
1173
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1173
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1174
1174
|
</collection-browser>`);
|
|
1175
1175
|
await el.initialSearchComplete;
|
|
1176
1176
|
await el.updateComplete;
|
|
@@ -1196,10 +1196,10 @@ describe('Collection Browser', () => {
|
|
|
1196
1196
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1197
1197
|
window.history.replaceState({}, '', url);
|
|
1198
1198
|
const searchService = new MockSearchService();
|
|
1199
|
-
const el = await fixture(html `<collection-browser
|
|
1200
|
-
.searchService=${searchService}
|
|
1201
|
-
.withinCollection=${'foobar'}
|
|
1202
|
-
>
|
|
1199
|
+
const el = await fixture(html `<collection-browser
|
|
1200
|
+
.searchService=${searchService}
|
|
1201
|
+
.withinCollection=${'foobar'}
|
|
1202
|
+
>
|
|
1203
1203
|
</collection-browser>`);
|
|
1204
1204
|
await el.initialSearchComplete;
|
|
1205
1205
|
await el.updateComplete;
|
|
@@ -1224,11 +1224,11 @@ describe('Collection Browser', () => {
|
|
|
1224
1224
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1225
1225
|
window.history.replaceState({}, '', url);
|
|
1226
1226
|
const searchService = new MockSearchService();
|
|
1227
|
-
const el = await fixture(html `<collection-browser
|
|
1228
|
-
.searchService=${searchService}
|
|
1229
|
-
.withinProfile=${'@foobar'}
|
|
1230
|
-
.profileElement=${'uploads'}
|
|
1231
|
-
>
|
|
1227
|
+
const el = await fixture(html `<collection-browser
|
|
1228
|
+
.searchService=${searchService}
|
|
1229
|
+
.withinProfile=${'@foobar'}
|
|
1230
|
+
.profileElement=${'uploads'}
|
|
1231
|
+
>
|
|
1232
1232
|
</collection-browser>`);
|
|
1233
1233
|
await el.initialSearchComplete;
|
|
1234
1234
|
await el.updateComplete;
|
|
@@ -1255,7 +1255,7 @@ describe('Collection Browser', () => {
|
|
|
1255
1255
|
searchParams.append('and[]', 'year:[2000 TO 2010]');
|
|
1256
1256
|
window.history.replaceState({}, '', url);
|
|
1257
1257
|
const searchService = new MockSearchService();
|
|
1258
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1258
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1259
1259
|
</collection-browser>`);
|
|
1260
1260
|
await el.initialSearchComplete;
|
|
1261
1261
|
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;
|
|
@@ -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.withinCollection = 'bar';
|
|
1322
1322
|
await el.updateComplete;
|
|
@@ -1333,11 +1333,11 @@ describe('Collection Browser', () => {
|
|
|
1333
1333
|
it('correctly retrieves web archive hits', async () => {
|
|
1334
1334
|
var _a, _b, _c;
|
|
1335
1335
|
const searchService = new MockSearchService();
|
|
1336
|
-
const el = await fixture(html `<collection-browser
|
|
1337
|
-
.searchService=${searchService}
|
|
1338
|
-
.withinProfile=${'@foo'}
|
|
1339
|
-
.profileElement=${'web_archives'}
|
|
1340
|
-
>
|
|
1336
|
+
const el = await fixture(html `<collection-browser
|
|
1337
|
+
.searchService=${searchService}
|
|
1338
|
+
.withinProfile=${'@foo'}
|
|
1339
|
+
.profileElement=${'web_archives'}
|
|
1340
|
+
>
|
|
1341
1341
|
</collection-browser>`);
|
|
1342
1342
|
el.baseQuery = 'web-archive';
|
|
1343
1343
|
await el.updateComplete;
|
|
@@ -1351,10 +1351,10 @@ describe('Collection Browser', () => {
|
|
|
1351
1351
|
it('shows dropdown accordion in facet sidebar when opt-in strategy is specified', async () => {
|
|
1352
1352
|
var _a;
|
|
1353
1353
|
const searchService = new MockSearchService();
|
|
1354
|
-
const el = await fixture(html `<collection-browser
|
|
1355
|
-
.searchService=${searchService}
|
|
1356
|
-
facetLoadStrategy=${'opt-in'}
|
|
1357
|
-
>
|
|
1354
|
+
const el = await fixture(html `<collection-browser
|
|
1355
|
+
.searchService=${searchService}
|
|
1356
|
+
facetLoadStrategy=${'opt-in'}
|
|
1357
|
+
>
|
|
1358
1358
|
</collection-browser>`);
|
|
1359
1359
|
el.baseQuery = 'foo';
|
|
1360
1360
|
await el.updateComplete;
|
|
@@ -1365,10 +1365,10 @@ describe('Collection Browser', () => {
|
|
|
1365
1365
|
it('shows temporarily unavailable message when facets suppressed', async () => {
|
|
1366
1366
|
var _a, _b;
|
|
1367
1367
|
const searchService = new MockSearchService();
|
|
1368
|
-
const el = await fixture(html `<collection-browser
|
|
1369
|
-
.searchService=${searchService}
|
|
1370
|
-
facetLoadStrategy=${'off'}
|
|
1371
|
-
>
|
|
1368
|
+
const el = await fixture(html `<collection-browser
|
|
1369
|
+
.searchService=${searchService}
|
|
1370
|
+
facetLoadStrategy=${'off'}
|
|
1371
|
+
>
|
|
1372
1372
|
</collection-browser>`);
|
|
1373
1373
|
el.baseQuery = 'foo';
|
|
1374
1374
|
await el.updateComplete;
|
|
@@ -1380,7 +1380,7 @@ describe('Collection Browser', () => {
|
|
|
1380
1380
|
it('shows manage bar interface instead of sort bar when in manage view', async () => {
|
|
1381
1381
|
var _a, _b, _c, _d;
|
|
1382
1382
|
const searchService = new MockSearchService();
|
|
1383
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1383
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1384
1384
|
</collection-browser>`);
|
|
1385
1385
|
el.baseQuery = 'foo';
|
|
1386
1386
|
await el.updateComplete;
|
|
@@ -1396,11 +1396,11 @@ describe('Collection Browser', () => {
|
|
|
1396
1396
|
});
|
|
1397
1397
|
it('switches to grid display mode when manage view activated', async () => {
|
|
1398
1398
|
const searchService = new MockSearchService();
|
|
1399
|
-
const el = await fixture(html `<collection-browser
|
|
1400
|
-
.searchService=${searchService}
|
|
1401
|
-
.baseQuery=${'foo'}
|
|
1402
|
-
.displayMode=${'list-detail'}
|
|
1403
|
-
>
|
|
1399
|
+
const el = await fixture(html `<collection-browser
|
|
1400
|
+
.searchService=${searchService}
|
|
1401
|
+
.baseQuery=${'foo'}
|
|
1402
|
+
.displayMode=${'list-detail'}
|
|
1403
|
+
>
|
|
1404
1404
|
</collection-browser>`);
|
|
1405
1405
|
el.isManageView = true;
|
|
1406
1406
|
await el.updateComplete;
|
|
@@ -1409,10 +1409,10 @@ describe('Collection Browser', () => {
|
|
|
1409
1409
|
it('can remove all checked tiles', async () => {
|
|
1410
1410
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1411
1411
|
const searchService = new MockSearchService();
|
|
1412
|
-
const el = await fixture(html `<collection-browser
|
|
1413
|
-
.searchService=${searchService}
|
|
1414
|
-
.baseNavigationUrl=${''}
|
|
1415
|
-
>
|
|
1412
|
+
const el = await fixture(html `<collection-browser
|
|
1413
|
+
.searchService=${searchService}
|
|
1414
|
+
.baseNavigationUrl=${''}
|
|
1415
|
+
>
|
|
1416
1416
|
</collection-browser>`);
|
|
1417
1417
|
el.baseQuery = 'foo';
|
|
1418
1418
|
el.pageSize = 1; // To hit the edge case of a page break while offsetting tiles
|
|
@@ -1448,10 +1448,10 @@ describe('Collection Browser', () => {
|
|
|
1448
1448
|
});
|
|
1449
1449
|
it('can check/uncheck all tiles', async () => {
|
|
1450
1450
|
const searchService = new MockSearchService();
|
|
1451
|
-
const el = await fixture(html `<collection-browser
|
|
1452
|
-
.searchService=${searchService}
|
|
1453
|
-
.baseNavigationUrl=${''}
|
|
1454
|
-
>
|
|
1451
|
+
const el = await fixture(html `<collection-browser
|
|
1452
|
+
.searchService=${searchService}
|
|
1453
|
+
.baseNavigationUrl=${''}
|
|
1454
|
+
>
|
|
1455
1455
|
</collection-browser>`);
|
|
1456
1456
|
el.baseQuery = 'foo';
|
|
1457
1457
|
await el.updateComplete;
|
|
@@ -1471,10 +1471,10 @@ describe('Collection Browser', () => {
|
|
|
1471
1471
|
var _a, _b;
|
|
1472
1472
|
const spy = sinon.spy();
|
|
1473
1473
|
const searchService = new MockSearchService();
|
|
1474
|
-
const el = await fixture(html `<collection-browser
|
|
1475
|
-
.searchService=${searchService}
|
|
1476
|
-
.baseNavigationUrl=${''}
|
|
1477
|
-
@manageModeChanged=${spy}
|
|
1474
|
+
const el = await fixture(html `<collection-browser
|
|
1475
|
+
.searchService=${searchService}
|
|
1476
|
+
.baseNavigationUrl=${''}
|
|
1477
|
+
@manageModeChanged=${spy}
|
|
1478
1478
|
></collection-browser>`);
|
|
1479
1479
|
el.isManageView = true;
|
|
1480
1480
|
await el.updateComplete;
|
|
@@ -1489,11 +1489,11 @@ describe('Collection Browser', () => {
|
|
|
1489
1489
|
var _a, _b, _c, _d, _e;
|
|
1490
1490
|
const spy = sinon.spy();
|
|
1491
1491
|
const searchService = new MockSearchService();
|
|
1492
|
-
const el = await fixture(html `<collection-browser
|
|
1493
|
-
.searchService=${searchService}
|
|
1494
|
-
.baseNavigationUrl=${''}
|
|
1495
|
-
@itemRemovalRequested=${spy}
|
|
1496
|
-
>
|
|
1492
|
+
const el = await fixture(html `<collection-browser
|
|
1493
|
+
.searchService=${searchService}
|
|
1494
|
+
.baseNavigationUrl=${''}
|
|
1495
|
+
@itemRemovalRequested=${spy}
|
|
1496
|
+
>
|
|
1497
1497
|
</collection-browser>`);
|
|
1498
1498
|
el.baseQuery = 'foo';
|
|
1499
1499
|
await el.updateComplete;
|
|
@@ -1523,10 +1523,10 @@ describe('Collection Browser', () => {
|
|
|
1523
1523
|
it('disables manage view when manage bar cancelled', async () => {
|
|
1524
1524
|
var _a;
|
|
1525
1525
|
const searchService = new MockSearchService();
|
|
1526
|
-
const el = await fixture(html `<collection-browser
|
|
1527
|
-
.searchService=${searchService}
|
|
1528
|
-
.baseNavigationUrl=${''}
|
|
1529
|
-
>
|
|
1526
|
+
const el = await fixture(html `<collection-browser
|
|
1527
|
+
.searchService=${searchService}
|
|
1528
|
+
.baseNavigationUrl=${''}
|
|
1529
|
+
>
|
|
1530
1530
|
</collection-browser>`);
|
|
1531
1531
|
el.baseQuery = 'foo';
|
|
1532
1532
|
await el.updateComplete;
|
|
@@ -1543,7 +1543,7 @@ describe('Collection Browser', () => {
|
|
|
1543
1543
|
it('enable/disable manage view delete button when you selectAll/unselectAll', async () => {
|
|
1544
1544
|
var _a, _b, _c, _d;
|
|
1545
1545
|
const searchService = new MockSearchService();
|
|
1546
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1546
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1547
1547
|
</collection-browser>`);
|
|
1548
1548
|
el.baseQuery = 'foo';
|
|
1549
1549
|
await el.updateComplete;
|
|
@@ -1571,10 +1571,10 @@ describe('Collection Browser', () => {
|
|
|
1571
1571
|
it('shows Blurring checkbox for admin users', async () => {
|
|
1572
1572
|
var _a;
|
|
1573
1573
|
const searchService = new MockSearchService();
|
|
1574
|
-
const el = await fixture(html `<collection-browser
|
|
1575
|
-
.baseNavigationUrl=${''}
|
|
1576
|
-
.searchService=${searchService}
|
|
1577
|
-
>
|
|
1574
|
+
const el = await fixture(html `<collection-browser
|
|
1575
|
+
.baseNavigationUrl=${''}
|
|
1576
|
+
.searchService=${searchService}
|
|
1577
|
+
>
|
|
1578
1578
|
</collection-browser>`);
|
|
1579
1579
|
el.baseQuery = 'archive-org-user-loggedin';
|
|
1580
1580
|
await el.updateComplete;
|
|
@@ -1586,10 +1586,10 @@ describe('Collection Browser', () => {
|
|
|
1586
1586
|
it('unchecks Blurring checkbox for admin users with blurring preference off', async () => {
|
|
1587
1587
|
var _a;
|
|
1588
1588
|
const searchService = new MockSearchService();
|
|
1589
|
-
const el = await fixture(html `<collection-browser
|
|
1590
|
-
.baseNavigationUrl=${''}
|
|
1591
|
-
.searchService=${searchService}
|
|
1592
|
-
>
|
|
1589
|
+
const el = await fixture(html `<collection-browser
|
|
1590
|
+
.baseNavigationUrl=${''}
|
|
1591
|
+
.searchService=${searchService}
|
|
1592
|
+
>
|
|
1593
1593
|
</collection-browser>`);
|
|
1594
1594
|
el.baseQuery = 'archive-org-user-loggedin-noblur';
|
|
1595
1595
|
await el.updateComplete;
|
|
@@ -1601,10 +1601,10 @@ describe('Collection Browser', () => {
|
|
|
1601
1601
|
it('toggles blur state when Blurring checkbox is toggled', async () => {
|
|
1602
1602
|
var _a, _b, _c;
|
|
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;
|
|
@@ -1620,11 +1620,11 @@ describe('Collection Browser', () => {
|
|
|
1620
1620
|
it('applies loans tab properties to sort bar', async () => {
|
|
1621
1621
|
var _a;
|
|
1622
1622
|
const searchService = new MockSearchService();
|
|
1623
|
-
const el = await fixture(html `<collection-browser
|
|
1624
|
-
.baseNavigationUrl=${''}
|
|
1625
|
-
.searchService=${searchService}
|
|
1626
|
-
.enableSortOptionsSlot=${true}
|
|
1627
|
-
>
|
|
1623
|
+
const el = await fixture(html `<collection-browser
|
|
1624
|
+
.baseNavigationUrl=${''}
|
|
1625
|
+
.searchService=${searchService}
|
|
1626
|
+
.enableSortOptionsSlot=${true}
|
|
1627
|
+
>
|
|
1628
1628
|
</collection-browser>`);
|
|
1629
1629
|
el.baseQuery = 'collection:foo';
|
|
1630
1630
|
await el.updateComplete;
|
|
@@ -1639,9 +1639,9 @@ describe('Collection Browser', () => {
|
|
|
1639
1639
|
it('can suppress presence of result count', async () => {
|
|
1640
1640
|
var _a;
|
|
1641
1641
|
const searchService = new MockSearchService();
|
|
1642
|
-
const el = await fixture(html `<collection-browser
|
|
1643
|
-
.searchService=${searchService}
|
|
1644
|
-
suppressResultCount
|
|
1642
|
+
const el = await fixture(html `<collection-browser
|
|
1643
|
+
.searchService=${searchService}
|
|
1644
|
+
suppressResultCount
|
|
1645
1645
|
></collection-browser>`);
|
|
1646
1646
|
el.baseQuery = 'collection:foo';
|
|
1647
1647
|
await el.updateComplete;
|
|
@@ -1652,9 +1652,9 @@ describe('Collection Browser', () => {
|
|
|
1652
1652
|
it('can suppress presence of result tiles', async () => {
|
|
1653
1653
|
var _a;
|
|
1654
1654
|
const searchService = new MockSearchService();
|
|
1655
|
-
const el = await fixture(html `<collection-browser
|
|
1656
|
-
.searchService=${searchService}
|
|
1657
|
-
suppressResultTiles
|
|
1655
|
+
const el = await fixture(html `<collection-browser
|
|
1656
|
+
.searchService=${searchService}
|
|
1657
|
+
suppressResultTiles
|
|
1658
1658
|
></collection-browser>`);
|
|
1659
1659
|
el.baseQuery = 'collection:foo';
|
|
1660
1660
|
await el.updateComplete;
|
|
@@ -1667,7 +1667,7 @@ describe('Collection Browser', () => {
|
|
|
1667
1667
|
asyncResponse: true,
|
|
1668
1668
|
resultsSpy,
|
|
1669
1669
|
});
|
|
1670
|
-
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1670
|
+
const el = await fixture(html `<collection-browser .searchService=${searchService}>
|
|
1671
1671
|
</collection-browser>`);
|
|
1672
1672
|
const numberOfPages = 15;
|
|
1673
1673
|
el.baseQuery = 'jack';
|