@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 { expect, fixture } from '@open-wc/testing';
|
|
3
2
|
import sinon from 'sinon';
|
|
4
3
|
import { html } from 'lit';
|
|
@@ -22,24 +21,24 @@ import type { FacetRow } from '../src/collection-facets/facet-row';
|
|
|
22
21
|
describe('Collection Facets', () => {
|
|
23
22
|
it('has loader', async () => {
|
|
24
23
|
const el = await fixture<CollectionFacets>(
|
|
25
|
-
html`<collection-facets ?facetsLoading=${true}></collection-facets
|
|
24
|
+
html`<collection-facets ?facetsLoading=${true}></collection-facets>`,
|
|
26
25
|
);
|
|
27
26
|
|
|
28
27
|
expect(
|
|
29
|
-
el.shadowRoot?.querySelector('#container')?.classList.contains('loading')
|
|
28
|
+
el.shadowRoot?.querySelector('#container')?.classList.contains('loading'),
|
|
30
29
|
).to.be.true;
|
|
31
30
|
|
|
32
31
|
el.facetsLoading = false;
|
|
33
32
|
await el.updateComplete;
|
|
34
33
|
|
|
35
34
|
expect(
|
|
36
|
-
el.shadowRoot?.querySelector('#container')?.classList.contains('loading')
|
|
35
|
+
el.shadowRoot?.querySelector('#container')?.classList.contains('loading'),
|
|
37
36
|
).to.be.false;
|
|
38
37
|
});
|
|
39
38
|
|
|
40
39
|
it('renders a date picker loading placeholder when date picker enabled', async () => {
|
|
41
40
|
const el = await fixture<CollectionFacets>(
|
|
42
|
-
html`<collection-facets></collection-facets
|
|
41
|
+
html`<collection-facets></collection-facets>`,
|
|
43
42
|
);
|
|
44
43
|
|
|
45
44
|
el.fullYearAggregationLoading = true;
|
|
@@ -47,14 +46,14 @@ describe('Collection Facets', () => {
|
|
|
47
46
|
await el.updateComplete;
|
|
48
47
|
|
|
49
48
|
const histogramLoader = el.shadowRoot?.querySelector(
|
|
50
|
-
'.histogram-loading-indicator'
|
|
49
|
+
'.histogram-loading-indicator',
|
|
51
50
|
);
|
|
52
51
|
expect(histogramLoader).to.exist;
|
|
53
52
|
});
|
|
54
53
|
|
|
55
54
|
it('does not render a date picker loading placeholder when date picker disabled', async () => {
|
|
56
55
|
const el = await fixture<CollectionFacets>(
|
|
57
|
-
html`<collection-facets></collection-facets
|
|
56
|
+
html`<collection-facets></collection-facets>`,
|
|
58
57
|
);
|
|
59
58
|
|
|
60
59
|
el.fullYearAggregationLoading = true;
|
|
@@ -62,14 +61,14 @@ describe('Collection Facets', () => {
|
|
|
62
61
|
await el.updateComplete;
|
|
63
62
|
|
|
64
63
|
const histogramLoader = el.shadowRoot?.querySelector(
|
|
65
|
-
'.histogram-loading-indicator'
|
|
64
|
+
'.histogram-loading-indicator',
|
|
66
65
|
);
|
|
67
66
|
expect(histogramLoader).to.be.null;
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
it('renders the date picker when enabled with data present', async () => {
|
|
71
70
|
const el = await fixture<CollectionFacets>(
|
|
72
|
-
html`<collection-facets></collection-facets
|
|
71
|
+
html`<collection-facets></collection-facets>`,
|
|
73
72
|
);
|
|
74
73
|
|
|
75
74
|
el.fullYearAggregationLoading = false;
|
|
@@ -87,7 +86,7 @@ describe('Collection Facets', () => {
|
|
|
87
86
|
|
|
88
87
|
it('does not render the date picker when disabled', async () => {
|
|
89
88
|
const el = await fixture<CollectionFacets>(
|
|
90
|
-
html`<collection-facets></collection-facets
|
|
89
|
+
html`<collection-facets></collection-facets>`,
|
|
91
90
|
);
|
|
92
91
|
|
|
93
92
|
el.fullYearAggregationLoading = false;
|
|
@@ -105,7 +104,7 @@ describe('Collection Facets', () => {
|
|
|
105
104
|
|
|
106
105
|
it('renders button to expand the date picker when allowed', async () => {
|
|
107
106
|
const el = await fixture<CollectionFacets>(
|
|
108
|
-
html`<collection-facets></collection-facets
|
|
107
|
+
html`<collection-facets></collection-facets>`,
|
|
109
108
|
);
|
|
110
109
|
|
|
111
110
|
el.fullYearAggregationLoading = false;
|
|
@@ -124,7 +123,7 @@ describe('Collection Facets', () => {
|
|
|
124
123
|
|
|
125
124
|
it('does not render button to expand the date picker when disallowed', async () => {
|
|
126
125
|
const el = await fixture<CollectionFacets>(
|
|
127
|
-
html`<collection-facets></collection-facets
|
|
126
|
+
html`<collection-facets></collection-facets>`,
|
|
128
127
|
);
|
|
129
128
|
|
|
130
129
|
el.fullYearAggregationLoading = false;
|
|
@@ -142,10 +141,14 @@ describe('Collection Facets', () => {
|
|
|
142
141
|
});
|
|
143
142
|
|
|
144
143
|
it('opens modal when date picker expand button clicked', async () => {
|
|
144
|
+
const modalManager = await fixture<ModalManager>(
|
|
145
|
+
html`<modal-manager></modal-manager>`,
|
|
146
|
+
);
|
|
147
|
+
|
|
145
148
|
const el = await fixture<CollectionFacets>(
|
|
146
149
|
html`<collection-facets
|
|
147
|
-
.modalManager=${
|
|
148
|
-
></collection-facets
|
|
150
|
+
.modalManager=${modalManager}
|
|
151
|
+
></collection-facets>`,
|
|
149
152
|
);
|
|
150
153
|
|
|
151
154
|
el.fullYearAggregationLoading = false;
|
|
@@ -159,13 +162,13 @@ describe('Collection Facets', () => {
|
|
|
159
162
|
await el.updateComplete;
|
|
160
163
|
|
|
161
164
|
const expandBtn = el.shadowRoot?.querySelector(
|
|
162
|
-
'.expand-date-picker-btn'
|
|
165
|
+
'.expand-date-picker-btn',
|
|
163
166
|
) as HTMLButtonElement;
|
|
164
167
|
expect(expandBtn).to.exist;
|
|
165
168
|
|
|
166
169
|
const showModalSpy = sinon.spy(
|
|
167
170
|
el.modalManager as ModalManagerInterface,
|
|
168
|
-
'showModal'
|
|
171
|
+
'showModal',
|
|
169
172
|
);
|
|
170
173
|
|
|
171
174
|
// Click the expand button to open the modal
|
|
@@ -179,7 +182,7 @@ describe('Collection Facets', () => {
|
|
|
179
182
|
|
|
180
183
|
it('renders aggregations as facets', async () => {
|
|
181
184
|
const el = await fixture<CollectionFacets>(
|
|
182
|
-
html`<collection-facets></collection-facets
|
|
185
|
+
html`<collection-facets></collection-facets>`,
|
|
183
186
|
);
|
|
184
187
|
|
|
185
188
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -202,11 +205,11 @@ describe('Collection Facets', () => {
|
|
|
202
205
|
const facetGroupHeader = titleFacetGroup?.querySelector('h3');
|
|
203
206
|
// Every facet group header has an invisible " filters" suffix for screen-readers
|
|
204
207
|
expect(
|
|
205
|
-
facetGroupHeader?.querySelector('span.sr-only')?.textContent?.trim()
|
|
208
|
+
facetGroupHeader?.querySelector('span.sr-only')?.textContent?.trim(),
|
|
206
209
|
).to.equal('filters');
|
|
207
210
|
// Ignoring the screen-reader suffix, we should be left with only the readable, capitalized title
|
|
208
211
|
expect(
|
|
209
|
-
facetGroupHeader?.textContent?.trim().replace(/\s*filters$/, '')
|
|
212
|
+
facetGroupHeader?.textContent?.trim().replace(/\s*filters$/, ''),
|
|
210
213
|
).to.equal('Subject');
|
|
211
214
|
|
|
212
215
|
const titleFacetRow = titleFacetGroup
|
|
@@ -215,13 +218,13 @@ describe('Collection Facets', () => {
|
|
|
215
218
|
await titleFacetRow.updateComplete;
|
|
216
219
|
|
|
217
220
|
expect(titleFacetRow?.shadowRoot?.textContent?.trim()).to.satisfy(
|
|
218
|
-
(text: string) => /^foo\s*5$/.test(text)
|
|
221
|
+
(text: string) => /^foo\s*5$/.test(text),
|
|
219
222
|
);
|
|
220
223
|
});
|
|
221
224
|
|
|
222
225
|
it('renders multiple aggregation types', async () => {
|
|
223
226
|
const el = await fixture<CollectionFacets>(
|
|
224
|
-
html`<collection-facets></collection-facets
|
|
227
|
+
html`<collection-facets></collection-facets>`,
|
|
225
228
|
);
|
|
226
229
|
|
|
227
230
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -252,7 +255,7 @@ describe('Collection Facets', () => {
|
|
|
252
255
|
|
|
253
256
|
it('does not render suppressed collection facets', async () => {
|
|
254
257
|
const el = await fixture<CollectionFacets>(
|
|
255
|
-
html`<collection-facets></collection-facets
|
|
258
|
+
html`<collection-facets></collection-facets>`,
|
|
256
259
|
);
|
|
257
260
|
|
|
258
261
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -506,7 +509,7 @@ describe('Collection Facets', () => {
|
|
|
506
509
|
|
|
507
510
|
it('always renders the mediatype:collection facet when present', async () => {
|
|
508
511
|
const el = await fixture<CollectionFacets>(
|
|
509
|
-
html`<collection-facets></collection-facets
|
|
512
|
+
html`<collection-facets></collection-facets>`,
|
|
510
513
|
);
|
|
511
514
|
|
|
512
515
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -553,7 +556,7 @@ describe('Collection Facets', () => {
|
|
|
553
556
|
|
|
554
557
|
const facetsTemplate = el.shadowRoot?.querySelector('facets-template');
|
|
555
558
|
const facetRows = facetsTemplate?.shadowRoot?.querySelectorAll(
|
|
556
|
-
'facet-row'
|
|
559
|
+
'facet-row',
|
|
557
560
|
) as ArrayLike<FacetRow>;
|
|
558
561
|
expect(facetRows?.length).to.equal(6);
|
|
559
562
|
expect(facetRows?.[5]?.bucket?.key).to.equal('collection');
|
|
@@ -561,7 +564,7 @@ describe('Collection Facets', () => {
|
|
|
561
564
|
|
|
562
565
|
it('renders the mediatype:collection facet even when >=6 other mediatypes are selected', async () => {
|
|
563
566
|
const el = await fixture<CollectionFacets>(
|
|
564
|
-
html`<collection-facets></collection-facets
|
|
567
|
+
html`<collection-facets></collection-facets>`,
|
|
565
568
|
);
|
|
566
569
|
|
|
567
570
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -620,7 +623,7 @@ describe('Collection Facets', () => {
|
|
|
620
623
|
|
|
621
624
|
const facetsTemplate = el.shadowRoot?.querySelector('facets-template');
|
|
622
625
|
const facetRows = facetsTemplate?.shadowRoot?.querySelectorAll(
|
|
623
|
-
'facet-row'
|
|
626
|
+
'facet-row',
|
|
624
627
|
) as ArrayLike<FacetRow>;
|
|
625
628
|
expect(facetRows?.length).to.equal(8);
|
|
626
629
|
expect(facetRows?.[7]?.bucket?.key).to.equal('collection');
|
|
@@ -629,7 +632,7 @@ describe('Collection Facets', () => {
|
|
|
629
632
|
describe('More Facets', () => {
|
|
630
633
|
it('Does not render < allowedFacetCount', async () => {
|
|
631
634
|
const el = await fixture<CollectionFacets>(
|
|
632
|
-
html`<collection-facets></collection-facets
|
|
635
|
+
html`<collection-facets></collection-facets>`,
|
|
633
636
|
);
|
|
634
637
|
|
|
635
638
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -651,10 +654,14 @@ describe('Collection Facets', () => {
|
|
|
651
654
|
});
|
|
652
655
|
|
|
653
656
|
it('Render More Facets', async () => {
|
|
657
|
+
const modalManager = await fixture<ModalManager>(
|
|
658
|
+
html`<modal-manager></modal-manager>`,
|
|
659
|
+
);
|
|
660
|
+
|
|
654
661
|
const el = await fixture<CollectionFacets>(
|
|
655
662
|
html`<collection-facets
|
|
656
|
-
.modalManager=${
|
|
657
|
-
></collection-facets
|
|
663
|
+
.modalManager=${modalManager}
|
|
664
|
+
></collection-facets>`,
|
|
658
665
|
);
|
|
659
666
|
|
|
660
667
|
const aggs: Record<string, Aggregation> = {
|
|
@@ -703,13 +710,13 @@ describe('Collection Facets', () => {
|
|
|
703
710
|
});
|
|
704
711
|
|
|
705
712
|
const moreLink = el.shadowRoot?.querySelector(
|
|
706
|
-
'.more-link'
|
|
713
|
+
'.more-link',
|
|
707
714
|
) as HTMLButtonElement;
|
|
708
715
|
expect(moreLink).to.exist; // has link
|
|
709
716
|
|
|
710
717
|
const showModalSpy = sinon.spy(
|
|
711
718
|
el.modalManager as ModalManagerInterface,
|
|
712
|
-
'showModal'
|
|
719
|
+
'showModal',
|
|
713
720
|
);
|
|
714
721
|
// let's pop up modal
|
|
715
722
|
moreLink?.click();
|
|
@@ -729,7 +736,7 @@ describe('Collection Facets', () => {
|
|
|
729
736
|
const el = await fixture<CollectionFacets>(
|
|
730
737
|
html`<collection-facets
|
|
731
738
|
.analyticsHandler=${mockAnalyticsHandler}
|
|
732
|
-
></collection-facets
|
|
739
|
+
></collection-facets>`,
|
|
733
740
|
);
|
|
734
741
|
const aggs: Record<string, Aggregation> = {
|
|
735
742
|
subject: new Aggregation({
|
|
@@ -770,7 +777,7 @@ describe('Collection Facets', () => {
|
|
|
770
777
|
await el.updateComplete;
|
|
771
778
|
|
|
772
779
|
const moreLink = el.shadowRoot?.querySelector(
|
|
773
|
-
'.more-link'
|
|
780
|
+
'.more-link',
|
|
774
781
|
) as HTMLButtonElement;
|
|
775
782
|
|
|
776
783
|
expect(moreLink).to.exist; // has link
|
|
@@ -794,7 +801,7 @@ describe('Collection Facets', () => {
|
|
|
794
801
|
['bar', 'bar-name'],
|
|
795
802
|
['baz', 'baz-name'],
|
|
796
803
|
])}
|
|
797
|
-
></collection-facets
|
|
804
|
+
></collection-facets>`,
|
|
798
805
|
);
|
|
799
806
|
|
|
800
807
|
const partOfSection = el.shadowRoot?.querySelector('.partof-collections');
|
|
@@ -812,7 +819,7 @@ describe('Collection Facets', () => {
|
|
|
812
819
|
it('does not include Part Of section without parent collections', async () => {
|
|
813
820
|
// No parentCollections prop
|
|
814
821
|
const el = await fixture<CollectionFacets>(
|
|
815
|
-
html`<collection-facets .withinCollection=${'foo'}></collection-facets
|
|
822
|
+
html`<collection-facets .withinCollection=${'foo'}></collection-facets>`,
|
|
816
823
|
);
|
|
817
824
|
|
|
818
825
|
const partOfSection = el.shadowRoot?.querySelector('.partof-collections');
|
|
@@ -825,7 +832,7 @@ describe('Collection Facets', () => {
|
|
|
825
832
|
const el = await fixture<CollectionFacets>(
|
|
826
833
|
html`<collection-facets
|
|
827
834
|
.analyticsHandler=${mockAnalyticsHandler}
|
|
828
|
-
></collection-facets
|
|
835
|
+
></collection-facets>`,
|
|
829
836
|
);
|
|
830
837
|
|
|
831
838
|
el.fullYearAggregationLoading = false;
|
|
@@ -839,7 +846,7 @@ describe('Collection Facets', () => {
|
|
|
839
846
|
await el.updateComplete;
|
|
840
847
|
|
|
841
848
|
const expandBtn = el.shadowRoot?.querySelector(
|
|
842
|
-
'.expand-date-picker-btn'
|
|
849
|
+
'.expand-date-picker-btn',
|
|
843
850
|
) as HTMLButtonElement;
|
|
844
851
|
expect(expandBtn).to.exist;
|
|
845
852
|
|
|
@@ -861,11 +868,11 @@ describe('Collection Facets', () => {
|
|
|
861
868
|
.withinCollection=${'foo'}
|
|
862
869
|
.parentCollections=${['bar']}
|
|
863
870
|
.analyticsHandler=${mockAnalyticsHandler}
|
|
864
|
-
></collection-facets
|
|
871
|
+
></collection-facets>`,
|
|
865
872
|
);
|
|
866
873
|
|
|
867
874
|
const partOfLinks = el.shadowRoot?.querySelectorAll(
|
|
868
|
-
'.partof-collections a[href]'
|
|
875
|
+
'.partof-collections a[href]',
|
|
869
876
|
);
|
|
870
877
|
expect(partOfLinks?.length).to.equal(1);
|
|
871
878
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
1
|
import { expect, fixture } from '@open-wc/testing';
|
|
3
2
|
import { html } from 'lit';
|
|
4
3
|
import '../src/empty-placeholder';
|
|
@@ -8,7 +7,7 @@ import type { EmptyPlaceholder } from '../src/empty-placeholder';
|
|
|
8
7
|
describe('Empty Placeholder', () => {
|
|
9
8
|
it('should render with empty-query placeholder', async () => {
|
|
10
9
|
const el = await fixture<EmptyPlaceholder>(
|
|
11
|
-
html`<empty-placeholder></empty-placeholder
|
|
10
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
12
11
|
);
|
|
13
12
|
|
|
14
13
|
el.placeholderType = 'empty-query';
|
|
@@ -21,7 +20,7 @@ describe('Empty Placeholder', () => {
|
|
|
21
20
|
|
|
22
21
|
it('should render with empty-collection placeholder', async () => {
|
|
23
22
|
const el = await fixture<EmptyPlaceholder>(
|
|
24
|
-
html`<empty-placeholder></empty-placeholder
|
|
23
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
25
24
|
);
|
|
26
25
|
|
|
27
26
|
el.placeholderType = 'empty-collection';
|
|
@@ -34,7 +33,7 @@ describe('Empty Placeholder', () => {
|
|
|
34
33
|
|
|
35
34
|
it('should render with no-results placeholder', async () => {
|
|
36
35
|
const el = await fixture<EmptyPlaceholder>(
|
|
37
|
-
html`<empty-placeholder></empty-placeholder
|
|
36
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
38
37
|
);
|
|
39
38
|
|
|
40
39
|
el.placeholderType = 'no-results';
|
|
@@ -47,7 +46,7 @@ describe('Empty Placeholder', () => {
|
|
|
47
46
|
|
|
48
47
|
it('should render with query-error placeholder', async () => {
|
|
49
48
|
const el = await fixture<EmptyPlaceholder>(
|
|
50
|
-
html`<empty-placeholder></empty-placeholder
|
|
49
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
51
50
|
);
|
|
52
51
|
|
|
53
52
|
el.placeholderType = 'query-error';
|
|
@@ -60,7 +59,7 @@ describe('Empty Placeholder', () => {
|
|
|
60
59
|
|
|
61
60
|
it('should render with collection-error placeholder', async () => {
|
|
62
61
|
const el = await fixture<EmptyPlaceholder>(
|
|
63
|
-
html`<empty-placeholder></empty-placeholder
|
|
62
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
64
63
|
);
|
|
65
64
|
|
|
66
65
|
el.placeholderType = 'collection-error';
|
|
@@ -73,7 +72,7 @@ describe('Empty Placeholder', () => {
|
|
|
73
72
|
|
|
74
73
|
it('should not render any empty placeholder', async () => {
|
|
75
74
|
const el = await fixture<EmptyPlaceholder>(
|
|
76
|
-
html`<empty-placeholder></empty-placeholder
|
|
75
|
+
html`<empty-placeholder></empty-placeholder>`,
|
|
77
76
|
);
|
|
78
77
|
|
|
79
78
|
el.placeholderType = null;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
1
|
import type { HistogramDateRange } from '@internetarchive/histogram-date-range';
|
|
3
2
|
import {
|
|
4
3
|
ModalManager,
|
|
@@ -20,7 +19,7 @@ import {
|
|
|
20
19
|
describe('Expanded Date Picker', () => {
|
|
21
20
|
it('should render with a date picker and Apply button', async () => {
|
|
22
21
|
const el = await fixture<ExpandedDatePicker>(
|
|
23
|
-
html`<expanded-date-picker></expanded-date-picker
|
|
22
|
+
html`<expanded-date-picker></expanded-date-picker>`,
|
|
24
23
|
);
|
|
25
24
|
|
|
26
25
|
expect(el.shadowRoot?.querySelector('#date-picker')).to.exist;
|
|
@@ -35,11 +34,11 @@ describe('Expanded Date Picker', () => {
|
|
|
35
34
|
.maxDate=${'5'}
|
|
36
35
|
.minSelectedDate=${'1'}
|
|
37
36
|
.maxSelectedDate=${'5'}
|
|
38
|
-
></expanded-date-picker
|
|
37
|
+
></expanded-date-picker>`,
|
|
39
38
|
);
|
|
40
39
|
|
|
41
40
|
const datePicker = el.shadowRoot?.querySelector(
|
|
42
|
-
'#date-picker'
|
|
41
|
+
'#date-picker',
|
|
43
42
|
) as HistogramDateRange;
|
|
44
43
|
expect(datePicker).to.exist;
|
|
45
44
|
|
|
@@ -51,7 +50,7 @@ describe('Expanded Date Picker', () => {
|
|
|
51
50
|
minDate: datePicker.minSelectedDate,
|
|
52
51
|
maxDate: datePicker.maxSelectedDate,
|
|
53
52
|
},
|
|
54
|
-
})
|
|
53
|
+
}),
|
|
55
54
|
);
|
|
56
55
|
await el.updateComplete;
|
|
57
56
|
|
|
@@ -69,11 +68,11 @@ describe('Expanded Date Picker', () => {
|
|
|
69
68
|
.minSelectedDate=${'1'}
|
|
70
69
|
.maxSelectedDate=${'5'}
|
|
71
70
|
@histogramDateRangeApplied=${applySpy}
|
|
72
|
-
></expanded-date-picker
|
|
71
|
+
></expanded-date-picker>`,
|
|
73
72
|
);
|
|
74
73
|
|
|
75
74
|
const applyBtn = el.shadowRoot?.querySelector(
|
|
76
|
-
'#apply-btn'
|
|
75
|
+
'#apply-btn',
|
|
77
76
|
) as HTMLButtonElement;
|
|
78
77
|
expect(applyBtn).to.exist;
|
|
79
78
|
|
|
@@ -82,12 +81,14 @@ describe('Expanded Date Picker', () => {
|
|
|
82
81
|
|
|
83
82
|
expect(applySpy.callCount).to.equal(1);
|
|
84
83
|
expect(
|
|
85
|
-
applySpy.calledWithMatch({ detail: { minDate: '1', maxDate: '5' } })
|
|
84
|
+
applySpy.calledWithMatch({ detail: { minDate: '1', maxDate: '5' } }),
|
|
86
85
|
);
|
|
87
86
|
});
|
|
88
87
|
|
|
89
88
|
it('should close its modal and emit close event when date range applied', async () => {
|
|
90
|
-
const modalManager =
|
|
89
|
+
const modalManager = await fixture<ModalManager>(
|
|
90
|
+
html`<modal-manager></modal-manager>`,
|
|
91
|
+
);
|
|
91
92
|
modalManager.mode = ModalManagerMode.Open;
|
|
92
93
|
|
|
93
94
|
const modalClosed = sinon.spy();
|
|
@@ -101,11 +102,11 @@ describe('Expanded Date Picker', () => {
|
|
|
101
102
|
.maxSelectedDate=${'5'}
|
|
102
103
|
.modalManager=${modalManager}
|
|
103
104
|
@modalClosed=${modalClosed}
|
|
104
|
-
></expanded-date-picker
|
|
105
|
+
></expanded-date-picker>`,
|
|
105
106
|
);
|
|
106
107
|
|
|
107
108
|
const applyBtn = el.shadowRoot?.querySelector(
|
|
108
|
-
'#apply-btn'
|
|
109
|
+
'#apply-btn',
|
|
109
110
|
) as HTMLButtonElement;
|
|
110
111
|
expect(applyBtn).to.exist;
|
|
111
112
|
|
|
@@ -117,6 +118,10 @@ describe('Expanded Date Picker', () => {
|
|
|
117
118
|
});
|
|
118
119
|
|
|
119
120
|
it('closes the modal when Esc key is pressed', async () => {
|
|
121
|
+
const modalManager = await fixture<ModalManager>(
|
|
122
|
+
html`<modal-manager></modal-manager>`,
|
|
123
|
+
);
|
|
124
|
+
|
|
120
125
|
const el = await fixture<ExpandedDatePicker>(
|
|
121
126
|
html`<expanded-date-picker
|
|
122
127
|
.buckets=${[1, 2, 3, 4, 5]}
|
|
@@ -124,13 +129,13 @@ describe('Expanded Date Picker', () => {
|
|
|
124
129
|
.maxDate=${'5'}
|
|
125
130
|
.minSelectedDate=${'1'}
|
|
126
131
|
.maxSelectedDate=${'5'}
|
|
127
|
-
.modalManager=${
|
|
128
|
-
></expanded-date-picker
|
|
132
|
+
.modalManager=${modalManager}
|
|
133
|
+
></expanded-date-picker>`,
|
|
129
134
|
);
|
|
130
135
|
|
|
131
136
|
const closeModalSpy = sinon.spy(
|
|
132
137
|
el.modalManager as ModalManagerInterface,
|
|
133
|
-
'closeModal'
|
|
138
|
+
'closeModal',
|
|
134
139
|
);
|
|
135
140
|
|
|
136
141
|
// Dispatch an Esc keydown event
|
|
@@ -150,11 +155,11 @@ describe('Expanded Date Picker', () => {
|
|
|
150
155
|
.minDate=${'1'}
|
|
151
156
|
.maxDate=${'5'}
|
|
152
157
|
.analyticsHandler=${analyticsHandler}
|
|
153
|
-
></expanded-date-picker
|
|
158
|
+
></expanded-date-picker>`,
|
|
154
159
|
);
|
|
155
160
|
|
|
156
161
|
const applyBtn = el.shadowRoot?.querySelector(
|
|
157
|
-
'#apply-btn'
|
|
162
|
+
'#apply-btn',
|
|
158
163
|
) as HTMLButtonElement;
|
|
159
164
|
expect(applyBtn).to.exist;
|
|
160
165
|
|
|
@@ -163,12 +168,12 @@ describe('Expanded Date Picker', () => {
|
|
|
163
168
|
|
|
164
169
|
expect(analyticsHandler.callCategory).to.equal(analyticsCategories.default);
|
|
165
170
|
expect(analyticsHandler.callAction).to.equal(
|
|
166
|
-
analyticsActions.histogramChangedFromModal
|
|
171
|
+
analyticsActions.histogramChangedFromModal,
|
|
167
172
|
);
|
|
168
173
|
expect(analyticsHandler.callLabel).to.equal(window.location.href);
|
|
169
174
|
|
|
170
175
|
const datePicker = el.shadowRoot?.querySelector(
|
|
171
|
-
'#date-picker'
|
|
176
|
+
'#date-picker',
|
|
172
177
|
) as HistogramDateRange;
|
|
173
178
|
expect(datePicker).to.exist;
|
|
174
179
|
|
|
@@ -180,7 +185,7 @@ describe('Expanded Date Picker', () => {
|
|
|
180
185
|
minDate: datePicker.minSelectedDate,
|
|
181
186
|
maxDate: datePicker.maxSelectedDate,
|
|
182
187
|
},
|
|
183
|
-
})
|
|
188
|
+
}),
|
|
184
189
|
);
|
|
185
190
|
await el.updateComplete;
|
|
186
191
|
|
|
@@ -189,7 +194,7 @@ describe('Expanded Date Picker', () => {
|
|
|
189
194
|
|
|
190
195
|
expect(analyticsHandler.callCategory).to.equal(analyticsCategories.default);
|
|
191
196
|
expect(analyticsHandler.callAction).to.equal(
|
|
192
|
-
analyticsActions.histogramChangedFromModal
|
|
197
|
+
analyticsActions.histogramChangedFromModal,
|
|
193
198
|
);
|
|
194
199
|
expect(analyticsHandler.callLabel).to.equal(window.location.href);
|
|
195
200
|
});
|
package/test/image-block.test.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
1
|
import { expect, fixture } from '@open-wc/testing';
|
|
3
2
|
import { html } from 'lit';
|
|
4
3
|
import type { ImageBlock } from '../src/tiles/image-block';
|
|
@@ -102,7 +101,7 @@ describe('Image block component', () => {
|
|
|
102
101
|
`);
|
|
103
102
|
|
|
104
103
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
105
|
-
'text-overlay'
|
|
104
|
+
'text-overlay',
|
|
106
105
|
) as TextOverlay;
|
|
107
106
|
expect(textOverlay).to.exist;
|
|
108
107
|
expect(textOverlay.type).to.equal('login-required');
|
|
@@ -125,7 +124,7 @@ describe('Image block component', () => {
|
|
|
125
124
|
`);
|
|
126
125
|
|
|
127
126
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
128
|
-
'text-overlay'
|
|
127
|
+
'text-overlay',
|
|
129
128
|
) as TextOverlay;
|
|
130
129
|
expect(textOverlay).not.to.exist;
|
|
131
130
|
});
|
|
@@ -147,7 +146,7 @@ describe('Image block component', () => {
|
|
|
147
146
|
`);
|
|
148
147
|
|
|
149
148
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
150
|
-
'text-overlay'
|
|
149
|
+
'text-overlay',
|
|
151
150
|
) as TextOverlay;
|
|
152
151
|
expect(textOverlay).to.exist;
|
|
153
152
|
expect(textOverlay.type).to.equal('content-warning');
|
|
@@ -171,7 +170,7 @@ describe('Image block component', () => {
|
|
|
171
170
|
`);
|
|
172
171
|
|
|
173
172
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
174
|
-
'text-overlay'
|
|
173
|
+
'text-overlay',
|
|
175
174
|
) as TextOverlay;
|
|
176
175
|
expect(textOverlay).to.exist;
|
|
177
176
|
expect(textOverlay.type).to.equal('login-required');
|
|
@@ -195,7 +194,7 @@ describe('Image block component', () => {
|
|
|
195
194
|
`);
|
|
196
195
|
|
|
197
196
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
198
|
-
'text-overlay'
|
|
197
|
+
'text-overlay',
|
|
199
198
|
) as TextOverlay;
|
|
200
199
|
expect(textOverlay).to.exist;
|
|
201
200
|
expect(textOverlay.type).to.equal('content-warning');
|
|
@@ -217,7 +216,7 @@ describe('Image block component', () => {
|
|
|
217
216
|
`);
|
|
218
217
|
|
|
219
218
|
const textOverlay = el.shadowRoot?.querySelector(
|
|
220
|
-
'text-overlay'
|
|
219
|
+
'text-overlay',
|
|
221
220
|
) as TextOverlay;
|
|
222
221
|
expect(textOverlay).not.to.exist;
|
|
223
222
|
});
|
package/test/item-image.test.ts
CHANGED