@internetarchive/collection-browser 4.7.1-alpha-webdev9189.0 → 4.8.1-webdev-9227.1
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/README.md +33 -0
- package/dist/src/app-root.js +0 -2
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/assets/img/icons/check.d.ts +2 -0
- package/dist/src/assets/img/icons/check.js +5 -0
- package/dist/src/assets/img/icons/check.js.map +1 -0
- package/dist/src/collection-browser.d.ts +2 -1
- package/dist/src/collection-browser.js +5 -27
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row-template.d.ts +38 -0
- package/dist/src/collection-facets/facet-row-template.js +200 -0
- package/dist/src/collection-facets/facet-row-template.js.map +1 -0
- package/dist/src/collection-facets/facet-row.js +11 -186
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/models.d.ts +7 -2
- package/dist/src/collection-facets/models.js +7 -2
- package/dist/src/collection-facets/models.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
- package/dist/src/collection-facets/more-facets-content.js +479 -201
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
- package/dist/src/collection-facets/more-facets-scroller.js +429 -0
- package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
- package/dist/src/collection-facets/page-window.d.ts +73 -0
- package/dist/src/collection-facets/page-window.js +202 -0
- package/dist/src/collection-facets/page-window.js.map +1 -0
- package/dist/src/collection-facets/toggle-switch.js +1 -0
- 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/empty-placeholder.d.ts +7 -7
- package/dist/src/empty-placeholder.js +29 -15
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.js +3 -2
- package/dist/src/expanded-date-picker.js.map +1 -1
- package/dist/src/locales/es.d.ts +94 -0
- package/dist/src/locales/es.js +109 -0
- package/dist/src/locales/es.js.map +1 -0
- package/dist/src/manage/manage-bar.d.ts +3 -2
- package/dist/src/manage/manage-bar.js +6 -7
- package/dist/src/manage/manage-bar.js.map +1 -1
- package/dist/src/manage/remove-items-modal-content.js +3 -2
- package/dist/src/manage/remove-items-modal-content.js.map +1 -1
- package/dist/src/models.d.ts +4 -0
- package/dist/src/models.js +22 -2
- package/dist/src/models.js.map +1 -1
- package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -3
- package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
- package/dist/src/tiles/grid/account-tile.js +3 -2
- package/dist/src/tiles/grid/account-tile.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +3 -2
- 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/tile-stats.js +3 -2
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +3 -2
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +3 -1
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.js +3 -2
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/overlay/text-overlay.js +3 -1
- package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
- package/dist/src/tiles/review-block.js +3 -2
- package/dist/src/tiles/review-block.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +2 -1
- package/dist/src/tiles/tile-dispatcher.js +5 -4
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/log.d.ts +1 -4
- package/dist/src/utils/normalize-filter-text.d.ts +28 -0
- package/dist/src/utils/normalize-filter-text.js +35 -0
- package/dist/src/utils/normalize-filter-text.js.map +1 -0
- package/locales/es.d.ts +1 -0
- package/locales/es.js +1 -0
- package/package.json +15 -1
- package/.editorconfig +0 -29
- package/.github/workflows/ci.yml +0 -29
- package/.github/workflows/gh-pages-main.yml +0 -41
- package/.github/workflows/npm-publish.yml +0 -42
- package/.github/workflows/pr-preview.yml +0 -40
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
- package/dist/src/collection-facets/more-facets-pagination.js +0 -260
- package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
- package/dist/test/collection-browser.test.d.ts +0 -1
- package/dist/test/collection-browser.test.js +0 -1849
- package/dist/test/collection-browser.test.js.map +0 -1
- package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
- package/dist/test/collection-facets/facet-row.test.js +0 -291
- package/dist/test/collection-facets/facet-row.test.js.map +0 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
- package/dist/test/collection-facets/facets-template.test.js +0 -95
- package/dist/test/collection-facets/facets-template.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-content.test.js +0 -159
- package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
- package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
- package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
- package/dist/test/collection-facets/toggle-switch.test.js +0 -99
- package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
- package/dist/test/collection-facets.test.d.ts +0 -2
- package/dist/test/collection-facets.test.js +0 -728
- package/dist/test/collection-facets.test.js.map +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
- package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
- package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
- package/dist/test/empty-placeholder.test.d.ts +0 -1
- package/dist/test/empty-placeholder.test.js +0 -57
- package/dist/test/empty-placeholder.test.js.map +0 -1
- package/dist/test/expanded-date-picker.test.d.ts +0 -1
- package/dist/test/expanded-date-picker.test.js +0 -124
- package/dist/test/expanded-date-picker.test.js.map +0 -1
- package/dist/test/icon-overlay.test.d.ts +0 -1
- package/dist/test/icon-overlay.test.js +0 -31
- package/dist/test/icon-overlay.test.js.map +0 -1
- package/dist/test/image-block.test.d.ts +0 -1
- package/dist/test/image-block.test.js +0 -208
- package/dist/test/image-block.test.js.map +0 -1
- package/dist/test/item-image.test.d.ts +0 -1
- package/dist/test/item-image.test.js +0 -187
- package/dist/test/item-image.test.js.map +0 -1
- package/dist/test/manage/manage-bar.test.d.ts +0 -3
- package/dist/test/manage/manage-bar.test.js +0 -216
- package/dist/test/manage/manage-bar.test.js.map +0 -1
- package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
- package/dist/test/manage/remove-items-modal-content.test.js +0 -60
- package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
- package/dist/test/mediatype-config.test.d.ts +0 -1
- package/dist/test/mediatype-config.test.js +0 -11
- package/dist/test/mediatype-config.test.js.map +0 -1
- package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
- package/dist/test/mocks/mock-analytics-handler.js +0 -16
- package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
- package/dist/test/mocks/mock-search-responses.d.ts +0 -31
- package/dist/test/mocks/mock-search-responses.js +0 -1241
- package/dist/test/mocks/mock-search-responses.js.map +0 -1
- package/dist/test/mocks/mock-search-service.d.ts +0 -16
- package/dist/test/mocks/mock-search-service.js +0 -64
- package/dist/test/mocks/mock-search-service.js.map +0 -1
- package/dist/test/restoration-state-handler.test.d.ts +0 -1
- package/dist/test/restoration-state-handler.test.js +0 -335
- package/dist/test/restoration-state-handler.test.js.map +0 -1
- package/dist/test/review-block.test.d.ts +0 -1
- package/dist/test/review-block.test.js +0 -46
- package/dist/test/review-block.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
- package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -326
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
- package/dist/test/text-overlay.test.d.ts +0 -1
- package/dist/test/text-overlay.test.js +0 -43
- package/dist/test/text-overlay.test.js.map +0 -1
- package/dist/test/text-snippet-block.test.d.ts +0 -1
- package/dist/test/text-snippet-block.test.js +0 -58
- package/dist/test/text-snippet-block.test.js.map +0 -1
- package/dist/test/tile-stats.test.d.ts +0 -1
- package/dist/test/tile-stats.test.js +0 -167
- package/dist/test/tile-stats.test.js.map +0 -1
- package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/account-tile.test.js +0 -96
- package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/collection-tile.test.js +0 -90
- package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/item-tile.test.js +0 -400
- package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
- package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
- package/dist/test/tiles/grid/search-tile.test.js +0 -62
- package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
- package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
- package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
- package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
- package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
- package/dist/test/tiles/list/tile-list.test.js +0 -460
- package/dist/test/tiles/list/tile-list.test.js.map +0 -1
- package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
- package/dist/test/tiles/tile-dispatcher.test.js +0 -246
- package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
- package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
- package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
- package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
- package/dist/test/utils/array-equals.test.d.ts +0 -1
- package/dist/test/utils/array-equals.test.js +0 -27
- package/dist/test/utils/array-equals.test.js.map +0 -1
- package/dist/test/utils/format-count.test.d.ts +0 -1
- package/dist/test/utils/format-count.test.js +0 -24
- package/dist/test/utils/format-count.test.js.map +0 -1
- package/dist/test/utils/format-date.test.d.ts +0 -1
- package/dist/test/utils/format-date.test.js +0 -61
- package/dist/test/utils/format-date.test.js.map +0 -1
- package/dist/test/utils/format-unit-size.test.d.ts +0 -1
- package/dist/test/utils/format-unit-size.test.js +0 -18
- package/dist/test/utils/format-unit-size.test.js.map +0 -1
- package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
- package/dist/test/utils/local-date-from-utc.test.js +0 -27
- package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
- package/eslint.config.mjs +0 -53
- package/index.html +0 -24
- package/index.ts +0 -29
- package/local.archive.org.cert +0 -86
- package/local.archive.org.key +0 -27
- package/pnpm-workspace.yaml +0 -30
- package/renovate.json +0 -6
- package/src/app-root.ts +0 -1284
- package/src/assets/img/icons/arrow-left.ts +0 -10
- package/src/assets/img/icons/arrow-right.ts +0 -10
- package/src/assets/img/icons/chevron.ts +0 -4
- package/src/assets/img/icons/close-circle-dark.ts +0 -5
- package/src/assets/img/icons/contract.ts +0 -9
- package/src/assets/img/icons/empty-query.ts +0 -5
- package/src/assets/img/icons/expand.ts +0 -9
- package/src/assets/img/icons/eye-closed.ts +0 -5
- package/src/assets/img/icons/eye.ts +0 -5
- package/src/assets/img/icons/favorite-filled.ts +0 -10
- package/src/assets/img/icons/favorite-unfilled.ts +0 -9
- package/src/assets/img/icons/filter.ts +0 -10
- package/src/assets/img/icons/login-required.ts +0 -18
- package/src/assets/img/icons/mediatype/account.ts +0 -14
- package/src/assets/img/icons/mediatype/audio.ts +0 -14
- package/src/assets/img/icons/mediatype/collection.ts +0 -12
- package/src/assets/img/icons/mediatype/data.ts +0 -15
- package/src/assets/img/icons/mediatype/etree.ts +0 -14
- package/src/assets/img/icons/mediatype/film.ts +0 -14
- package/src/assets/img/icons/mediatype/images.ts +0 -13
- package/src/assets/img/icons/mediatype/radio.ts +0 -15
- package/src/assets/img/icons/mediatype/search.ts +0 -14
- package/src/assets/img/icons/mediatype/software.ts +0 -13
- package/src/assets/img/icons/mediatype/texts.ts +0 -13
- package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
- package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
- package/src/assets/img/icons/mediatype/tv.ts +0 -14
- package/src/assets/img/icons/mediatype/video.ts +0 -14
- package/src/assets/img/icons/mediatype/web.ts +0 -13
- package/src/assets/img/icons/null-result.ts +0 -5
- package/src/assets/img/icons/quote.ts +0 -7
- package/src/assets/img/icons/restricted.ts +0 -13
- package/src/assets/img/icons/reviews.ts +0 -11
- package/src/assets/img/icons/upload.ts +0 -12
- package/src/assets/img/icons/views.ts +0 -11
- package/src/circular-activity-indicator.ts +0 -64
- package/src/collection-browser.ts +0 -3187
- package/src/collection-facets/facet-row.ts +0 -309
- package/src/collection-facets/facet-tombstone-row.ts +0 -40
- package/src/collection-facets/facets-template.ts +0 -85
- package/src/collection-facets/models.ts +0 -10
- package/src/collection-facets/more-facets-content.ts +0 -644
- package/src/collection-facets/more-facets-pagination.ts +0 -294
- package/src/collection-facets/smart-facets/dedupe.ts +0 -44
- package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
- package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
- package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
- package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
- package/src/collection-facets/smart-facets/models.ts +0 -36
- package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
- package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
- package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
- package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
- package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
- package/src/collection-facets/toggle-switch.ts +0 -174
- package/src/collection-facets.ts +0 -1013
- package/src/data-source/collection-browser-data-source-interface.ts +0 -351
- package/src/data-source/collection-browser-data-source.ts +0 -1474
- package/src/data-source/collection-browser-query-state.ts +0 -60
- package/src/data-source/models.ts +0 -56
- package/src/empty-placeholder.ts +0 -192
- package/src/expanded-date-picker.ts +0 -191
- package/src/language-code-handler/language-code-handler.ts +0 -64
- package/src/language-code-handler/language-code-mapping.ts +0 -564
- package/src/manage/manage-bar.ts +0 -276
- package/src/manage/remove-items-modal-content.ts +0 -102
- package/src/mediatype/mediatype-config.ts +0 -146
- package/src/models.ts +0 -895
- package/src/restoration-state-handler.ts +0 -550
- package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
- package/src/sort-filter-bar/alpha-bar.ts +0 -252
- package/src/sort-filter-bar/img/compact.ts +0 -5
- package/src/sort-filter-bar/img/list.ts +0 -5
- package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
- package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
- package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
- package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
- package/src/sort-filter-bar/img/tile.ts +0 -5
- package/src/sort-filter-bar/sort-filter-bar.ts +0 -734
- package/src/styles/ia-button.ts +0 -139
- package/src/styles/item-image-styles.ts +0 -124
- package/src/styles/sr-only.ts +0 -18
- package/src/styles/tile-action-styles.ts +0 -59
- package/src/tiles/base-tile-component.ts +0 -124
- package/src/tiles/collection-browser-loading-tile.ts +0 -26
- package/src/tiles/grid/account-tile.ts +0 -113
- package/src/tiles/grid/collection-tile.ts +0 -184
- package/src/tiles/grid/item-tile.ts +0 -347
- package/src/tiles/grid/search-tile.ts +0 -90
- package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
- package/src/tiles/grid/tile-stats.ts +0 -211
- package/src/tiles/hover/hover-pane-controller.ts +0 -638
- package/src/tiles/hover/tile-hover-pane.ts +0 -184
- package/src/tiles/image-block.ts +0 -162
- package/src/tiles/item-image.ts +0 -214
- package/src/tiles/list/tile-list-compact-header.ts +0 -112
- package/src/tiles/list/tile-list-compact.ts +0 -278
- package/src/tiles/list/tile-list.ts +0 -718
- package/src/tiles/models.ts +0 -21
- package/src/tiles/overlay/icon-overlay.ts +0 -57
- package/src/tiles/overlay/text-overlay.ts +0 -79
- package/src/tiles/review-block.ts +0 -130
- package/src/tiles/text-snippet-block.ts +0 -132
- package/src/tiles/tile-dispatcher.ts +0 -637
- package/src/tiles/tile-display-value-provider.ts +0 -133
- package/src/tiles/tile-mediatype-icon.ts +0 -133
- package/src/utils/analytics-events.ts +0 -29
- package/src/utils/array-equals.ts +0 -8
- package/src/utils/collapse-repeated-quotes.ts +0 -13
- package/src/utils/date-filter-field.ts +0 -11
- package/src/utils/facet-utils.ts +0 -183
- package/src/utils/format-count.ts +0 -95
- package/src/utils/format-date.ts +0 -62
- package/src/utils/format-unit-size.ts +0 -43
- package/src/utils/local-date-from-utc.ts +0 -15
- package/src/utils/log.ts +0 -14
- package/src/utils/resolve-mediatype.ts +0 -26
- package/src/utils/sha1.ts +0 -9
- package/test/collection-browser.test.ts +0 -2694
- package/test/collection-facets/facet-row.test.ts +0 -421
- package/test/collection-facets/facets-template.test.ts +0 -139
- package/test/collection-facets/more-facets-content.test.ts +0 -231
- package/test/collection-facets/more-facets-pagination.test.ts +0 -201
- package/test/collection-facets/toggle-switch.test.ts +0 -164
- package/test/collection-facets.test.ts +0 -928
- package/test/data-source/collection-browser-data-source.test.ts +0 -193
- package/test/empty-placeholder.test.ts +0 -88
- package/test/expanded-date-picker.test.ts +0 -201
- package/test/icon-overlay.test.ts +0 -38
- package/test/image-block.test.ts +0 -247
- package/test/item-image.test.ts +0 -220
- package/test/manage/manage-bar.test.ts +0 -347
- package/test/manage/remove-items-modal-content.test.ts +0 -81
- package/test/mediatype-config.test.ts +0 -11
- package/test/mocks/mock-analytics-handler.ts +0 -30
- package/test/mocks/mock-search-responses.ts +0 -1364
- package/test/mocks/mock-search-service.ts +0 -134
- package/test/restoration-state-handler.test.ts +0 -480
- package/test/review-block.test.ts +0 -62
- package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
- package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
- package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -472
- package/test/text-overlay.test.ts +0 -55
- package/test/text-snippet-block.test.ts +0 -85
- package/test/tile-stats.test.ts +0 -191
- package/test/tiles/grid/account-tile.test.ts +0 -121
- package/test/tiles/grid/collection-tile.test.ts +0 -114
- package/test/tiles/grid/item-tile.test.ts +0 -520
- package/test/tiles/grid/search-tile.test.ts +0 -75
- package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
- package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
- package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
- package/test/tiles/list/tile-list-compact.test.ts +0 -282
- package/test/tiles/list/tile-list.test.ts +0 -576
- package/test/tiles/tile-dispatcher.test.ts +0 -320
- package/test/tiles/tile-display-value-provider.test.ts +0 -172
- package/test/tiles/tile-mediatype-icon.test.ts +0 -160
- package/test/utils/array-equals.test.ts +0 -31
- package/test/utils/format-count.test.ts +0 -32
- package/test/utils/format-date.test.ts +0 -89
- package/test/utils/format-unit-size.test.ts +0 -21
- package/test/utils/local-date-from-utc.test.ts +0 -37
- package/tsconfig.json +0 -25
- package/types/dompurify.d.ts +0 -1
- package/vite.config.ts +0 -29
- package/web-dev-server.config.mjs +0 -30
- package/web-test-runner.config.mjs +0 -52
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import type { TextSnippetBlock } from '../src/tiles/text-snippet-block';
|
|
4
|
-
import '../src/tiles/text-snippet-block';
|
|
5
|
-
|
|
6
|
-
describe('TextSnippetBlock component', () => {
|
|
7
|
-
it('should render initial component', async () => {
|
|
8
|
-
const el = await fixture<TextSnippetBlock>(
|
|
9
|
-
html`<text-snippet-block></text-snippet-block>`,
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
// No content if no snippets
|
|
13
|
-
expect(el.shadowRoot?.children.length).to.equal(0);
|
|
14
|
-
|
|
15
|
-
// Content appears if there are snippets
|
|
16
|
-
el.snippets = ['text'];
|
|
17
|
-
await el.updateComplete;
|
|
18
|
-
const container = el.shadowRoot?.querySelector('.container');
|
|
19
|
-
expect(container).to.exist;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should render marked snippets', async () => {
|
|
23
|
-
const snippets = [
|
|
24
|
-
'some {{{snippet}}} text',
|
|
25
|
-
'some {{{other}}} {{{snippet}}} text',
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const el = await fixture<TextSnippetBlock>(
|
|
29
|
-
html`<text-snippet-block .snippets=${snippets}></text-snippet-block>`,
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const container = el.shadowRoot?.querySelector('.snippet-view');
|
|
33
|
-
|
|
34
|
-
// Has the correct number of snippets and highlights
|
|
35
|
-
expect(container?.children.length).to.equal(snippets.length);
|
|
36
|
-
expect(container?.querySelectorAll('mark').length).to.equal(3);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should render marked snippets containing newlines', async () => {
|
|
40
|
-
const snippets = [
|
|
41
|
-
'some {{{snippet}}} text',
|
|
42
|
-
'some {{{other}}} {{{snippet\n text}}}',
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
const el = await fixture<TextSnippetBlock>(
|
|
46
|
-
html`<text-snippet-block .snippets=${snippets}></text-snippet-block>`,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const container = el.shadowRoot?.querySelector('.snippet-view');
|
|
50
|
-
|
|
51
|
-
// Has the correct number of snippets and highlights
|
|
52
|
-
expect(container?.children.length).to.equal(snippets.length);
|
|
53
|
-
expect(container?.querySelectorAll('mark').length).to.equal(3);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('should render correctly in grid mode', async () => {
|
|
57
|
-
const el = await fixture<TextSnippetBlock>(
|
|
58
|
-
html`<text-snippet-block
|
|
59
|
-
viewsize="grid"
|
|
60
|
-
.snippets=${['text']}
|
|
61
|
-
></text-snippet-block>`,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const container = el.shadowRoot?.querySelector('.snippet-view');
|
|
65
|
-
|
|
66
|
-
// Applies the right container classes
|
|
67
|
-
expect(container?.classList.contains('grid')).to.be.true;
|
|
68
|
-
expect(container?.classList.contains('list')).to.be.false;
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should render correctly in list mode', async () => {
|
|
72
|
-
const el = await fixture<TextSnippetBlock>(
|
|
73
|
-
html`<text-snippet-block
|
|
74
|
-
viewsize="list"
|
|
75
|
-
.snippets=${['text']}
|
|
76
|
-
></text-snippet-block>`,
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const container = el.shadowRoot?.querySelector('.snippet-view');
|
|
80
|
-
|
|
81
|
-
// Applies the right container classes
|
|
82
|
-
expect(container?.classList.contains('list')).to.be.true;
|
|
83
|
-
expect(container?.classList.contains('grid')).to.be.false;
|
|
84
|
-
});
|
|
85
|
-
});
|
package/test/tile-stats.test.ts
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import { html } from 'lit';
|
|
3
|
-
import type { TileStats } from '../src/tiles/grid/tile-stats';
|
|
4
|
-
|
|
5
|
-
import '../src/tiles/grid/tile-stats';
|
|
6
|
-
|
|
7
|
-
describe('Tile Stats', () => {
|
|
8
|
-
it('should render initial component', async () => {
|
|
9
|
-
const el = await fixture<TileStats>(html`<tile-stats></tile-stats>`);
|
|
10
|
-
|
|
11
|
-
const itemStats = el.shadowRoot?.querySelector('.item-stats');
|
|
12
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
13
|
-
const statsRowCount = statsRow?.childElementCount;
|
|
14
|
-
|
|
15
|
-
expect(itemStats).to.exist;
|
|
16
|
-
expect(statsRow).to.exist;
|
|
17
|
-
expect(statsRowCount).to.equal(4);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should render component with values', async () => {
|
|
21
|
-
const el = await fixture<TileStats>(html`
|
|
22
|
-
<tile-stats
|
|
23
|
-
.mediatype=${'account'}
|
|
24
|
-
.itemCount=${1}
|
|
25
|
-
.favCount=${2}
|
|
26
|
-
.commentCount=${3}
|
|
27
|
-
>
|
|
28
|
-
</tile-stats>
|
|
29
|
-
`);
|
|
30
|
-
|
|
31
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
32
|
-
|
|
33
|
-
const mediatypeStat = statsRow?.children.item(0);
|
|
34
|
-
// get second column item in stats row
|
|
35
|
-
const itemStatCount = statsRow?.children
|
|
36
|
-
.item(1)
|
|
37
|
-
?.querySelector('.status-text')
|
|
38
|
-
?.textContent?.trim();
|
|
39
|
-
// get third column item in stats row
|
|
40
|
-
const favoritesStatCount = statsRow?.children
|
|
41
|
-
.item(2)
|
|
42
|
-
?.querySelector('.status-text')
|
|
43
|
-
?.textContent?.trim();
|
|
44
|
-
// get fourth column item in stats row
|
|
45
|
-
const reviewsStatCount = statsRow?.children
|
|
46
|
-
.item(3)
|
|
47
|
-
?.querySelector('.status-text')
|
|
48
|
-
?.textContent?.trim();
|
|
49
|
-
|
|
50
|
-
expect(mediatypeStat).to.exist;
|
|
51
|
-
expect(itemStatCount).to.match(/uploads:\s+1/);
|
|
52
|
-
expect(favoritesStatCount).to.match(/favorites:\s+2/);
|
|
53
|
-
expect(reviewsStatCount).to.match(/reviews:\s+3/);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('should render component with tv clips', async () => {
|
|
57
|
-
const el = await fixture<TileStats>(html`
|
|
58
|
-
<tile-stats
|
|
59
|
-
showTvClips
|
|
60
|
-
.mediatype=${'texts'}
|
|
61
|
-
.viewCount=${1}
|
|
62
|
-
.favCount=${2}
|
|
63
|
-
.commentCount=${3}
|
|
64
|
-
.tvClipCount=${4}
|
|
65
|
-
>
|
|
66
|
-
</tile-stats>
|
|
67
|
-
`);
|
|
68
|
-
|
|
69
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
70
|
-
|
|
71
|
-
const mediatypeStat = statsRow?.children.item(0);
|
|
72
|
-
// get second column item in stats row
|
|
73
|
-
const itemStatCount = statsRow?.children
|
|
74
|
-
.item(1)
|
|
75
|
-
?.querySelector('.status-text')
|
|
76
|
-
?.textContent?.trim();
|
|
77
|
-
// get third column item in stats row
|
|
78
|
-
const favoritesStatCount = statsRow?.children
|
|
79
|
-
.item(2)
|
|
80
|
-
?.querySelector('.status-text')
|
|
81
|
-
?.textContent?.trim();
|
|
82
|
-
// get fourth column item in stats row
|
|
83
|
-
const clipsStatCount = statsRow?.children
|
|
84
|
-
.item(3)
|
|
85
|
-
?.querySelector('.status-text')
|
|
86
|
-
?.textContent?.trim();
|
|
87
|
-
|
|
88
|
-
expect(mediatypeStat).to.exist;
|
|
89
|
-
expect(itemStatCount).to.match(/views:\s+1/);
|
|
90
|
-
expect(favoritesStatCount).to.match(/favorites:\s+2/);
|
|
91
|
-
expect(clipsStatCount).to.match(/clips:\s+4/);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should render view count for non-account items', async () => {
|
|
95
|
-
const el = await fixture<TileStats>(html`
|
|
96
|
-
<tile-stats
|
|
97
|
-
.mediatype=${'texts'}
|
|
98
|
-
.viewCount=${4}
|
|
99
|
-
.favCount=${5}
|
|
100
|
-
.commentCount=${6}
|
|
101
|
-
>
|
|
102
|
-
</tile-stats>
|
|
103
|
-
`);
|
|
104
|
-
|
|
105
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
106
|
-
|
|
107
|
-
const mediatypeStat = statsRow?.children.item(0);
|
|
108
|
-
// get second column item in stats row
|
|
109
|
-
const viewStatCount = statsRow?.children
|
|
110
|
-
.item(1)
|
|
111
|
-
?.querySelector('.status-text')
|
|
112
|
-
?.textContent?.trim();
|
|
113
|
-
// get third column item in stats row
|
|
114
|
-
const favoritesStatCount = statsRow?.children
|
|
115
|
-
.item(2)
|
|
116
|
-
?.querySelector('.status-text')
|
|
117
|
-
?.textContent?.trim();
|
|
118
|
-
// get fourth column item in stats row
|
|
119
|
-
const reviewsStatCount = statsRow?.children
|
|
120
|
-
.item(3)
|
|
121
|
-
?.querySelector('.status-text')
|
|
122
|
-
?.textContent?.trim();
|
|
123
|
-
|
|
124
|
-
expect(mediatypeStat).to.exist;
|
|
125
|
-
expect(viewStatCount).to.match(/views:\s+4/);
|
|
126
|
-
expect(favoritesStatCount).to.match(/favorites:\s+5/);
|
|
127
|
-
expect(reviewsStatCount).to.match(/reviews:\s+6/);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('handles missing counts gracefully', async () => {
|
|
131
|
-
const el = await fixture<TileStats>(html`
|
|
132
|
-
<tile-stats .mediatype=${'texts'} .favCount=${5} .commentCount=${6}>
|
|
133
|
-
</tile-stats>
|
|
134
|
-
`);
|
|
135
|
-
|
|
136
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
137
|
-
|
|
138
|
-
const mediatypeStat = statsRow?.children.item(0);
|
|
139
|
-
// get second column item in stats row
|
|
140
|
-
const viewStatCount = statsRow?.children
|
|
141
|
-
.item(1)
|
|
142
|
-
?.querySelector('.status-text')
|
|
143
|
-
?.textContent?.trim();
|
|
144
|
-
// get third column item in stats row
|
|
145
|
-
const favoritesStatCount = statsRow?.children
|
|
146
|
-
.item(2)
|
|
147
|
-
?.querySelector('.status-text')
|
|
148
|
-
?.textContent?.trim();
|
|
149
|
-
// get fourth column item in stats row
|
|
150
|
-
const reviewsStatCount = statsRow?.children
|
|
151
|
-
.item(3)
|
|
152
|
-
?.querySelector('.status-text')
|
|
153
|
-
?.textContent?.trim();
|
|
154
|
-
|
|
155
|
-
expect(mediatypeStat).to.exist;
|
|
156
|
-
expect(viewStatCount).to.match(/views:\s+0/);
|
|
157
|
-
expect(favoritesStatCount).to.match(/favorites:\s+5/);
|
|
158
|
-
expect(reviewsStatCount).to.match(/reviews:\s+6/);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it('handles missing counts gracefully for accounts', async () => {
|
|
162
|
-
const el = await fixture<TileStats>(html`
|
|
163
|
-
<tile-stats .mediatype=${'account'} .favCount=${5} .commentCount=${6}>
|
|
164
|
-
</tile-stats>
|
|
165
|
-
`);
|
|
166
|
-
|
|
167
|
-
const statsRow = el.shadowRoot?.querySelector('#stats-row');
|
|
168
|
-
|
|
169
|
-
const mediatypeStat = statsRow?.children.item(0);
|
|
170
|
-
// get second column item in stats row
|
|
171
|
-
const itemStatCount = statsRow?.children
|
|
172
|
-
.item(1)
|
|
173
|
-
?.querySelector('.status-text')
|
|
174
|
-
?.textContent?.trim();
|
|
175
|
-
// get third column item in stats row
|
|
176
|
-
const favoritesStatCount = statsRow?.children
|
|
177
|
-
.item(2)
|
|
178
|
-
?.querySelector('.status-text')
|
|
179
|
-
?.textContent?.trim();
|
|
180
|
-
// get fourth column item in stats row
|
|
181
|
-
const reviewsStatCount = statsRow?.children
|
|
182
|
-
.item(3)
|
|
183
|
-
?.querySelector('.status-text')
|
|
184
|
-
?.textContent?.trim();
|
|
185
|
-
|
|
186
|
-
expect(mediatypeStat).to.exist;
|
|
187
|
-
expect(itemStatCount).to.match(/uploads:\s+0/);
|
|
188
|
-
expect(favoritesStatCount).to.match(/favorites:\s+5/);
|
|
189
|
-
expect(reviewsStatCount).to.match(/reviews:\s+6/);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import sinon from 'sinon';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import type { AccountTile } from '../../../src/tiles/grid/account-tile';
|
|
5
|
-
|
|
6
|
-
import '../../../src/tiles/grid/account-tile';
|
|
7
|
-
|
|
8
|
-
describe('Account Tile', () => {
|
|
9
|
-
it('should render initial component', async () => {
|
|
10
|
-
const el = await fixture<AccountTile>(html`<account-tile></account-tile>`);
|
|
11
|
-
|
|
12
|
-
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
13
|
-
const itemImage = el.shadowRoot?.querySelector('image-block');
|
|
14
|
-
const itemArchivist = el.shadowRoot?.querySelector('.archivist-since');
|
|
15
|
-
const tileStats = el.shadowRoot?.querySelector('tile-stats');
|
|
16
|
-
|
|
17
|
-
expect(itemInfo).to.exist;
|
|
18
|
-
expect(itemImage).to.exist;
|
|
19
|
-
expect(itemArchivist).to.exist;
|
|
20
|
-
expect(tileStats).to.exist;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('should render with title element', async () => {
|
|
24
|
-
const el = await fixture<AccountTile>(html`
|
|
25
|
-
<account-tile
|
|
26
|
-
.model=${{
|
|
27
|
-
identifier: '@jack-sparrow',
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
</account-tile>
|
|
31
|
-
`);
|
|
32
|
-
await el.updateComplete;
|
|
33
|
-
|
|
34
|
-
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
35
|
-
const accountTitle = el.shadowRoot?.querySelector('#title');
|
|
36
|
-
|
|
37
|
-
expect(itemInfo).to.exist;
|
|
38
|
-
expect(accountTitle).to.exist;
|
|
39
|
-
expect(accountTitle?.querySelector('.truncated')?.textContent).to.equal(
|
|
40
|
-
'@jack-sparrow',
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('should render with archivist-since date element', async () => {
|
|
45
|
-
const el = await fixture<AccountTile>(html`
|
|
46
|
-
<account-tile
|
|
47
|
-
.model=${{
|
|
48
|
-
dateAdded: new Date('2022-02-02'),
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
</account-tile>
|
|
52
|
-
`);
|
|
53
|
-
await el.updateComplete;
|
|
54
|
-
|
|
55
|
-
const itemArchivist = el.shadowRoot?.querySelector('.archivist-since');
|
|
56
|
-
expect(itemArchivist?.textContent).contains('Archivist since 2022');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should render with tile-stats element', async () => {
|
|
60
|
-
const el = await fixture<AccountTile>(html`
|
|
61
|
-
<account-tile
|
|
62
|
-
.model=${{
|
|
63
|
-
identifier: '@jack-sparrow',
|
|
64
|
-
mediatype: 'account',
|
|
65
|
-
itemCount: 999,
|
|
66
|
-
favCount: 100,
|
|
67
|
-
commentCount: 3,
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
</account-tile>
|
|
71
|
-
`);
|
|
72
|
-
await el.updateComplete;
|
|
73
|
-
|
|
74
|
-
const tileStats = el.shadowRoot?.querySelector('tile-stats');
|
|
75
|
-
const statsElements = tileStats?.shadowRoot?.querySelector('#stats-row');
|
|
76
|
-
|
|
77
|
-
expect(tileStats).to.exist;
|
|
78
|
-
expect(statsElements).to.exist;
|
|
79
|
-
|
|
80
|
-
const downloads = statsElements
|
|
81
|
-
?.querySelectorAll('.col')[1]
|
|
82
|
-
.querySelector('.status-text');
|
|
83
|
-
expect(downloads?.textContent).contains(999);
|
|
84
|
-
|
|
85
|
-
const favorites = statsElements
|
|
86
|
-
?.querySelectorAll('.col')[2]
|
|
87
|
-
.querySelector('.status-text');
|
|
88
|
-
expect(favorites?.textContent).contains(100);
|
|
89
|
-
|
|
90
|
-
const reviewCounts = statsElements
|
|
91
|
-
?.querySelectorAll('.col')[3]
|
|
92
|
-
.querySelector('.status-text');
|
|
93
|
-
expect(reviewCounts?.textContent).contains(3);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should render info button when showInfoButton flag is set', async () => {
|
|
97
|
-
const el = await fixture<AccountTile>(html`
|
|
98
|
-
<account-tile ?showInfoButton=${true}> </account-tile>
|
|
99
|
-
`);
|
|
100
|
-
|
|
101
|
-
const infoButton = el.shadowRoot?.querySelector('.info-button');
|
|
102
|
-
|
|
103
|
-
expect(infoButton).to.exist;
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should dispatch event when info button tapped', async () => {
|
|
107
|
-
const infoButtonSpy = sinon.spy();
|
|
108
|
-
const el = await fixture<AccountTile>(html`
|
|
109
|
-
<account-tile ?showInfoButton=${true} @infoButtonPressed=${infoButtonSpy}>
|
|
110
|
-
</account-tile>
|
|
111
|
-
`);
|
|
112
|
-
|
|
113
|
-
const infoButton = el.shadowRoot?.querySelector(
|
|
114
|
-
'.info-button',
|
|
115
|
-
) as HTMLButtonElement;
|
|
116
|
-
infoButton.click();
|
|
117
|
-
await el.updateComplete;
|
|
118
|
-
|
|
119
|
-
expect(infoButtonSpy.callCount).to.equal(1);
|
|
120
|
-
});
|
|
121
|
-
});
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
2
|
-
import sinon from 'sinon';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import type { CollectionTile } from '../../../src/tiles/grid/collection-tile';
|
|
5
|
-
|
|
6
|
-
import '../../../src/tiles/grid/collection-tile';
|
|
7
|
-
|
|
8
|
-
describe('Collection Tile', () => {
|
|
9
|
-
it('should render initial component', async () => {
|
|
10
|
-
const el = await fixture<CollectionTile>(
|
|
11
|
-
html`<collection-tile></collection-tile>`,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
15
|
-
const itemImage = el.shadowRoot?.querySelector('image-block');
|
|
16
|
-
const itemStats = el.shadowRoot?.querySelector('#item-stats');
|
|
17
|
-
|
|
18
|
-
expect(itemInfo).to.exist;
|
|
19
|
-
expect(itemImage).to.exist;
|
|
20
|
-
expect(itemStats).to.exist;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('should render with title element', async () => {
|
|
24
|
-
const el = await fixture<CollectionTile>(html`
|
|
25
|
-
<collection-tile
|
|
26
|
-
.model=${{
|
|
27
|
-
identifier: 'books',
|
|
28
|
-
title: 'Books',
|
|
29
|
-
itemCount: 121,
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
</collection-tile>
|
|
33
|
-
`);
|
|
34
|
-
await el.updateComplete;
|
|
35
|
-
|
|
36
|
-
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
37
|
-
const itemTitle = el.shadowRoot?.querySelector('#title');
|
|
38
|
-
|
|
39
|
-
expect(itemInfo).to.exist;
|
|
40
|
-
expect(itemTitle).to.exist;
|
|
41
|
-
expect(itemTitle?.querySelector('.truncated')?.textContent).to.equal(
|
|
42
|
-
'Books',
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('should render with image-block element', async () => {
|
|
47
|
-
const el = await fixture<CollectionTile>(html`
|
|
48
|
-
<collection-tile
|
|
49
|
-
.model=${{
|
|
50
|
-
identifier: '@jack-sparrow',
|
|
51
|
-
itemCount: 1233,
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
</collection-tile>
|
|
55
|
-
`);
|
|
56
|
-
await el.updateComplete;
|
|
57
|
-
|
|
58
|
-
const itemImageBlock = el.shadowRoot?.querySelector('image-block');
|
|
59
|
-
expect(itemImageBlock).to.exist;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should render with item stats element', async () => {
|
|
63
|
-
const el = await fixture<CollectionTile>(html`
|
|
64
|
-
<collection-tile
|
|
65
|
-
.model=${{
|
|
66
|
-
identifier: '@jack-sparrow',
|
|
67
|
-
itemCount: 14521,
|
|
68
|
-
collectionSize: 23222543,
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
</collection-tile>
|
|
72
|
-
`);
|
|
73
|
-
await el.updateComplete;
|
|
74
|
-
|
|
75
|
-
const itemStats = el.shadowRoot?.querySelector('#item-stats');
|
|
76
|
-
const itemMediaType = el.shadowRoot?.querySelector('#item-mediatype');
|
|
77
|
-
const itemCount = el.shadowRoot?.querySelector('#item-count');
|
|
78
|
-
const itemSize = el.shadowRoot?.querySelector('#item-size');
|
|
79
|
-
|
|
80
|
-
expect(itemStats).to.exist;
|
|
81
|
-
expect(itemMediaType).to.exist;
|
|
82
|
-
expect(itemCount).to.exist;
|
|
83
|
-
expect(itemSize).to.exist;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should render info button when showInfoButton flag is set', async () => {
|
|
87
|
-
const el = await fixture<CollectionTile>(html`
|
|
88
|
-
<collection-tile ?showInfoButton=${true}> </collection-tile>
|
|
89
|
-
`);
|
|
90
|
-
|
|
91
|
-
const infoButton = el.shadowRoot?.querySelector('.info-button');
|
|
92
|
-
|
|
93
|
-
expect(infoButton).to.exist;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should dispatch event when info button tapped', async () => {
|
|
97
|
-
const infoButtonSpy = sinon.spy();
|
|
98
|
-
const el = await fixture<CollectionTile>(html`
|
|
99
|
-
<collection-tile
|
|
100
|
-
?showInfoButton=${true}
|
|
101
|
-
@infoButtonPressed=${infoButtonSpy}
|
|
102
|
-
>
|
|
103
|
-
</collection-tile>
|
|
104
|
-
`);
|
|
105
|
-
|
|
106
|
-
const infoButton = el.shadowRoot?.querySelector(
|
|
107
|
-
'.info-button',
|
|
108
|
-
) as HTMLButtonElement;
|
|
109
|
-
infoButton.click();
|
|
110
|
-
await el.updateComplete;
|
|
111
|
-
|
|
112
|
-
expect(infoButtonSpy.callCount).to.equal(1);
|
|
113
|
-
});
|
|
114
|
-
});
|