@internetarchive/collection-browser 2.7.13 → 2.7.14
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/.github/workflows/ci.yml +3 -3
- package/.github/workflows/gh-pages-main.yml +2 -2
- package/.github/workflows/pr-preview.yml +2 -2
- package/.prettierignore +1 -0
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +1 -1
- package/dist/src/app-root.js +4 -4
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/arrow-left.d.ts +1 -1
- package/dist/src/assets/img/icons/arrow-right.d.ts +1 -1
- package/dist/src/assets/img/icons/chevron.d.ts +1 -1
- package/dist/src/assets/img/icons/contract.d.ts +1 -1
- package/dist/src/assets/img/icons/empty-query.d.ts +1 -1
- package/dist/src/assets/img/icons/expand.d.ts +1 -1
- package/dist/src/assets/img/icons/eye-closed.d.ts +1 -1
- package/dist/src/assets/img/icons/eye.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-unfilled.d.ts +1 -1
- package/dist/src/assets/img/icons/filter.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/null-result.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/circular-activity-indicator.d.ts +1 -1
- package/dist/src/circular-activity-indicator.js.map +1 -1
- package/dist/src/collection-browser.js +1 -2
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +5 -5
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -1
- package/dist/src/collection-facets/more-facets-content.js +2 -4
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.js +1 -0
- package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/dedupe.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js +1 -1
- package/dist/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/models.d.ts +2 -2
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -4
- package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.d.ts +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.d.ts +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
- package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
- package/dist/src/collection-facets/toggle-switch.d.ts +2 -2
- package/dist/src/collection-facets/toggle-switch.js +2 -2
- package/dist/src/collection-facets/toggle-switch.js.map +1 -1
- package/dist/src/collection-facets.js +2 -3
- 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 +8 -9
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/models.d.ts +2 -2
- package/dist/src/empty-placeholder.d.ts +1 -1
- package/dist/src/empty-placeholder.js +10 -11
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +86 -86
- package/dist/src/language-code-handler/language-code-mapping.js.map +1 -1
- package/dist/src/manage/manage-bar.js +16 -16
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/mediatype/mediatype-config.js +1 -0
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/models.d.ts +15 -15
- package/dist/src/models.js +3 -3
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js +0 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +1 -1
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.js +9 -9
- package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +1 -2
- 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/collection-browser-loading-tile.d.ts +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +2 -3
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/grid/search-tile.js.map +1 -1
- package/dist/src/tiles/grid/tile-stats.d.ts +1 -1
- package/dist/src/tiles/grid/tile-stats.js +2 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +1 -1
- package/dist/src/tiles/hover/tile-hover-pane.js +3 -1
- package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +1 -1
- package/dist/src/tiles/image-block.js +1 -1
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +1 -1
- package/dist/src/tiles/item-image.js +2 -2
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +4 -6
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +1 -1
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/text-snippet-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +1 -1
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/src/utils/facet-utils.js.map +1 -1
- package/dist/src/utils/format-count.d.ts +2 -2
- package/dist/src/utils/format-count.js +0 -1
- package/dist/src/utils/format-count.js.map +1 -1
- package/dist/src/utils/format-date.d.ts +1 -1
- package/dist/src/utils/format-date.js.map +1 -1
- package/dist/src/utils/format-unit-size.js.map +1 -1
- package/dist/src/utils/log.js +1 -3
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/resolve-mediatype.js.map +1 -1
- package/dist/test/collection-browser.test.js +4 -3
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +4 -1
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +12 -3
- package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
- package/dist/test/collection-facets.test.js +4 -4
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/data-source/collection-browser-data-source.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.js +0 -1
- package/dist/test/empty-placeholder.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.js +4 -3
- package/dist/test/expanded-date-picker.test.js.map +1 -1
- package/dist/test/icon-overlay.test.js +0 -1
- package/dist/test/icon-overlay.test.js.map +1 -1
- package/dist/test/image-block.test.js +0 -1
- package/dist/test/image-block.test.js.map +1 -1
- package/dist/test/item-image.test.js +0 -1
- package/dist/test/item-image.test.js.map +1 -1
- package/dist/test/manage/manage-bar.test.js +2 -3
- package/dist/test/manage/manage-bar.test.js.map +1 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/dist/test/review-block.test.js +0 -1
- package/dist/test/review-block.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
- package/dist/test/text-overlay.test.js +0 -1
- package/dist/test/text-overlay.test.js.map +1 -1
- package/dist/test/text-snippet-block.test.js +0 -1
- package/dist/test/text-snippet-block.test.js.map +1 -1
- package/dist/test/tile-stats.test.js +22 -23
- package/dist/test/tile-stats.test.js.map +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -1
- package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -1
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -1
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -1
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/dist/test/utils/format-count.test.js.map +1 -1
- package/dist/test/utils/format-date.test.js.map +1 -1
- package/dist/test/utils/local-date-from-utc.test.js.map +1 -1
- package/eslint.config.mjs +53 -0
- package/index.html +0 -3
- package/package.json +41 -39
- package/src/app-root.ts +21 -22
- package/src/collection-browser.ts +36 -38
- package/src/collection-facets/facets-template.ts +7 -6
- package/src/collection-facets/more-facets-content.ts +11 -13
- package/src/collection-facets/more-facets-pagination.ts +3 -2
- package/src/collection-facets/smart-facets/dedupe.ts +2 -2
- package/src/collection-facets/smart-facets/heuristics/query-keywords-heuristic.ts +1 -1
- package/src/collection-facets/smart-facets/heuristics/wikidata-heuristic.ts +6 -6
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +6 -8
- package/src/collection-facets/smart-facets/smart-facet-button.ts +5 -3
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +4 -4
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +1 -1
- package/src/collection-facets/toggle-switch.ts +2 -2
- package/src/collection-facets.ts +18 -19
- package/src/data-source/collection-browser-data-source-interface.ts +5 -1
- package/src/data-source/collection-browser-data-source.ts +37 -34
- package/src/empty-placeholder.ts +19 -16
- package/src/expanded-date-picker.ts +1 -1
- package/src/language-code-handler/language-code-handler.ts +1 -1
- package/src/manage/manage-bar.ts +23 -20
- package/src/manage/remove-items-modal-content.ts +2 -2
- package/src/mediatype/mediatype-config.ts +1 -0
- package/src/models.ts +3 -3
- package/src/restoration-state-handler.ts +14 -15
- package/src/sort-filter-bar/alpha-bar.ts +16 -17
- package/src/sort-filter-bar/sort-filter-bar.ts +14 -15
- package/src/tiles/grid/account-tile.ts +1 -1
- package/src/tiles/grid/collection-tile.ts +1 -1
- package/src/tiles/grid/item-tile.ts +9 -9
- package/src/tiles/grid/tile-stats.ts +4 -4
- package/src/tiles/hover/hover-pane-controller.ts +1 -1
- package/src/tiles/hover/tile-hover-pane.ts +4 -2
- package/src/tiles/item-image.ts +1 -1
- package/src/tiles/list/tile-list-compact.ts +2 -2
- package/src/tiles/list/tile-list.ts +22 -24
- package/src/tiles/tile-dispatcher.ts +5 -5
- package/src/tiles/tile-display-value-provider.ts +4 -4
- package/src/utils/facet-utils.ts +6 -6
- package/src/utils/format-count.ts +2 -3
- package/src/utils/format-date.ts +1 -1
- package/src/utils/format-unit-size.ts +1 -1
- package/src/utils/log.ts +1 -3
- package/test/collection-browser.test.ts +125 -124
- package/test/collection-facets/facet-row.test.ts +31 -28
- package/test/collection-facets/facets-template.test.ts +9 -9
- package/test/collection-facets/more-facets-content.test.ts +14 -15
- package/test/collection-facets/more-facets-pagination.test.ts +18 -19
- package/test/collection-facets/toggle-switch.test.ts +28 -18
- package/test/collection-facets.test.ts +46 -39
- package/test/data-source/collection-browser-data-source.test.ts +2 -2
- package/test/empty-placeholder.test.ts +6 -7
- package/test/expanded-date-picker.test.ts +25 -20
- package/test/icon-overlay.test.ts +0 -1
- package/test/image-block.test.ts +6 -7
- package/test/item-image.test.ts +0 -1
- package/test/manage/manage-bar.test.ts +19 -16
- package/test/manage/remove-items-modal-content.test.ts +4 -5
- package/test/mocks/mock-search-responses.ts +2 -1
- package/test/mocks/mock-search-service.ts +1 -1
- package/test/restoration-state-handler.test.ts +12 -12
- package/test/review-block.test.ts +1 -2
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +1 -1
- package/test/sort-filter-bar/alpha-bar.test.ts +5 -5
- package/test/sort-filter-bar/sort-filter-bar.test.ts +38 -39
- package/test/text-overlay.test.ts +0 -1
- package/test/text-snippet-block.test.ts +5 -6
- package/test/tile-stats.test.ts +26 -35
- package/test/tiles/grid/account-tile.test.ts +2 -3
- package/test/tiles/grid/collection-tile.test.ts +3 -4
- package/test/tiles/grid/item-tile.test.ts +13 -14
- package/test/tiles/grid/search-tile.test.ts +1 -2
- package/test/tiles/hover/hover-pane-controller.test.ts +15 -15
- package/test/tiles/hover/tile-hover-pane.test.ts +5 -5
- package/test/tiles/list/tile-list-compact.test.ts +1 -2
- package/test/tiles/list/tile-list.test.ts +10 -11
- package/test/tiles/tile-dispatcher.test.ts +5 -5
- package/test/utils/format-count.test.ts +1 -1
- package/test/utils/format-date.test.ts +1 -1
- package/test/utils/local-date-from-utc.test.ts +1 -1
- package/tsconfig.json +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
1
|
import { aTimeout, expect, fixture } from '@open-wc/testing';
|
|
3
2
|
import { html } from 'lit';
|
|
4
3
|
import sinon from 'sinon';
|
|
@@ -55,7 +54,7 @@ describe('Collection Browser', () => {
|
|
|
55
54
|
const selectedFacets = getDefaultSelectedFacets();
|
|
56
55
|
selectedFacets.creator.foo = { count: 1, key: 'foo', state: 'selected' };
|
|
57
56
|
const el = await fixture<CollectionBrowser>(
|
|
58
|
-
html`<collection-browser></collection-browser
|
|
57
|
+
html`<collection-browser></collection-browser>`,
|
|
59
58
|
);
|
|
60
59
|
|
|
61
60
|
el.selectedFacets = selectedFacets;
|
|
@@ -67,7 +66,7 @@ describe('Collection Browser', () => {
|
|
|
67
66
|
|
|
68
67
|
it('clears existing filters but not sort by default', async () => {
|
|
69
68
|
const el = await fixture<CollectionBrowser>(
|
|
70
|
-
html`<collection-browser></collection-browser
|
|
69
|
+
html`<collection-browser></collection-browser>`,
|
|
71
70
|
);
|
|
72
71
|
|
|
73
72
|
el.selectedSort = 'title' as SortField;
|
|
@@ -88,7 +87,7 @@ describe('Collection Browser', () => {
|
|
|
88
87
|
|
|
89
88
|
it('clears existing filters for facets & sort via option', async () => {
|
|
90
89
|
const el = await fixture<CollectionBrowser>(
|
|
91
|
-
html`<collection-browser></collection-browser
|
|
90
|
+
html`<collection-browser></collection-browser>`,
|
|
92
91
|
);
|
|
93
92
|
|
|
94
93
|
el.selectedSort = 'title' as SortField;
|
|
@@ -107,7 +106,7 @@ describe('Collection Browser', () => {
|
|
|
107
106
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
108
107
|
const el = await fixture<CollectionBrowser>(
|
|
109
108
|
html`<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
110
|
-
</collection-browser
|
|
109
|
+
</collection-browser>`,
|
|
111
110
|
);
|
|
112
111
|
|
|
113
112
|
el.searchContext = 'betaSearchService';
|
|
@@ -133,7 +132,7 @@ describe('Collection Browser', () => {
|
|
|
133
132
|
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
134
133
|
const el = await fixture<CollectionBrowser>(
|
|
135
134
|
html`<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
136
|
-
</collection-browser
|
|
135
|
+
</collection-browser>`,
|
|
137
136
|
);
|
|
138
137
|
|
|
139
138
|
el.searchContext = 'beta-search-service';
|
|
@@ -170,7 +169,7 @@ describe('Collection Browser', () => {
|
|
|
170
169
|
|
|
171
170
|
const el = await fixture<CollectionBrowser>(
|
|
172
171
|
html`<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
173
|
-
</collection-browser
|
|
172
|
+
</collection-browser>`,
|
|
174
173
|
);
|
|
175
174
|
|
|
176
175
|
el.searchContext = 'search-service';
|
|
@@ -188,7 +187,7 @@ describe('Collection Browser', () => {
|
|
|
188
187
|
},
|
|
189
188
|
negative: false,
|
|
190
189
|
},
|
|
191
|
-
})
|
|
190
|
+
}),
|
|
192
191
|
);
|
|
193
192
|
expect(mockAnalyticsHandler.callCategory).to.equal('search-service');
|
|
194
193
|
expect(mockAnalyticsHandler.callAction).to.equal('facetSelected');
|
|
@@ -205,7 +204,7 @@ describe('Collection Browser', () => {
|
|
|
205
204
|
},
|
|
206
205
|
negative: false,
|
|
207
206
|
},
|
|
208
|
-
})
|
|
207
|
+
}),
|
|
209
208
|
);
|
|
210
209
|
expect(el.selectedFacets).to.equal(mockedSelectedFacets);
|
|
211
210
|
expect(mockAnalyticsHandler.callCategory).to.equal('search-service');
|
|
@@ -228,7 +227,7 @@ describe('Collection Browser', () => {
|
|
|
228
227
|
|
|
229
228
|
const el = await fixture<CollectionBrowser>(
|
|
230
229
|
html`<collection-browser .analyticsHandler=${mockAnalyticsHandler}>
|
|
231
|
-
</collection-browser
|
|
230
|
+
</collection-browser>`,
|
|
232
231
|
);
|
|
233
232
|
|
|
234
233
|
el.searchContext = 'beta-search-service';
|
|
@@ -246,7 +245,7 @@ describe('Collection Browser', () => {
|
|
|
246
245
|
},
|
|
247
246
|
negative: true,
|
|
248
247
|
},
|
|
249
|
-
})
|
|
248
|
+
}),
|
|
250
249
|
);
|
|
251
250
|
expect(mockAnalyticsHandler.callCategory).to.equal('beta-search-service');
|
|
252
251
|
expect(mockAnalyticsHandler.callAction).to.equal('facetNegativeSelected');
|
|
@@ -263,7 +262,7 @@ describe('Collection Browser', () => {
|
|
|
263
262
|
},
|
|
264
263
|
negative: true,
|
|
265
264
|
},
|
|
266
|
-
})
|
|
265
|
+
}),
|
|
267
266
|
);
|
|
268
267
|
expect(el.selectedFacets).to.equal(mockedSelectedFacets);
|
|
269
268
|
expect(mockAnalyticsHandler.callCategory).to.equal('beta-search-service');
|
|
@@ -276,7 +275,7 @@ describe('Collection Browser', () => {
|
|
|
276
275
|
|
|
277
276
|
const el = await fixture<CollectionBrowser>(
|
|
278
277
|
html`<collection-browser .searchService=${searchService}>
|
|
279
|
-
</collection-browser
|
|
278
|
+
</collection-browser>`,
|
|
280
279
|
);
|
|
281
280
|
|
|
282
281
|
el.baseQuery = 'hello';
|
|
@@ -296,7 +295,7 @@ describe('Collection Browser', () => {
|
|
|
296
295
|
|
|
297
296
|
const el = await fixture<CollectionBrowser>(
|
|
298
297
|
html`<collection-browser .searchService=${searchService}>
|
|
299
|
-
</collection-browser
|
|
298
|
+
</collection-browser>`,
|
|
300
299
|
);
|
|
301
300
|
|
|
302
301
|
el.baseQuery = 'collection:foo';
|
|
@@ -305,7 +304,7 @@ describe('Collection Browser', () => {
|
|
|
305
304
|
|
|
306
305
|
expect(searchService.searchParams?.query).to.equal('collection:foo');
|
|
307
306
|
expect(
|
|
308
|
-
el.shadowRoot?.querySelector('#big-results-label')?.textContent
|
|
307
|
+
el.shadowRoot?.querySelector('#big-results-label')?.textContent,
|
|
309
308
|
).to.contains('Results');
|
|
310
309
|
});
|
|
311
310
|
|
|
@@ -314,7 +313,7 @@ describe('Collection Browser', () => {
|
|
|
314
313
|
|
|
315
314
|
const el = await fixture<CollectionBrowser>(
|
|
316
315
|
html` <collection-browser .searchService=${searchService}>
|
|
317
|
-
</collection-browser
|
|
316
|
+
</collection-browser>`,
|
|
318
317
|
);
|
|
319
318
|
|
|
320
319
|
el.searchType = SearchType.METADATA;
|
|
@@ -327,7 +326,7 @@ describe('Collection Browser', () => {
|
|
|
327
326
|
expect(searchService.searchParams?.query).to.equal('collection:foo');
|
|
328
327
|
expect(searchService.searchType).to.equal(SearchType.METADATA);
|
|
329
328
|
expect(
|
|
330
|
-
el.shadowRoot?.querySelector('#big-results-label')?.textContent
|
|
329
|
+
el.shadowRoot?.querySelector('#big-results-label')?.textContent,
|
|
331
330
|
).to.contains('Results');
|
|
332
331
|
});
|
|
333
332
|
|
|
@@ -335,7 +334,7 @@ describe('Collection Browser', () => {
|
|
|
335
334
|
const searchService = new MockSearchService();
|
|
336
335
|
const el = await fixture<CollectionBrowser>(
|
|
337
336
|
html`<collection-browser .searchService=${searchService}>
|
|
338
|
-
</collection-browser
|
|
337
|
+
</collection-browser>`,
|
|
339
338
|
);
|
|
340
339
|
|
|
341
340
|
el.baseQuery = 'collection:foo';
|
|
@@ -353,7 +352,7 @@ describe('Collection Browser', () => {
|
|
|
353
352
|
|
|
354
353
|
const el = await fixture<CollectionBrowser>(
|
|
355
354
|
html` <collection-browser .searchService=${searchService}>
|
|
356
|
-
</collection-browser
|
|
355
|
+
</collection-browser>`,
|
|
357
356
|
);
|
|
358
357
|
|
|
359
358
|
el.searchType = SearchType.FULLTEXT;
|
|
@@ -366,7 +365,7 @@ describe('Collection Browser', () => {
|
|
|
366
365
|
expect(searchService.searchParams?.query).to.equal('collection:foo');
|
|
367
366
|
expect(searchService.searchType).to.equal(SearchType.FULLTEXT);
|
|
368
367
|
expect(
|
|
369
|
-
el.shadowRoot?.querySelector('#big-results-label')?.textContent
|
|
368
|
+
el.shadowRoot?.querySelector('#big-results-label')?.textContent,
|
|
370
369
|
).to.contains('Results');
|
|
371
370
|
});
|
|
372
371
|
|
|
@@ -401,7 +400,7 @@ describe('Collection Browser', () => {
|
|
|
401
400
|
|
|
402
401
|
const el = await fixture<CollectionBrowser>(
|
|
403
402
|
html`<collection-browser .searchService=${searchService}>
|
|
404
|
-
</collection-browser
|
|
403
|
+
</collection-browser>`,
|
|
405
404
|
);
|
|
406
405
|
|
|
407
406
|
el.baseQuery = 'collection:foo';
|
|
@@ -423,7 +422,7 @@ describe('Collection Browser', () => {
|
|
|
423
422
|
|
|
424
423
|
it('fails gracefully if no search service provided', async () => {
|
|
425
424
|
const el = await fixture<CollectionBrowser>(
|
|
426
|
-
html`<collection-browser></collection-browser
|
|
425
|
+
html`<collection-browser></collection-browser>`,
|
|
427
426
|
);
|
|
428
427
|
|
|
429
428
|
el.baseQuery = 'collection:foo';
|
|
@@ -446,7 +445,7 @@ describe('Collection Browser', () => {
|
|
|
446
445
|
|
|
447
446
|
const el = await fixture<CollectionBrowser>(
|
|
448
447
|
html`<collection-browser .searchService=${searchService}>
|
|
449
|
-
</collection-browser
|
|
448
|
+
</collection-browser>`,
|
|
450
449
|
);
|
|
451
450
|
|
|
452
451
|
expect(el.searchType).to.equal(SearchType.FULLTEXT);
|
|
@@ -457,7 +456,7 @@ describe('Collection Browser', () => {
|
|
|
457
456
|
|
|
458
457
|
const el = await fixture<CollectionBrowser>(
|
|
459
458
|
html`<collection-browser .searchService=${searchService}>
|
|
460
|
-
</collection-browser
|
|
459
|
+
</collection-browser>`,
|
|
461
460
|
);
|
|
462
461
|
|
|
463
462
|
el.baseQuery = 'many-fields';
|
|
@@ -480,7 +479,7 @@ describe('Collection Browser', () => {
|
|
|
480
479
|
.searchService=${searchService}
|
|
481
480
|
@emptyResults=${emptyResultsSpy}
|
|
482
481
|
>
|
|
483
|
-
</collection-browser
|
|
482
|
+
</collection-browser>`,
|
|
484
483
|
);
|
|
485
484
|
|
|
486
485
|
el.baseQuery = 'no-results';
|
|
@@ -495,7 +494,7 @@ describe('Collection Browser', () => {
|
|
|
495
494
|
|
|
496
495
|
const el = await fixture<CollectionBrowser>(
|
|
497
496
|
html`<collection-browser .searchService=${searchService}>
|
|
498
|
-
</collection-browser
|
|
497
|
+
</collection-browser>`,
|
|
499
498
|
);
|
|
500
499
|
|
|
501
500
|
el.baseQuery = 'loggedin';
|
|
@@ -516,7 +515,7 @@ describe('Collection Browser', () => {
|
|
|
516
515
|
|
|
517
516
|
const el = await fixture<CollectionBrowser>(
|
|
518
517
|
html`<collection-browser .searchService=${searchService}>
|
|
519
|
-
</collection-browser
|
|
518
|
+
</collection-browser>`,
|
|
520
519
|
);
|
|
521
520
|
|
|
522
521
|
el.baseQuery = 'no-preview';
|
|
@@ -537,7 +536,7 @@ describe('Collection Browser', () => {
|
|
|
537
536
|
|
|
538
537
|
const el = await fixture<CollectionBrowser>(
|
|
539
538
|
html`<collection-browser .searchService=${searchService}>
|
|
540
|
-
</collection-browser
|
|
539
|
+
</collection-browser>`,
|
|
541
540
|
);
|
|
542
541
|
|
|
543
542
|
el.baseQuery = 'loggedin-no-preview';
|
|
@@ -559,7 +558,7 @@ describe('Collection Browser', () => {
|
|
|
559
558
|
|
|
560
559
|
const el = await fixture<CollectionBrowser>(
|
|
561
560
|
html`<collection-browser .searchService=${searchService}>
|
|
562
|
-
</collection-browser
|
|
561
|
+
</collection-browser>`,
|
|
563
562
|
);
|
|
564
563
|
|
|
565
564
|
// This query receives an array description like ['line1', 'line2']
|
|
@@ -584,7 +583,7 @@ describe('Collection Browser', () => {
|
|
|
584
583
|
html`<collection-browser
|
|
585
584
|
.searchService=${searchService}
|
|
586
585
|
.searchType=${SearchType.METADATA}
|
|
587
|
-
></collection-browser
|
|
586
|
+
></collection-browser>`,
|
|
588
587
|
);
|
|
589
588
|
|
|
590
589
|
el.baseQuery = 'collection:foo';
|
|
@@ -601,7 +600,7 @@ describe('Collection Browser', () => {
|
|
|
601
600
|
const el = await fixture<CollectionBrowser>(
|
|
602
601
|
html`<collection-browser
|
|
603
602
|
.searchService=${searchService}
|
|
604
|
-
></collection-browser
|
|
603
|
+
></collection-browser>`,
|
|
605
604
|
);
|
|
606
605
|
|
|
607
606
|
el.baseQuery = ' collection:foo ';
|
|
@@ -616,7 +615,7 @@ describe('Collection Browser', () => {
|
|
|
616
615
|
const el = await fixture<CollectionBrowser>(
|
|
617
616
|
html`<collection-browser
|
|
618
617
|
.searchService=${searchService}
|
|
619
|
-
></collection-browser
|
|
618
|
+
></collection-browser>`,
|
|
620
619
|
);
|
|
621
620
|
|
|
622
621
|
el.baseQuery = 'error';
|
|
@@ -624,10 +623,10 @@ describe('Collection Browser', () => {
|
|
|
624
623
|
await el.initialSearchComplete;
|
|
625
624
|
|
|
626
625
|
const errorPlaceholder = el.shadowRoot?.querySelector(
|
|
627
|
-
'empty-placeholder'
|
|
626
|
+
'empty-placeholder',
|
|
628
627
|
) as EmptyPlaceholder;
|
|
629
628
|
const errorDetails = errorPlaceholder?.shadowRoot?.querySelector(
|
|
630
|
-
'.error-details'
|
|
629
|
+
'.error-details',
|
|
631
630
|
) as HTMLParagraphElement;
|
|
632
631
|
|
|
633
632
|
expect(errorDetails).to.exist;
|
|
@@ -639,7 +638,7 @@ describe('Collection Browser', () => {
|
|
|
639
638
|
const el = await fixture<CollectionBrowser>(
|
|
640
639
|
html`<collection-browser
|
|
641
640
|
.searchService=${searchService}
|
|
642
|
-
></collection-browser
|
|
641
|
+
></collection-browser>`,
|
|
643
642
|
);
|
|
644
643
|
|
|
645
644
|
el.withinCollection = 'error';
|
|
@@ -647,10 +646,10 @@ describe('Collection Browser', () => {
|
|
|
647
646
|
await el.initialSearchComplete;
|
|
648
647
|
|
|
649
648
|
const errorPlaceholder = el.shadowRoot?.querySelector(
|
|
650
|
-
'empty-placeholder'
|
|
649
|
+
'empty-placeholder',
|
|
651
650
|
) as EmptyPlaceholder;
|
|
652
651
|
const errorDetails = errorPlaceholder?.shadowRoot?.querySelector(
|
|
653
|
-
'.error-details'
|
|
652
|
+
'.error-details',
|
|
654
653
|
) as HTMLParagraphElement;
|
|
655
654
|
|
|
656
655
|
expect(errorDetails).to.exist;
|
|
@@ -659,12 +658,13 @@ describe('Collection Browser', () => {
|
|
|
659
658
|
|
|
660
659
|
it('reports malformed response errors to Sentry', async () => {
|
|
661
660
|
const sentrySpy = sinon.spy();
|
|
661
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
662
662
|
(window as any).Sentry = { captureMessage: sentrySpy };
|
|
663
663
|
const searchService = new MockSearchService();
|
|
664
664
|
const el = await fixture<CollectionBrowser>(
|
|
665
665
|
html`<collection-browser
|
|
666
666
|
.searchService=${searchService}
|
|
667
|
-
></collection-browser
|
|
667
|
+
></collection-browser>`,
|
|
668
668
|
);
|
|
669
669
|
|
|
670
670
|
el.baseQuery = 'malformed';
|
|
@@ -679,7 +679,7 @@ describe('Collection Browser', () => {
|
|
|
679
679
|
|
|
680
680
|
const el = await fixture<CollectionBrowser>(
|
|
681
681
|
html`<collection-browser .searchService=${searchService}>
|
|
682
|
-
</collection-browser
|
|
682
|
+
</collection-browser>`,
|
|
683
683
|
);
|
|
684
684
|
|
|
685
685
|
el.baseQuery = 'collection-titles';
|
|
@@ -687,16 +687,16 @@ describe('Collection Browser', () => {
|
|
|
687
687
|
await el.initialSearchComplete;
|
|
688
688
|
|
|
689
689
|
expect(el.dataSource.collectionTitles.get('foo')).to.equal(
|
|
690
|
-
'Foo Collection'
|
|
690
|
+
'Foo Collection',
|
|
691
691
|
);
|
|
692
692
|
expect(el.dataSource.collectionTitles.get('bar')).to.equal(
|
|
693
|
-
'Bar Collection'
|
|
693
|
+
'Bar Collection',
|
|
694
694
|
);
|
|
695
695
|
expect(el.dataSource.collectionTitles.get('baz')).to.equal(
|
|
696
|
-
'Baz Collection'
|
|
696
|
+
'Baz Collection',
|
|
697
697
|
);
|
|
698
698
|
expect(el.dataSource.collectionTitles.get('boop')).to.equal(
|
|
699
|
-
'Boop Collection'
|
|
699
|
+
'Boop Collection',
|
|
700
700
|
);
|
|
701
701
|
});
|
|
702
702
|
|
|
@@ -709,7 +709,7 @@ describe('Collection Browser', () => {
|
|
|
709
709
|
|
|
710
710
|
const el = await fixture<CollectionBrowser>(
|
|
711
711
|
html`<collection-browser .searchService=${searchService}>
|
|
712
|
-
</collection-browser
|
|
712
|
+
</collection-browser>`,
|
|
713
713
|
);
|
|
714
714
|
|
|
715
715
|
el.baseQuery = 'with-sort';
|
|
@@ -733,7 +733,7 @@ describe('Collection Browser', () => {
|
|
|
733
733
|
|
|
734
734
|
const el = await fixture<CollectionBrowser>(
|
|
735
735
|
html`<collection-browser .searchService=${searchService}>
|
|
736
|
-
</collection-browser
|
|
736
|
+
</collection-browser>`,
|
|
737
737
|
);
|
|
738
738
|
|
|
739
739
|
el.baseQuery = 'with-sort';
|
|
@@ -763,7 +763,7 @@ describe('Collection Browser', () => {
|
|
|
763
763
|
|
|
764
764
|
const el = await fixture<CollectionBrowser>(
|
|
765
765
|
html`<collection-browser .searchService=${searchService}>
|
|
766
|
-
</collection-browser
|
|
766
|
+
</collection-browser>`,
|
|
767
767
|
);
|
|
768
768
|
|
|
769
769
|
el.baseQuery = 'single-result';
|
|
@@ -792,7 +792,7 @@ describe('Collection Browser', () => {
|
|
|
792
792
|
|
|
793
793
|
const el = await fixture<CollectionBrowser>(
|
|
794
794
|
html`<collection-browser .searchService=${searchService}>
|
|
795
|
-
</collection-browser
|
|
795
|
+
</collection-browser>`,
|
|
796
796
|
);
|
|
797
797
|
|
|
798
798
|
el.baseQuery = 'with-sort';
|
|
@@ -817,7 +817,7 @@ describe('Collection Browser', () => {
|
|
|
817
817
|
const searchService = new MockSearchService();
|
|
818
818
|
const el = await fixture<CollectionBrowser>(
|
|
819
819
|
html`<collection-browser .searchService=${searchService}>
|
|
820
|
-
</collection-browser
|
|
820
|
+
</collection-browser>`,
|
|
821
821
|
);
|
|
822
822
|
|
|
823
823
|
expect(el.selectedSort).to.equal(SortField.default);
|
|
@@ -827,14 +827,15 @@ describe('Collection Browser', () => {
|
|
|
827
827
|
await nextTick();
|
|
828
828
|
|
|
829
829
|
const sortBar = el.shadowRoot?.querySelector(
|
|
830
|
-
'#content-container sort-filter-bar'
|
|
830
|
+
'#content-container sort-filter-bar',
|
|
831
831
|
);
|
|
832
832
|
const sortSelector = sortBar?.shadowRoot?.querySelector(
|
|
833
|
-
'#desktop-sort-selector'
|
|
833
|
+
'#desktop-sort-selector',
|
|
834
834
|
);
|
|
835
835
|
expect(sortSelector, 'sort bar').to.exist;
|
|
836
836
|
|
|
837
837
|
// Click the title sorter
|
|
838
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
838
839
|
[...(sortSelector?.children as HTMLCollection & Iterable<any>)] // tsc doesn't know children is iterable
|
|
839
840
|
.find(child => child.textContent?.trim() === 'Title')
|
|
840
841
|
?.querySelector('button')
|
|
@@ -849,7 +850,7 @@ describe('Collection Browser', () => {
|
|
|
849
850
|
const searchService = new MockSearchService();
|
|
850
851
|
const el = await fixture<CollectionBrowser>(
|
|
851
852
|
html`<collection-browser .searchService=${searchService}>
|
|
852
|
-
</collection-browser
|
|
853
|
+
</collection-browser>`,
|
|
853
854
|
);
|
|
854
855
|
|
|
855
856
|
el.baseQuery = 'first-title';
|
|
@@ -861,7 +862,7 @@ describe('Collection Browser', () => {
|
|
|
861
862
|
|
|
862
863
|
expect(searchService.searchParams?.query).to.equal('first-title');
|
|
863
864
|
expect(searchService.searchParams?.filters?.firstTitle?.X).to.equal(
|
|
864
|
-
FilterConstraint.INCLUDE
|
|
865
|
+
FilterConstraint.INCLUDE,
|
|
865
866
|
);
|
|
866
867
|
});
|
|
867
868
|
|
|
@@ -869,7 +870,7 @@ describe('Collection Browser', () => {
|
|
|
869
870
|
const searchService = new MockSearchService();
|
|
870
871
|
const el = await fixture<CollectionBrowser>(
|
|
871
872
|
html`<collection-browser .searchService=${searchService}>
|
|
872
|
-
</collection-browser
|
|
873
|
+
</collection-browser>`,
|
|
873
874
|
);
|
|
874
875
|
|
|
875
876
|
el.baseQuery = 'first-creator';
|
|
@@ -881,7 +882,7 @@ describe('Collection Browser', () => {
|
|
|
881
882
|
|
|
882
883
|
expect(searchService.searchParams?.query).to.equal('first-creator');
|
|
883
884
|
expect(searchService.searchParams?.filters?.firstCreator?.X).to.equal(
|
|
884
|
-
FilterConstraint.INCLUDE
|
|
885
|
+
FilterConstraint.INCLUDE,
|
|
885
886
|
);
|
|
886
887
|
});
|
|
887
888
|
|
|
@@ -899,7 +900,7 @@ describe('Collection Browser', () => {
|
|
|
899
900
|
|
|
900
901
|
const el = await fixture<CollectionBrowser>(
|
|
901
902
|
html`<collection-browser .searchService=${searchService}>
|
|
902
|
-
</collection-browser
|
|
903
|
+
</collection-browser>`,
|
|
903
904
|
);
|
|
904
905
|
|
|
905
906
|
el.baseQuery = 'first-creator';
|
|
@@ -931,7 +932,7 @@ describe('Collection Browser', () => {
|
|
|
931
932
|
const searchService = new MockSearchService();
|
|
932
933
|
const el = await fixture<CollectionBrowser>(
|
|
933
934
|
html`<collection-browser .searchService=${searchService}>
|
|
934
|
-
</collection-browser
|
|
935
|
+
</collection-browser>`,
|
|
935
936
|
);
|
|
936
937
|
|
|
937
938
|
el.baseQuery = 'first-creator';
|
|
@@ -943,7 +944,7 @@ describe('Collection Browser', () => {
|
|
|
943
944
|
|
|
944
945
|
expect(searchService.searchParams?.query).to.equal('first-creator');
|
|
945
946
|
expect(searchService.searchParams?.filters?.firstCreator?.X).to.equal(
|
|
946
|
-
FilterConstraint.INCLUDE
|
|
947
|
+
FilterConstraint.INCLUDE,
|
|
947
948
|
);
|
|
948
949
|
|
|
949
950
|
el.baseQuery = 'collection:foo';
|
|
@@ -961,7 +962,7 @@ describe('Collection Browser', () => {
|
|
|
961
962
|
.searchService=${searchService}
|
|
962
963
|
.suppressPlaceholders=${true}
|
|
963
964
|
>
|
|
964
|
-
</collection-browser
|
|
965
|
+
</collection-browser>`,
|
|
965
966
|
);
|
|
966
967
|
|
|
967
968
|
el.baseQuery = 'years'; // Includes year_histogram aggregation in response
|
|
@@ -969,7 +970,7 @@ describe('Collection Browser', () => {
|
|
|
969
970
|
await el.updateComplete;
|
|
970
971
|
|
|
971
972
|
const facets = el.shadowRoot?.querySelector(
|
|
972
|
-
'collection-facets'
|
|
973
|
+
'collection-facets',
|
|
973
974
|
) as CollectionFacets;
|
|
974
975
|
await facets?.updateComplete;
|
|
975
976
|
|
|
@@ -977,14 +978,14 @@ describe('Collection Browser', () => {
|
|
|
977
978
|
await nextTick();
|
|
978
979
|
|
|
979
980
|
const histogram = facets?.shadowRoot?.querySelector(
|
|
980
|
-
'histogram-date-range'
|
|
981
|
+
'histogram-date-range',
|
|
981
982
|
) as HistogramDateRange;
|
|
982
983
|
|
|
983
984
|
expect(histogram, 'histogram exists').to.exist;
|
|
984
985
|
|
|
985
986
|
// Enter a new min date into the date picker
|
|
986
987
|
const minDateInput = histogram.shadowRoot?.querySelector(
|
|
987
|
-
'#date-min'
|
|
988
|
+
'#date-min',
|
|
988
989
|
) as HTMLInputElement;
|
|
989
990
|
|
|
990
991
|
const pressEnterEvent = new KeyboardEvent('keyup', {
|
|
@@ -1011,7 +1012,7 @@ describe('Collection Browser', () => {
|
|
|
1011
1012
|
html`<collection-browser
|
|
1012
1013
|
.searchService=${searchService}
|
|
1013
1014
|
@searchResultsLoadingChanged=${spy}
|
|
1014
|
-
></collection-browser
|
|
1015
|
+
></collection-browser>`,
|
|
1015
1016
|
);
|
|
1016
1017
|
|
|
1017
1018
|
el.baseQuery = 'collection:foo';
|
|
@@ -1030,7 +1031,7 @@ describe('Collection Browser', () => {
|
|
|
1030
1031
|
html`<collection-browser
|
|
1031
1032
|
.searchService=${searchService}
|
|
1032
1033
|
.baseNavigationUrl=${''}
|
|
1033
|
-
></collection-browser
|
|
1034
|
+
></collection-browser>`,
|
|
1034
1035
|
);
|
|
1035
1036
|
|
|
1036
1037
|
el.baseQuery = 'extra-quoted-href';
|
|
@@ -1048,7 +1049,7 @@ describe('Collection Browser', () => {
|
|
|
1048
1049
|
|
|
1049
1050
|
// Original href q param starts/ends with %22%22, but should be collapsed to %22 before render
|
|
1050
1051
|
expect(
|
|
1051
|
-
firstResult!.shadowRoot?.querySelector('a[href]')?.getAttribute('href')
|
|
1052
|
+
firstResult!.shadowRoot?.querySelector('a[href]')?.getAttribute('href'),
|
|
1052
1053
|
).to.equal('/details/foo?q=%22quoted+query%22');
|
|
1053
1054
|
});
|
|
1054
1055
|
|
|
@@ -1058,7 +1059,7 @@ describe('Collection Browser', () => {
|
|
|
1058
1059
|
html`<collection-browser
|
|
1059
1060
|
.searchService=${searchService}
|
|
1060
1061
|
.baseNavigationUrl=${''}
|
|
1061
|
-
></collection-browser
|
|
1062
|
+
></collection-browser>`,
|
|
1062
1063
|
);
|
|
1063
1064
|
|
|
1064
1065
|
el.withinCollection = 'default-sort';
|
|
@@ -1068,7 +1069,7 @@ describe('Collection Browser', () => {
|
|
|
1068
1069
|
await aTimeout(50);
|
|
1069
1070
|
|
|
1070
1071
|
const sortBar = el.shadowRoot?.querySelector(
|
|
1071
|
-
'sort-filter-bar'
|
|
1072
|
+
'sort-filter-bar',
|
|
1072
1073
|
) as SortFilterBar;
|
|
1073
1074
|
expect(sortBar).to.exist;
|
|
1074
1075
|
expect(sortBar.defaultSortField).to.equal(SortField.title);
|
|
@@ -1083,7 +1084,7 @@ describe('Collection Browser', () => {
|
|
|
1083
1084
|
html`<collection-browser
|
|
1084
1085
|
.searchService=${searchService}
|
|
1085
1086
|
.baseNavigationUrl=${''}
|
|
1086
|
-
></collection-browser
|
|
1087
|
+
></collection-browser>`,
|
|
1087
1088
|
);
|
|
1088
1089
|
|
|
1089
1090
|
el.withinCollection = 'default-sort-concise';
|
|
@@ -1093,7 +1094,7 @@ describe('Collection Browser', () => {
|
|
|
1093
1094
|
await aTimeout(50);
|
|
1094
1095
|
|
|
1095
1096
|
const sortBar = el.shadowRoot?.querySelector(
|
|
1096
|
-
'sort-filter-bar'
|
|
1097
|
+
'sort-filter-bar',
|
|
1097
1098
|
) as SortFilterBar;
|
|
1098
1099
|
expect(sortBar).to.exist;
|
|
1099
1100
|
expect(sortBar.defaultSortField).to.equal(SortField.dateadded);
|
|
@@ -1106,7 +1107,7 @@ describe('Collection Browser', () => {
|
|
|
1106
1107
|
const el = await fixture<CollectionBrowser>(
|
|
1107
1108
|
html`<collection-browser
|
|
1108
1109
|
.withinProfile=${'@foobar'}
|
|
1109
|
-
></collection-browser
|
|
1110
|
+
></collection-browser>`,
|
|
1110
1111
|
);
|
|
1111
1112
|
|
|
1112
1113
|
el.applyDefaultProfileSort();
|
|
@@ -1122,7 +1123,7 @@ describe('Collection Browser', () => {
|
|
|
1122
1123
|
html`<collection-browser
|
|
1123
1124
|
.searchService=${searchService}
|
|
1124
1125
|
.baseNavigationUrl=${''}
|
|
1125
|
-
></collection-browser
|
|
1126
|
+
></collection-browser>`,
|
|
1126
1127
|
);
|
|
1127
1128
|
|
|
1128
1129
|
el.withinCollection = 'default-sort';
|
|
@@ -1133,7 +1134,7 @@ describe('Collection Browser', () => {
|
|
|
1133
1134
|
await aTimeout(50);
|
|
1134
1135
|
|
|
1135
1136
|
const sortBar = el.shadowRoot?.querySelector(
|
|
1136
|
-
'sort-filter-bar'
|
|
1137
|
+
'sort-filter-bar',
|
|
1137
1138
|
) as SortFilterBar;
|
|
1138
1139
|
expect(sortBar).to.exist;
|
|
1139
1140
|
expect(sortBar.defaultSortField).to.equal(SortField.relevance);
|
|
@@ -1148,7 +1149,7 @@ describe('Collection Browser', () => {
|
|
|
1148
1149
|
html`<collection-browser
|
|
1149
1150
|
.searchService=${searchService}
|
|
1150
1151
|
.baseNavigationUrl=${''}
|
|
1151
|
-
></collection-browser
|
|
1152
|
+
></collection-browser>`,
|
|
1152
1153
|
);
|
|
1153
1154
|
|
|
1154
1155
|
el.withinCollection = 'fav-sort';
|
|
@@ -1158,7 +1159,7 @@ describe('Collection Browser', () => {
|
|
|
1158
1159
|
await aTimeout(50);
|
|
1159
1160
|
|
|
1160
1161
|
const sortBar = el.shadowRoot?.querySelector(
|
|
1161
|
-
'sort-filter-bar'
|
|
1162
|
+
'sort-filter-bar',
|
|
1162
1163
|
) as SortFilterBar;
|
|
1163
1164
|
expect(sortBar).to.exist;
|
|
1164
1165
|
expect(sortBar.defaultSortField).to.equal(SortField.datefavorited);
|
|
@@ -1171,7 +1172,7 @@ describe('Collection Browser', () => {
|
|
|
1171
1172
|
const searchService = new MockSearchService();
|
|
1172
1173
|
const el = await fixture<CollectionBrowser>(
|
|
1173
1174
|
html`<collection-browser .searchService=${searchService}>
|
|
1174
|
-
</collection-browser
|
|
1175
|
+
</collection-browser>`,
|
|
1175
1176
|
);
|
|
1176
1177
|
|
|
1177
1178
|
// Infinite scroller won't exist unless there's a base query.
|
|
@@ -1185,7 +1186,7 @@ describe('Collection Browser', () => {
|
|
|
1185
1186
|
await nextTick();
|
|
1186
1187
|
|
|
1187
1188
|
const infiniteScroller = el.shadowRoot?.querySelector(
|
|
1188
|
-
'infinite-scroller'
|
|
1189
|
+
'infinite-scroller',
|
|
1189
1190
|
) as InfiniteScroller;
|
|
1190
1191
|
expect(infiniteScroller).to.exist;
|
|
1191
1192
|
|
|
@@ -1205,14 +1206,14 @@ describe('Collection Browser', () => {
|
|
|
1205
1206
|
html`<collection-browser
|
|
1206
1207
|
.searchService=${searchService}
|
|
1207
1208
|
.mobileBreakpoint=${9999}
|
|
1208
|
-
></collection-browser
|
|
1209
|
+
></collection-browser>`,
|
|
1209
1210
|
);
|
|
1210
1211
|
|
|
1211
1212
|
el.baseQuery = 'collection:foo';
|
|
1212
1213
|
await el.updateComplete;
|
|
1213
1214
|
|
|
1214
1215
|
const contentContainer = el.shadowRoot?.querySelector(
|
|
1215
|
-
'#content-container'
|
|
1216
|
+
'#content-container',
|
|
1216
1217
|
) as HTMLElement;
|
|
1217
1218
|
|
|
1218
1219
|
el.handleResize({
|
|
@@ -1225,7 +1226,7 @@ describe('Collection Browser', () => {
|
|
|
1225
1226
|
await el.updateComplete;
|
|
1226
1227
|
|
|
1227
1228
|
const mobileFacets = el.shadowRoot?.querySelector(
|
|
1228
|
-
'#mobile-filter-collapse'
|
|
1229
|
+
'#mobile-filter-collapse',
|
|
1229
1230
|
);
|
|
1230
1231
|
expect(mobileFacets).to.exist;
|
|
1231
1232
|
});
|
|
@@ -1239,14 +1240,14 @@ describe('Collection Browser', () => {
|
|
|
1239
1240
|
.analyticsHandler=${analyticsHandler}
|
|
1240
1241
|
.searchContext=${'foobar-context'}
|
|
1241
1242
|
.mobileBreakpoint=${9999}
|
|
1242
|
-
></collection-browser
|
|
1243
|
+
></collection-browser>`,
|
|
1243
1244
|
);
|
|
1244
1245
|
|
|
1245
1246
|
el.baseQuery = 'collection:foo';
|
|
1246
1247
|
await el.updateComplete;
|
|
1247
1248
|
|
|
1248
1249
|
const contentContainer = el.shadowRoot?.querySelector(
|
|
1249
|
-
'#content-container'
|
|
1250
|
+
'#content-container',
|
|
1250
1251
|
) as HTMLElement;
|
|
1251
1252
|
|
|
1252
1253
|
el.handleResize({
|
|
@@ -1259,7 +1260,7 @@ describe('Collection Browser', () => {
|
|
|
1259
1260
|
await el.updateComplete;
|
|
1260
1261
|
|
|
1261
1262
|
const mobileFacets = el.shadowRoot?.querySelector(
|
|
1262
|
-
'#mobile-filter-collapse'
|
|
1263
|
+
'#mobile-filter-collapse',
|
|
1263
1264
|
) as HTMLDetailsElement;
|
|
1264
1265
|
expect(mobileFacets).to.exist;
|
|
1265
1266
|
|
|
@@ -1276,7 +1277,7 @@ describe('Collection Browser', () => {
|
|
|
1276
1277
|
await facetsToggled;
|
|
1277
1278
|
expect(analyticsHandler.callCategory).to.equal('foobar-context');
|
|
1278
1279
|
expect(analyticsHandler.callAction).to.equal(
|
|
1279
|
-
analyticsActions.mobileFacetsToggled
|
|
1280
|
+
analyticsActions.mobileFacetsToggled,
|
|
1280
1281
|
);
|
|
1281
1282
|
expect(analyticsHandler.callLabel).to.equal('open');
|
|
1282
1283
|
|
|
@@ -1288,7 +1289,7 @@ describe('Collection Browser', () => {
|
|
|
1288
1289
|
await facetsToggled;
|
|
1289
1290
|
expect(analyticsHandler.callCategory).to.equal('foobar-context');
|
|
1290
1291
|
expect(analyticsHandler.callAction).to.equal(
|
|
1291
|
-
analyticsActions.mobileFacetsToggled
|
|
1292
|
+
analyticsActions.mobileFacetsToggled,
|
|
1292
1293
|
);
|
|
1293
1294
|
expect(analyticsHandler.callLabel).to.equal('closed');
|
|
1294
1295
|
});
|
|
@@ -1299,7 +1300,7 @@ describe('Collection Browser', () => {
|
|
|
1299
1300
|
html`<collection-browser
|
|
1300
1301
|
.searchService=${searchService}
|
|
1301
1302
|
.withinCollection=${'fake'}
|
|
1302
|
-
></collection-browser
|
|
1303
|
+
></collection-browser>`,
|
|
1303
1304
|
);
|
|
1304
1305
|
|
|
1305
1306
|
el.baseQuery = 'parent-collections';
|
|
@@ -1317,7 +1318,7 @@ describe('Collection Browser', () => {
|
|
|
1317
1318
|
html`<collection-browser
|
|
1318
1319
|
.analyticsHandler=${mockAnalyticsHandler}
|
|
1319
1320
|
.searchService=${searchService}
|
|
1320
|
-
></collection-browser
|
|
1321
|
+
></collection-browser>`,
|
|
1321
1322
|
);
|
|
1322
1323
|
const infiniteScrollerRefreshSpy = sinon.spy();
|
|
1323
1324
|
|
|
@@ -1339,7 +1340,7 @@ describe('Collection Browser', () => {
|
|
|
1339
1340
|
.true;
|
|
1340
1341
|
expect(
|
|
1341
1342
|
infiniteScrollerRefreshSpy.callCount,
|
|
1342
|
-
'Infinite Scroller Refresh call count'
|
|
1343
|
+
'Infinite Scroller Refresh call count',
|
|
1343
1344
|
).to.equal(1);
|
|
1344
1345
|
|
|
1345
1346
|
el.loggedIn = false;
|
|
@@ -1347,7 +1348,7 @@ describe('Collection Browser', () => {
|
|
|
1347
1348
|
|
|
1348
1349
|
expect(
|
|
1349
1350
|
infiniteScrollerRefreshSpy.callCount,
|
|
1350
|
-
'2nd Infinite Scroller Refresh'
|
|
1351
|
+
'2nd Infinite Scroller Refresh',
|
|
1351
1352
|
).to.equal(2);
|
|
1352
1353
|
|
|
1353
1354
|
// testing: `displayMode`
|
|
@@ -1356,7 +1357,7 @@ describe('Collection Browser', () => {
|
|
|
1356
1357
|
await el.updateComplete;
|
|
1357
1358
|
expect(
|
|
1358
1359
|
infiniteScrollerRefreshSpy.callCount,
|
|
1359
|
-
'3rd Infinite Scroller Refresh'
|
|
1360
|
+
'3rd Infinite Scroller Refresh',
|
|
1360
1361
|
).to.equal(3);
|
|
1361
1362
|
|
|
1362
1363
|
expect(mockAnalyticsHandler.callCategory).to.equal('beta-search');
|
|
@@ -1367,7 +1368,7 @@ describe('Collection Browser', () => {
|
|
|
1367
1368
|
await el.updateComplete;
|
|
1368
1369
|
expect(
|
|
1369
1370
|
infiniteScrollerRefreshSpy.callCount,
|
|
1370
|
-
'4th Infinite Scroller Refresh'
|
|
1371
|
+
'4th Infinite Scroller Refresh',
|
|
1371
1372
|
).to.equal(4);
|
|
1372
1373
|
|
|
1373
1374
|
expect(mockAnalyticsHandler.callCategory).to.equal('beta-search');
|
|
@@ -1379,7 +1380,7 @@ describe('Collection Browser', () => {
|
|
|
1379
1380
|
await el.updateComplete;
|
|
1380
1381
|
expect(
|
|
1381
1382
|
infiniteScrollerRefreshSpy.callCount,
|
|
1382
|
-
'5th Infinite Scroller Refresh'
|
|
1383
|
+
'5th Infinite Scroller Refresh',
|
|
1383
1384
|
).to.equal(5);
|
|
1384
1385
|
|
|
1385
1386
|
// testing: `baseImageUrl`
|
|
@@ -1387,7 +1388,7 @@ describe('Collection Browser', () => {
|
|
|
1387
1388
|
await el.updateComplete;
|
|
1388
1389
|
expect(
|
|
1389
1390
|
infiniteScrollerRefreshSpy.callCount,
|
|
1390
|
-
'6th Infinite Scroller Refresh'
|
|
1391
|
+
'6th Infinite Scroller Refresh',
|
|
1391
1392
|
).to.equal(6);
|
|
1392
1393
|
});
|
|
1393
1394
|
|
|
@@ -1396,7 +1397,7 @@ describe('Collection Browser', () => {
|
|
|
1396
1397
|
|
|
1397
1398
|
const el = await fixture<CollectionBrowser>(
|
|
1398
1399
|
html`<collection-browser .searchService=${searchService}>
|
|
1399
|
-
</collection-browser
|
|
1400
|
+
</collection-browser>`,
|
|
1400
1401
|
);
|
|
1401
1402
|
|
|
1402
1403
|
el.baseQuery = 'single-result';
|
|
@@ -1404,13 +1405,13 @@ describe('Collection Browser', () => {
|
|
|
1404
1405
|
await el.initialSearchComplete;
|
|
1405
1406
|
|
|
1406
1407
|
expect(
|
|
1407
|
-
el.shadowRoot?.querySelector('#big-results-label')?.textContent
|
|
1408
|
+
el.shadowRoot?.querySelector('#big-results-label')?.textContent,
|
|
1408
1409
|
).to.contains('Result');
|
|
1409
1410
|
});
|
|
1410
1411
|
|
|
1411
1412
|
it('`searchContext` prop helps describe where component is being used', async () => {
|
|
1412
1413
|
const el = await fixture<CollectionBrowser>(
|
|
1413
|
-
html`<collection-browser></collection-browser
|
|
1414
|
+
html`<collection-browser></collection-browser>`,
|
|
1414
1415
|
);
|
|
1415
1416
|
|
|
1416
1417
|
expect(el.searchContext).to.equal(analyticsCategories.default);
|
|
@@ -1439,7 +1440,7 @@ describe('Collection Browser', () => {
|
|
|
1439
1440
|
const searchService = new MockSearchService();
|
|
1440
1441
|
const el = await fixture<CollectionBrowser>(
|
|
1441
1442
|
html`<collection-browser .searchService=${searchService}>
|
|
1442
|
-
</collection-browser
|
|
1443
|
+
</collection-browser>`,
|
|
1443
1444
|
);
|
|
1444
1445
|
|
|
1445
1446
|
await el.initialSearchComplete;
|
|
@@ -1473,7 +1474,7 @@ describe('Collection Browser', () => {
|
|
|
1473
1474
|
.searchService=${searchService}
|
|
1474
1475
|
.withinCollection=${'foobar'}
|
|
1475
1476
|
>
|
|
1476
|
-
</collection-browser
|
|
1477
|
+
</collection-browser>`,
|
|
1477
1478
|
);
|
|
1478
1479
|
|
|
1479
1480
|
await el.initialSearchComplete;
|
|
@@ -1507,7 +1508,7 @@ describe('Collection Browser', () => {
|
|
|
1507
1508
|
.withinProfile=${'@foobar'}
|
|
1508
1509
|
.profileElement=${'uploads'}
|
|
1509
1510
|
>
|
|
1510
|
-
</collection-browser
|
|
1511
|
+
</collection-browser>`,
|
|
1511
1512
|
);
|
|
1512
1513
|
|
|
1513
1514
|
await el.initialSearchComplete;
|
|
@@ -1539,7 +1540,7 @@ describe('Collection Browser', () => {
|
|
|
1539
1540
|
const searchService = new MockSearchService();
|
|
1540
1541
|
const el = await fixture<CollectionBrowser>(
|
|
1541
1542
|
html`<collection-browser .searchService=${searchService}>
|
|
1542
|
-
</collection-browser
|
|
1543
|
+
</collection-browser>`,
|
|
1543
1544
|
);
|
|
1544
1545
|
|
|
1545
1546
|
await el.initialSearchComplete;
|
|
@@ -1576,7 +1577,7 @@ describe('Collection Browser', () => {
|
|
|
1576
1577
|
.searchService=${searchService}
|
|
1577
1578
|
.withinCollection=${'foobar'}
|
|
1578
1579
|
>
|
|
1579
|
-
</collection-browser
|
|
1580
|
+
</collection-browser>`,
|
|
1580
1581
|
);
|
|
1581
1582
|
|
|
1582
1583
|
el.baseQuery = 'bar';
|
|
@@ -1611,7 +1612,7 @@ describe('Collection Browser', () => {
|
|
|
1611
1612
|
.searchService=${searchService}
|
|
1612
1613
|
.withinCollection=${'foobar'}
|
|
1613
1614
|
>
|
|
1614
|
-
</collection-browser
|
|
1615
|
+
</collection-browser>`,
|
|
1615
1616
|
);
|
|
1616
1617
|
|
|
1617
1618
|
el.withinCollection = 'bar';
|
|
@@ -1636,7 +1637,7 @@ describe('Collection Browser', () => {
|
|
|
1636
1637
|
.withinProfile=${'@foo'}
|
|
1637
1638
|
.profileElement=${'web_archives'}
|
|
1638
1639
|
>
|
|
1639
|
-
</collection-browser
|
|
1640
|
+
</collection-browser>`,
|
|
1640
1641
|
);
|
|
1641
1642
|
|
|
1642
1643
|
el.baseQuery = 'web-archive';
|
|
@@ -1647,15 +1648,15 @@ describe('Collection Browser', () => {
|
|
|
1647
1648
|
console.log(
|
|
1648
1649
|
'\n\n*****\n\n*****\n\n',
|
|
1649
1650
|
el.dataSource.getAllPages(),
|
|
1650
|
-
'\n\n*****\n\n*****\n\n'
|
|
1651
|
+
'\n\n*****\n\n*****\n\n',
|
|
1651
1652
|
);
|
|
1652
1653
|
expect(el.dataSource.totalResults, 'total results').to.equal(1);
|
|
1653
1654
|
expect(el.dataSource.getTileModelAt(0)?.title).to.equal(
|
|
1654
|
-
'https://example.com'
|
|
1655
|
+
'https://example.com',
|
|
1655
1656
|
);
|
|
1656
1657
|
expect(
|
|
1657
1658
|
el.dataSource.getTileModelAt(0)?.captureDates?.length,
|
|
1658
|
-
'capture dates'
|
|
1659
|
+
'capture dates',
|
|
1659
1660
|
).to.equal(1);
|
|
1660
1661
|
});
|
|
1661
1662
|
|
|
@@ -1666,7 +1667,7 @@ describe('Collection Browser', () => {
|
|
|
1666
1667
|
.searchService=${searchService}
|
|
1667
1668
|
facetLoadStrategy=${'opt-in'}
|
|
1668
1669
|
>
|
|
1669
|
-
</collection-browser
|
|
1670
|
+
</collection-browser>`,
|
|
1670
1671
|
);
|
|
1671
1672
|
|
|
1672
1673
|
el.baseQuery = 'foo';
|
|
@@ -1674,7 +1675,7 @@ describe('Collection Browser', () => {
|
|
|
1674
1675
|
await el.initialSearchComplete;
|
|
1675
1676
|
|
|
1676
1677
|
const facetsDropdown = el.shadowRoot?.querySelector(
|
|
1677
|
-
'.desktop-facets-dropdown'
|
|
1678
|
+
'.desktop-facets-dropdown',
|
|
1678
1679
|
);
|
|
1679
1680
|
expect(facetsDropdown).to.exist;
|
|
1680
1681
|
});
|
|
@@ -1686,7 +1687,7 @@ describe('Collection Browser', () => {
|
|
|
1686
1687
|
.searchService=${searchService}
|
|
1687
1688
|
facetLoadStrategy=${'off'}
|
|
1688
1689
|
>
|
|
1689
|
-
</collection-browser
|
|
1690
|
+
</collection-browser>`,
|
|
1690
1691
|
);
|
|
1691
1692
|
|
|
1692
1693
|
el.baseQuery = 'foo';
|
|
@@ -1696,7 +1697,7 @@ describe('Collection Browser', () => {
|
|
|
1696
1697
|
const facetsMsg = el.shadowRoot?.querySelector('.facets-message');
|
|
1697
1698
|
expect(facetsMsg).to.exist;
|
|
1698
1699
|
expect(facetsMsg?.textContent?.trim()).to.equal(
|
|
1699
|
-
'Facets are temporarily unavailable.'
|
|
1700
|
+
'Facets are temporarily unavailable.',
|
|
1700
1701
|
);
|
|
1701
1702
|
});
|
|
1702
1703
|
|
|
@@ -1704,7 +1705,7 @@ describe('Collection Browser', () => {
|
|
|
1704
1705
|
const searchService = new MockSearchService();
|
|
1705
1706
|
const el = await fixture<CollectionBrowser>(
|
|
1706
1707
|
html`<collection-browser .searchService=${searchService}>
|
|
1707
|
-
</collection-browser
|
|
1708
|
+
</collection-browser>`,
|
|
1708
1709
|
);
|
|
1709
1710
|
|
|
1710
1711
|
el.baseQuery = 'foo';
|
|
@@ -1732,7 +1733,7 @@ describe('Collection Browser', () => {
|
|
|
1732
1733
|
.baseQuery=${'foo'}
|
|
1733
1734
|
.displayMode=${'list-detail'}
|
|
1734
1735
|
>
|
|
1735
|
-
</collection-browser
|
|
1736
|
+
</collection-browser>`,
|
|
1736
1737
|
);
|
|
1737
1738
|
|
|
1738
1739
|
el.isManageView = true;
|
|
@@ -1748,7 +1749,7 @@ describe('Collection Browser', () => {
|
|
|
1748
1749
|
.searchService=${searchService}
|
|
1749
1750
|
.baseNavigationUrl=${''}
|
|
1750
1751
|
>
|
|
1751
|
-
</collection-browser
|
|
1752
|
+
</collection-browser>`,
|
|
1752
1753
|
);
|
|
1753
1754
|
|
|
1754
1755
|
el.baseQuery = 'foo';
|
|
@@ -1769,7 +1770,7 @@ describe('Collection Browser', () => {
|
|
|
1769
1770
|
|
|
1770
1771
|
const firstTile = tiles![0] as TileDispatcher;
|
|
1771
1772
|
const firstTileLink = firstTile.shadowRoot?.querySelector(
|
|
1772
|
-
'a[href]'
|
|
1773
|
+
'a[href]',
|
|
1773
1774
|
) as HTMLAnchorElement;
|
|
1774
1775
|
expect(firstTile.model?.identifier).to.equal('foo');
|
|
1775
1776
|
expect(firstTileLink).to.exist;
|
|
@@ -1796,7 +1797,7 @@ describe('Collection Browser', () => {
|
|
|
1796
1797
|
expect(tiles).to.exist;
|
|
1797
1798
|
expect(
|
|
1798
1799
|
tiles!.length,
|
|
1799
|
-
'tile count after `el.removeCheckedTiles()`'
|
|
1800
|
+
'tile count after `el.removeCheckedTiles()`',
|
|
1800
1801
|
).to.equal(1);
|
|
1801
1802
|
});
|
|
1802
1803
|
|
|
@@ -1807,7 +1808,7 @@ describe('Collection Browser', () => {
|
|
|
1807
1808
|
.searchService=${searchService}
|
|
1808
1809
|
.baseNavigationUrl=${''}
|
|
1809
1810
|
>
|
|
1810
|
-
</collection-browser
|
|
1811
|
+
</collection-browser>`,
|
|
1811
1812
|
);
|
|
1812
1813
|
|
|
1813
1814
|
el.baseQuery = 'foo';
|
|
@@ -1838,7 +1839,7 @@ describe('Collection Browser', () => {
|
|
|
1838
1839
|
.baseNavigationUrl=${''}
|
|
1839
1840
|
@itemRemovalRequested=${spy}
|
|
1840
1841
|
>
|
|
1841
|
-
</collection-browser
|
|
1842
|
+
</collection-browser>`,
|
|
1842
1843
|
);
|
|
1843
1844
|
|
|
1844
1845
|
el.baseQuery = 'foo';
|
|
@@ -1857,7 +1858,7 @@ describe('Collection Browser', () => {
|
|
|
1857
1858
|
|
|
1858
1859
|
const firstTile = tiles![0] as TileDispatcher;
|
|
1859
1860
|
const firstTileLink = firstTile.shadowRoot?.querySelector(
|
|
1860
|
-
'a[href]'
|
|
1861
|
+
'a[href]',
|
|
1861
1862
|
) as HTMLAnchorElement;
|
|
1862
1863
|
expect(firstTile.model?.identifier).to.equal('foo');
|
|
1863
1864
|
expect(firstTileLink).to.exist;
|
|
@@ -1875,7 +1876,7 @@ describe('Collection Browser', () => {
|
|
|
1875
1876
|
await el.updateComplete;
|
|
1876
1877
|
expect(spy.callCount).to.equal(1);
|
|
1877
1878
|
expect(spy.args[0].length).to.equal(1);
|
|
1878
|
-
expect(spy.args[0][0]
|
|
1879
|
+
expect(spy.args[0][0].detail.items[0]).to.equal('foo');
|
|
1879
1880
|
});
|
|
1880
1881
|
|
|
1881
1882
|
it('disables manage view when manage bar cancelled', async () => {
|
|
@@ -1885,7 +1886,7 @@ describe('Collection Browser', () => {
|
|
|
1885
1886
|
.searchService=${searchService}
|
|
1886
1887
|
.baseNavigationUrl=${''}
|
|
1887
1888
|
>
|
|
1888
|
-
</collection-browser
|
|
1889
|
+
</collection-browser>`,
|
|
1889
1890
|
);
|
|
1890
1891
|
|
|
1891
1892
|
el.baseQuery = 'foo';
|
|
@@ -1909,7 +1910,7 @@ describe('Collection Browser', () => {
|
|
|
1909
1910
|
const searchService = new MockSearchService();
|
|
1910
1911
|
const el = await fixture<CollectionBrowser>(
|
|
1911
1912
|
html`<collection-browser .searchService=${searchService}>
|
|
1912
|
-
</collection-browser
|
|
1913
|
+
</collection-browser>`,
|
|
1913
1914
|
);
|
|
1914
1915
|
|
|
1915
1916
|
el.baseQuery = 'foo';
|
|
@@ -1951,7 +1952,7 @@ describe('Collection Browser', () => {
|
|
|
1951
1952
|
.searchService=${searchService}
|
|
1952
1953
|
.enableSortOptionsSlot=${true}
|
|
1953
1954
|
>
|
|
1954
|
-
</collection-browser
|
|
1955
|
+
</collection-browser>`,
|
|
1955
1956
|
);
|
|
1956
1957
|
|
|
1957
1958
|
el.baseQuery = 'collection:foo';
|
|
@@ -1959,7 +1960,7 @@ describe('Collection Browser', () => {
|
|
|
1959
1960
|
await aTimeout(10);
|
|
1960
1961
|
|
|
1961
1962
|
const sortBar = el.shadowRoot?.querySelector(
|
|
1962
|
-
'sort-filter-bar'
|
|
1963
|
+
'sort-filter-bar',
|
|
1963
1964
|
) as SortFilterBar;
|
|
1964
1965
|
expect(sortBar?.enableSortOptionsSlot, 'show loans in sort bar').to.be.true;
|
|
1965
1966
|
expect(el.enableSortOptionsSlot, 'collection browser is loans tab').to.be
|
|
@@ -1975,7 +1976,7 @@ describe('Collection Browser', () => {
|
|
|
1975
1976
|
html`<collection-browser
|
|
1976
1977
|
.searchService=${searchService}
|
|
1977
1978
|
suppressResultCount
|
|
1978
|
-
></collection-browser
|
|
1979
|
+
></collection-browser>`,
|
|
1979
1980
|
);
|
|
1980
1981
|
|
|
1981
1982
|
el.baseQuery = 'collection:foo';
|
|
@@ -1992,7 +1993,7 @@ describe('Collection Browser', () => {
|
|
|
1992
1993
|
html`<collection-browser
|
|
1993
1994
|
.searchService=${searchService}
|
|
1994
1995
|
suppressResultTiles
|
|
1995
|
-
></collection-browser
|
|
1996
|
+
></collection-browser>`,
|
|
1996
1997
|
);
|
|
1997
1998
|
|
|
1998
1999
|
el.baseQuery = 'collection:foo';
|
|
@@ -2011,7 +2012,7 @@ describe('Collection Browser', () => {
|
|
|
2011
2012
|
|
|
2012
2013
|
const el = await fixture<CollectionBrowser>(
|
|
2013
2014
|
html`<collection-browser .searchService=${searchService}>
|
|
2014
|
-
</collection-browser
|
|
2015
|
+
</collection-browser>`,
|
|
2015
2016
|
);
|
|
2016
2017
|
|
|
2017
2018
|
const numberOfPages = 15;
|