@internetarchive/collection-browser 1.12.0 → 1.13.0-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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +26 -26
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +54 -54
- package/dist/src/app-root.js +293 -293
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/contract.d.ts +2 -2
- package/dist/src/assets/img/icons/contract.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/expand.d.ts +2 -2
- package/dist/src/assets/img/icons/expand.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/collection-browser.d.ts +472 -472
- package/dist/src/collection-browser.js +1693 -1686
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facets-template.d.ts +20 -20
- package/dist/src/collection-facets/facets-template.js +152 -152
- package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
- package/dist/src/collection-facets/more-facets-content.js +359 -359
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +196 -196
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
- package/dist/src/collection-facets/toggle-switch.js +94 -94
- package/dist/src/collection-facets.d.ts +103 -103
- package/dist/src/collection-facets.js +497 -497
- package/dist/src/empty-placeholder.d.ts +23 -21
- package/dist/src/empty-placeholder.js +83 -69
- package/dist/src/empty-placeholder.js.map +1 -1
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +85 -85
- package/dist/src/models.d.ts +163 -163
- package/dist/src/models.js +269 -269
- package/dist/src/restoration-state-handler.d.ts +70 -70
- package/dist/src/restoration-state-handler.js +355 -355
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +128 -128
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +208 -208
- package/dist/src/sort-filter-bar/sort-filter-bar.js +637 -637
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +9 -9
- package/dist/src/styles/sr-only.d.ts +1 -1
- package/dist/src/styles/sr-only.js +2 -2
- package/dist/src/tiles/base-tile-component.d.ts +18 -18
- package/dist/src/tiles/base-tile-component.js +59 -59
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
- package/dist/src/tiles/grid/collection-tile.js +80 -80
- package/dist/src/tiles/grid/item-tile.d.ts +27 -27
- package/dist/src/tiles/grid/item-tile.js +134 -134
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
- package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
- package/dist/src/tiles/grid/tile-stats.js +48 -48
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
- package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +15 -15
- package/dist/src/tiles/hover/tile-hover-pane.js +38 -38
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +72 -72
- package/dist/src/tiles/item-image.d.ts +35 -35
- package/dist/src/tiles/item-image.js +117 -117
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
- package/dist/src/tiles/list/tile-list-compact.d.ts +15 -15
- package/dist/src/tiles/list/tile-list-compact.js +114 -114
- package/dist/src/tiles/list/tile-list.d.ts +46 -46
- package/dist/src/tiles/list/tile-list.js +298 -298
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/icon-overlay.js +40 -40
- package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
- package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/text-overlay.js +42 -42
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/tile-dispatcher.d.ts +50 -50
- package/dist/src/tiles/tile-dispatcher.js +185 -185
- package/dist/src/tiles/tile-display-value-provider.d.ts +43 -43
- package/dist/src/tiles/tile-display-value-provider.js +80 -80
- package/dist/src/utils/analytics-events.d.ts +25 -25
- package/dist/src/utils/analytics-events.js +27 -27
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +25 -25
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/src/utils/local-date-from-utc.d.ts +9 -9
- package/dist/src/utils/local-date-from-utc.js +15 -15
- package/dist/src/utils/sha1.d.ts +2 -2
- package/dist/src/utils/sha1.js +8 -8
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +981 -967
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +134 -134
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +133 -133
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +73 -73
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +682 -682
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +63 -56
- package/dist/test/empty-placeholder.test.js.map +1 -1
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +95 -95
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +84 -84
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-collection-name-cache.d.ts +9 -9
- package/dist/test/mocks/mock-collection-name-cache.js +17 -17
- package/dist/test/mocks/mock-search-responses.d.ts +21 -21
- package/dist/test/mocks/mock-search-responses.js +707 -707
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +50 -50
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -270
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +378 -378
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +48 -48
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +33 -33
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +76 -76
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +73 -73
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +254 -254
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +257 -257
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +13 -13
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +143 -143
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +242 -242
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +67 -67
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
- package/dist/test/utils/array-equals.test.d.ts +1 -1
- package/dist/test/utils/array-equals.test.js +26 -26
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- package/dist/test/utils/format-unit-size.test.d.ts +1 -1
- package/dist/test/utils/format-unit-size.test.js +17 -17
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
- package/dist/test/utils/local-date-from-utc.test.js +26 -26
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +1 -1
- package/renovate.json +6 -6
- package/src/collection-browser.ts +7 -1
- package/src/empty-placeholder.ts +17 -0
- package/test/collection-browser.test.ts +23 -0
- package/test/empty-placeholder.test.ts +26 -19
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import '../src/tiles/item-image';
|
|
5
|
-
const baseImageUrl = 'https://archive.org';
|
|
6
|
-
const testBookModel = {
|
|
7
|
-
collections: [],
|
|
8
|
-
commentCount: 0,
|
|
9
|
-
creators: [],
|
|
10
|
-
favCount: 0,
|
|
11
|
-
identifier: '18730130BloomfieldRecordCompleteIssue',
|
|
12
|
-
itemCount: 0,
|
|
13
|
-
mediatype: 'texts',
|
|
14
|
-
subjects: [],
|
|
15
|
-
title: 'Sample Waveform',
|
|
16
|
-
viewCount: 0,
|
|
17
|
-
loginRequired: false,
|
|
18
|
-
contentWarning: false,
|
|
19
|
-
collectionFilesCount: 0,
|
|
20
|
-
collectionSize: 0,
|
|
21
|
-
};
|
|
22
|
-
const testAudioModel = {
|
|
23
|
-
collections: [],
|
|
24
|
-
commentCount: 0,
|
|
25
|
-
creators: [],
|
|
26
|
-
favCount: 0,
|
|
27
|
-
identifier: 'dwd2015-01-24',
|
|
28
|
-
itemCount: 0,
|
|
29
|
-
mediatype: 'audio',
|
|
30
|
-
subjects: [],
|
|
31
|
-
title: 'Sample Waveform',
|
|
32
|
-
viewCount: 0,
|
|
33
|
-
loginRequired: false,
|
|
34
|
-
contentWarning: false,
|
|
35
|
-
collectionFilesCount: 0,
|
|
36
|
-
collectionSize: 0,
|
|
37
|
-
};
|
|
38
|
-
describe('ItemImage component', () => {
|
|
39
|
-
it('should render initial component', async () => {
|
|
40
|
-
var _a, _b;
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import '../src/tiles/item-image';
|
|
5
|
+
const baseImageUrl = 'https://archive.org';
|
|
6
|
+
const testBookModel = {
|
|
7
|
+
collections: [],
|
|
8
|
+
commentCount: 0,
|
|
9
|
+
creators: [],
|
|
10
|
+
favCount: 0,
|
|
11
|
+
identifier: '18730130BloomfieldRecordCompleteIssue',
|
|
12
|
+
itemCount: 0,
|
|
13
|
+
mediatype: 'texts',
|
|
14
|
+
subjects: [],
|
|
15
|
+
title: 'Sample Waveform',
|
|
16
|
+
viewCount: 0,
|
|
17
|
+
loginRequired: false,
|
|
18
|
+
contentWarning: false,
|
|
19
|
+
collectionFilesCount: 0,
|
|
20
|
+
collectionSize: 0,
|
|
21
|
+
};
|
|
22
|
+
const testAudioModel = {
|
|
23
|
+
collections: [],
|
|
24
|
+
commentCount: 0,
|
|
25
|
+
creators: [],
|
|
26
|
+
favCount: 0,
|
|
27
|
+
identifier: 'dwd2015-01-24',
|
|
28
|
+
itemCount: 0,
|
|
29
|
+
mediatype: 'audio',
|
|
30
|
+
subjects: [],
|
|
31
|
+
title: 'Sample Waveform',
|
|
32
|
+
viewCount: 0,
|
|
33
|
+
loginRequired: false,
|
|
34
|
+
contentWarning: false,
|
|
35
|
+
collectionFilesCount: 0,
|
|
36
|
+
collectionSize: 0,
|
|
37
|
+
};
|
|
38
|
+
describe('ItemImage component', () => {
|
|
39
|
+
it('should render initial component', async () => {
|
|
40
|
+
var _a, _b;
|
|
41
41
|
const el = await fixture(html `
|
|
42
42
|
<item-image
|
|
43
43
|
.isListTile=${false}
|
|
@@ -46,14 +46,14 @@ describe('ItemImage component', () => {
|
|
|
46
46
|
.baseImageUrl=${baseImageUrl}
|
|
47
47
|
>
|
|
48
48
|
</item-image>
|
|
49
|
-
`);
|
|
50
|
-
const dropShadow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.drop-shadow');
|
|
51
|
-
const imgClassName = (_b = dropShadow === null || dropShadow === void 0 ? void 0 : dropShadow.querySelector('img')) === null || _b === void 0 ? void 0 : _b.className;
|
|
52
|
-
expect(dropShadow).to.exist;
|
|
53
|
-
expect(imgClassName).to.eql(' contain ');
|
|
54
|
-
});
|
|
55
|
-
it('should render component if mediatype is waveform', async () => {
|
|
56
|
-
var _a;
|
|
49
|
+
`);
|
|
50
|
+
const dropShadow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.drop-shadow');
|
|
51
|
+
const imgClassName = (_b = dropShadow === null || dropShadow === void 0 ? void 0 : dropShadow.querySelector('img')) === null || _b === void 0 ? void 0 : _b.className;
|
|
52
|
+
expect(dropShadow).to.exist;
|
|
53
|
+
expect(imgClassName).to.eql(' contain ');
|
|
54
|
+
});
|
|
55
|
+
it('should render component if mediatype is waveform', async () => {
|
|
56
|
+
var _a;
|
|
57
57
|
const el = await fixture(html `
|
|
58
58
|
<item-image
|
|
59
59
|
.isListTile=${false}
|
|
@@ -62,19 +62,19 @@ describe('ItemImage component', () => {
|
|
|
62
62
|
.baseImageUrl=${baseImageUrl}
|
|
63
63
|
>
|
|
64
64
|
</item-image>
|
|
65
|
-
`);
|
|
66
|
-
const dropShadow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.drop-shadow');
|
|
67
|
-
const image = dropShadow === null || dropShadow === void 0 ? void 0 : dropShadow.querySelector('img');
|
|
68
|
-
expect(dropShadow).to.exist;
|
|
69
|
-
expect(image).to.exist;
|
|
70
|
-
// simulate image onLoad event check if image className is waveform
|
|
71
|
-
setTimeout(() => {
|
|
72
|
-
const imgClassName = image === null || image === void 0 ? void 0 : image.className;
|
|
73
|
-
expect(imgClassName).to.eql(' waveform ');
|
|
74
|
-
}, 1000);
|
|
75
|
-
});
|
|
76
|
-
it('should not fetch image with undefined base url', async () => {
|
|
77
|
-
var _a;
|
|
65
|
+
`);
|
|
66
|
+
const dropShadow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.drop-shadow');
|
|
67
|
+
const image = dropShadow === null || dropShadow === void 0 ? void 0 : dropShadow.querySelector('img');
|
|
68
|
+
expect(dropShadow).to.exist;
|
|
69
|
+
expect(image).to.exist;
|
|
70
|
+
// simulate image onLoad event check if image className is waveform
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
const imgClassName = image === null || image === void 0 ? void 0 : image.className;
|
|
73
|
+
expect(imgClassName).to.eql(' waveform ');
|
|
74
|
+
}, 1000);
|
|
75
|
+
});
|
|
76
|
+
it('should not fetch image with undefined base url', async () => {
|
|
77
|
+
var _a;
|
|
78
78
|
const el = await fixture(html `
|
|
79
79
|
<item-image
|
|
80
80
|
.isListTile=${false}
|
|
@@ -82,14 +82,14 @@ describe('ItemImage component', () => {
|
|
|
82
82
|
.model=${testBookModel}
|
|
83
83
|
>
|
|
84
84
|
</item-image>
|
|
85
|
-
`);
|
|
86
|
-
// Doesn't set the image src if base url is undefined
|
|
87
|
-
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
88
|
-
expect(img).to.exist;
|
|
89
|
-
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
90
|
-
});
|
|
91
|
-
it('should not fetch image with undefined model', async () => {
|
|
92
|
-
var _a;
|
|
85
|
+
`);
|
|
86
|
+
// Doesn't set the image src if base url is undefined
|
|
87
|
+
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
88
|
+
expect(img).to.exist;
|
|
89
|
+
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
90
|
+
});
|
|
91
|
+
it('should not fetch image with undefined model', async () => {
|
|
92
|
+
var _a;
|
|
93
93
|
const el = await fixture(html `
|
|
94
94
|
<item-image
|
|
95
95
|
.isListTile=${false}
|
|
@@ -97,14 +97,14 @@ describe('ItemImage component', () => {
|
|
|
97
97
|
.baseImageUrl=${baseImageUrl}
|
|
98
98
|
>
|
|
99
99
|
</item-image>
|
|
100
|
-
`);
|
|
101
|
-
// Doesn't set the image src if model is not present
|
|
102
|
-
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
103
|
-
expect(img).to.exist;
|
|
104
|
-
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
105
|
-
});
|
|
106
|
-
it('should not fetch image with undefined identifier', async () => {
|
|
107
|
-
var _a;
|
|
100
|
+
`);
|
|
101
|
+
// Doesn't set the image src if model is not present
|
|
102
|
+
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
103
|
+
expect(img).to.exist;
|
|
104
|
+
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
105
|
+
});
|
|
106
|
+
it('should not fetch image with undefined identifier', async () => {
|
|
107
|
+
var _a;
|
|
108
108
|
const el = await fixture(html `
|
|
109
109
|
<item-image
|
|
110
110
|
.isListTile=${false}
|
|
@@ -113,11 +113,11 @@ describe('ItemImage component', () => {
|
|
|
113
113
|
.baseImageUrl=${baseImageUrl}
|
|
114
114
|
>
|
|
115
115
|
</item-image>
|
|
116
|
-
`);
|
|
117
|
-
// Doesn't set the image src if identifier is not present
|
|
118
|
-
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
119
|
-
expect(img).to.exist;
|
|
120
|
-
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
121
|
-
});
|
|
122
|
-
});
|
|
116
|
+
`);
|
|
117
|
+
// Doesn't set the image src if identifier is not present
|
|
118
|
+
const img = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img');
|
|
119
|
+
expect(img).to.exist;
|
|
120
|
+
expect(img === null || img === void 0 ? void 0 : img.getAttribute('src')).not.to.exist;
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
123
|
//# sourceMappingURL=item-image.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { expect } from '@open-wc/testing';
|
|
2
|
-
import { mediatypeConfig } from '../src/mediatype/mediatype-config';
|
|
3
|
-
describe('mediatypeConfig', () => {
|
|
4
|
-
it('returns undefined', () => {
|
|
5
|
-
expect(mediatypeConfig['']).to.equal(undefined);
|
|
6
|
-
expect(mediatypeConfig.test).to.equal(undefined);
|
|
7
|
-
expect(mediatypeConfig.media).to.equal(undefined);
|
|
8
|
-
expect(mediatypeConfig.testing).to.equal(undefined);
|
|
9
|
-
});
|
|
10
|
-
it('returns audio', () => {
|
|
11
|
-
expect(mediatypeConfig.audio).to.exist;
|
|
12
|
-
expect(mediatypeConfig.audio.color).to.exist;
|
|
13
|
-
expect(mediatypeConfig.audio.icon).to.exist;
|
|
14
|
-
expect(mediatypeConfig.audio.text).to.exist;
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import { mediatypeConfig } from '../src/mediatype/mediatype-config';
|
|
3
|
+
describe('mediatypeConfig', () => {
|
|
4
|
+
it('returns undefined', () => {
|
|
5
|
+
expect(mediatypeConfig['']).to.equal(undefined);
|
|
6
|
+
expect(mediatypeConfig.test).to.equal(undefined);
|
|
7
|
+
expect(mediatypeConfig.media).to.equal(undefined);
|
|
8
|
+
expect(mediatypeConfig.testing).to.equal(undefined);
|
|
9
|
+
});
|
|
10
|
+
it('returns audio', () => {
|
|
11
|
+
expect(mediatypeConfig.audio).to.exist;
|
|
12
|
+
expect(mediatypeConfig.audio.color).to.exist;
|
|
13
|
+
expect(mediatypeConfig.audio.icon).to.exist;
|
|
14
|
+
expect(mediatypeConfig.audio.text).to.exist;
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
17
|
//# sourceMappingURL=mediatype-config.test.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AnalyticsEvent, AnalyticsManagerInterface } from '@internetarchive/analytics-manager';
|
|
2
|
-
export declare class MockAnalyticsHandler implements AnalyticsManagerInterface {
|
|
3
|
-
callCategory?: string;
|
|
4
|
-
callAction?: string;
|
|
5
|
-
callLabel?: string;
|
|
6
|
-
callEventConfiguration?: object;
|
|
7
|
-
sendPing(): void;
|
|
8
|
-
sendEvent(options: AnalyticsEvent): void;
|
|
9
|
-
sendEventNoSampling(options: AnalyticsEvent): void;
|
|
10
|
-
}
|
|
1
|
+
import type { AnalyticsEvent, AnalyticsManagerInterface } from '@internetarchive/analytics-manager';
|
|
2
|
+
export declare class MockAnalyticsHandler implements AnalyticsManagerInterface {
|
|
3
|
+
callCategory?: string;
|
|
4
|
+
callAction?: string;
|
|
5
|
+
callLabel?: string;
|
|
6
|
+
callEventConfiguration?: object;
|
|
7
|
+
sendPing(): void;
|
|
8
|
+
sendEvent(options: AnalyticsEvent): void;
|
|
9
|
+
sendEventNoSampling(options: AnalyticsEvent): void;
|
|
10
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export class MockAnalyticsHandler {
|
|
2
|
-
sendPing() { }
|
|
3
|
-
sendEvent(options) {
|
|
4
|
-
this.callCategory = options.category;
|
|
5
|
-
this.callAction = options.action;
|
|
6
|
-
this.callLabel = options.label;
|
|
7
|
-
this.callEventConfiguration = options.eventConfiguration;
|
|
8
|
-
}
|
|
9
|
-
sendEventNoSampling(options) {
|
|
10
|
-
this.callCategory = options.category;
|
|
11
|
-
this.callAction = options.action;
|
|
12
|
-
this.callLabel = options.label;
|
|
13
|
-
this.callEventConfiguration = options.eventConfiguration;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
export class MockAnalyticsHandler {
|
|
2
|
+
sendPing() { }
|
|
3
|
+
sendEvent(options) {
|
|
4
|
+
this.callCategory = options.category;
|
|
5
|
+
this.callAction = options.action;
|
|
6
|
+
this.callLabel = options.label;
|
|
7
|
+
this.callEventConfiguration = options.eventConfiguration;
|
|
8
|
+
}
|
|
9
|
+
sendEventNoSampling(options) {
|
|
10
|
+
this.callCategory = options.category;
|
|
11
|
+
this.callAction = options.action;
|
|
12
|
+
this.callLabel = options.label;
|
|
13
|
+
this.callEventConfiguration = options.eventConfiguration;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=mock-analytics-handler.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
2
|
-
export declare class MockCollectionNameCache implements CollectionNameCacheInterface {
|
|
3
|
-
collectionNamesRequested: string[];
|
|
4
|
-
preloadIdentifiersRequested: string[];
|
|
5
|
-
knownTitlesAdded: Record<string, string>;
|
|
6
|
-
collectionNameFor(identifier: string): Promise<string | null>;
|
|
7
|
-
preloadIdentifiers(identifiers: string[]): Promise<void>;
|
|
8
|
-
addKnownTitles(identifierTitleMap: Record<string, string>): Promise<void>;
|
|
9
|
-
}
|
|
1
|
+
import type { CollectionNameCacheInterface } from '@internetarchive/collection-name-cache';
|
|
2
|
+
export declare class MockCollectionNameCache implements CollectionNameCacheInterface {
|
|
3
|
+
collectionNamesRequested: string[];
|
|
4
|
+
preloadIdentifiersRequested: string[];
|
|
5
|
+
knownTitlesAdded: Record<string, string>;
|
|
6
|
+
collectionNameFor(identifier: string): Promise<string | null>;
|
|
7
|
+
preloadIdentifiers(identifiers: string[]): Promise<void>;
|
|
8
|
+
addKnownTitles(identifierTitleMap: Record<string, string>): Promise<void>;
|
|
9
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export class MockCollectionNameCache {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.collectionNamesRequested = [];
|
|
4
|
-
this.preloadIdentifiersRequested = [];
|
|
5
|
-
this.knownTitlesAdded = {};
|
|
6
|
-
}
|
|
7
|
-
async collectionNameFor(identifier) {
|
|
8
|
-
this.collectionNamesRequested.push(identifier);
|
|
9
|
-
return `${identifier}-name`;
|
|
10
|
-
}
|
|
11
|
-
async preloadIdentifiers(identifiers) {
|
|
12
|
-
this.preloadIdentifiersRequested = identifiers;
|
|
13
|
-
}
|
|
14
|
-
async addKnownTitles(identifierTitleMap) {
|
|
15
|
-
this.knownTitlesAdded = identifierTitleMap;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
export class MockCollectionNameCache {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.collectionNamesRequested = [];
|
|
4
|
+
this.preloadIdentifiersRequested = [];
|
|
5
|
+
this.knownTitlesAdded = {};
|
|
6
|
+
}
|
|
7
|
+
async collectionNameFor(identifier) {
|
|
8
|
+
this.collectionNamesRequested.push(identifier);
|
|
9
|
+
return `${identifier}-name`;
|
|
10
|
+
}
|
|
11
|
+
async preloadIdentifiers(identifiers) {
|
|
12
|
+
this.preloadIdentifiersRequested = identifiers;
|
|
13
|
+
}
|
|
14
|
+
async addKnownTitles(identifierTitleMap) {
|
|
15
|
+
this.knownTitlesAdded = identifierTitleMap;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=mock-collection-name-cache.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { Result } from '@internetarchive/result-type';
|
|
2
|
-
import { SearchResponse, SearchServiceError } from '@internetarchive/search-service';
|
|
3
|
-
export declare const getMockSuccessSingleResult: () => Result<SearchResponse, SearchServiceError>;
|
|
4
|
-
export declare const getMockSuccessWithYearHistogramAggs: () => Result<SearchResponse, SearchServiceError>;
|
|
5
|
-
export declare const getMockSuccessLoggedInResult: () => Result<SearchResponse, SearchServiceError>;
|
|
6
|
-
export declare const getMockSuccessNoPreviewResult: () => Result<SearchResponse, SearchServiceError>;
|
|
7
|
-
export declare const getMockSuccessLoggedInAndNoPreviewResult: () => Result<SearchResponse, SearchServiceError>;
|
|
8
|
-
export declare const getMockSuccessFirstTitleResult: () => Result<SearchResponse, SearchServiceError>;
|
|
9
|
-
export declare const getMockSuccessFirstCreatorResult: () => Result<SearchResponse, SearchServiceError>;
|
|
10
|
-
export declare const getMockSuccessWithCollectionTitles: () => Result<SearchResponse, SearchServiceError>;
|
|
11
|
-
export declare const getMockSuccessWithCollectionAggregations: () => Result<SearchResponse, SearchServiceError>;
|
|
12
|
-
export declare const getMockSuccessSingleResultWithSort: (resultsSpy: Function) => Result<SearchResponse, SearchServiceError>;
|
|
13
|
-
export declare const getMockSuccessMultipleResults: () => Result<SearchResponse, SearchServiceError>;
|
|
14
|
-
export declare const getMockSuccessMultiLineDescription: () => Result<SearchResponse, SearchServiceError>;
|
|
15
|
-
export declare const getMockSuccessExtraQuotedHref: () => Result<SearchResponse, SearchServiceError>;
|
|
16
|
-
export declare const getMockSuccessWithDefaultSort: () => Result<SearchResponse, SearchServiceError>;
|
|
17
|
-
export declare const getMockSuccessWithConciseDefaultSort: () => Result<SearchResponse, SearchServiceError>;
|
|
18
|
-
export declare const getMockSuccessWithDefaultFavSort: () => Result<SearchResponse, SearchServiceError>;
|
|
19
|
-
export declare const getMockSuccessWithParentCollections: () => Result<SearchResponse, SearchServiceError>;
|
|
20
|
-
export declare const getMockErrorResult: () => Result<SearchResponse, SearchServiceError>;
|
|
21
|
-
export declare const getMockMalformedResult: () => Result<SearchResponse, SearchServiceError>;
|
|
1
|
+
import type { Result } from '@internetarchive/result-type';
|
|
2
|
+
import { SearchResponse, SearchServiceError } from '@internetarchive/search-service';
|
|
3
|
+
export declare const getMockSuccessSingleResult: () => Result<SearchResponse, SearchServiceError>;
|
|
4
|
+
export declare const getMockSuccessWithYearHistogramAggs: () => Result<SearchResponse, SearchServiceError>;
|
|
5
|
+
export declare const getMockSuccessLoggedInResult: () => Result<SearchResponse, SearchServiceError>;
|
|
6
|
+
export declare const getMockSuccessNoPreviewResult: () => Result<SearchResponse, SearchServiceError>;
|
|
7
|
+
export declare const getMockSuccessLoggedInAndNoPreviewResult: () => Result<SearchResponse, SearchServiceError>;
|
|
8
|
+
export declare const getMockSuccessFirstTitleResult: () => Result<SearchResponse, SearchServiceError>;
|
|
9
|
+
export declare const getMockSuccessFirstCreatorResult: () => Result<SearchResponse, SearchServiceError>;
|
|
10
|
+
export declare const getMockSuccessWithCollectionTitles: () => Result<SearchResponse, SearchServiceError>;
|
|
11
|
+
export declare const getMockSuccessWithCollectionAggregations: () => Result<SearchResponse, SearchServiceError>;
|
|
12
|
+
export declare const getMockSuccessSingleResultWithSort: (resultsSpy: Function) => Result<SearchResponse, SearchServiceError>;
|
|
13
|
+
export declare const getMockSuccessMultipleResults: () => Result<SearchResponse, SearchServiceError>;
|
|
14
|
+
export declare const getMockSuccessMultiLineDescription: () => Result<SearchResponse, SearchServiceError>;
|
|
15
|
+
export declare const getMockSuccessExtraQuotedHref: () => Result<SearchResponse, SearchServiceError>;
|
|
16
|
+
export declare const getMockSuccessWithDefaultSort: () => Result<SearchResponse, SearchServiceError>;
|
|
17
|
+
export declare const getMockSuccessWithConciseDefaultSort: () => Result<SearchResponse, SearchServiceError>;
|
|
18
|
+
export declare const getMockSuccessWithDefaultFavSort: () => Result<SearchResponse, SearchServiceError>;
|
|
19
|
+
export declare const getMockSuccessWithParentCollections: () => Result<SearchResponse, SearchServiceError>;
|
|
20
|
+
export declare const getMockErrorResult: () => Result<SearchResponse, SearchServiceError>;
|
|
21
|
+
export declare const getMockMalformedResult: () => Result<SearchResponse, SearchServiceError>;
|