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