@internetarchive/collection-browser 1.14.12 → 1.14.13
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/.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 +83 -83
- package/dist/src/app-root.js +412 -412
- 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/search.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/search.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 +534 -534
- package/dist/src/collection-browser.js +1897 -1897
- package/dist/src/collection-facets/facet-row.d.ts +30 -30
- package/dist/src/collection-facets/facet-row.js +115 -115
- 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 +17 -17
- package/dist/src/collection-facets/facets-template.js +114 -114
- 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 +104 -104
- package/dist/src/collection-facets.js +506 -506
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +74 -74
- 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/manage/manage-bar.d.ts +26 -26
- package/dist/src/manage/manage-bar.js +53 -53
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +91 -91
- package/dist/src/models.d.ts +180 -180
- 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/selected-facets.d.ts +67 -0
- package/dist/src/selected-facets.js +149 -0
- package/dist/src/selected-facets.js.map +1 -0
- 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 +210 -210
- package/dist/src/sort-filter-bar/sort-filter-bar.js +644 -644
- 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 +19 -19
- package/dist/src/tiles/base-tile-component.js +63 -63
- 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/search-tile.d.ts +10 -10
- package/dist/src/tiles/grid/search-tile.js +51 -51
- 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 +73 -73
- package/dist/src/tiles/item-image.d.ts +36 -36
- package/dist/src/tiles/item-image.js +127 -127
- 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 +302 -302
- 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 +64 -64
- package/dist/src/tiles/tile-dispatcher.js +231 -231
- 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 +1137 -1137
- package/dist/test/collection-facets/facet-row.test.d.ts +1 -1
- package/dist/test/collection-facets/facet-row.test.js +206 -206
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +105 -105
- 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 +651 -651
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +63 -63
- 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 +86 -86
- package/dist/test/manage/manage-bar.test.d.ts +1 -1
- package/dist/test/manage/manage-bar.test.js +72 -72
- 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 +709 -709
- 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 +386 -386
- 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/grid/search-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/search-tile.test.js +51 -51
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +258 -258
- 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 +94 -94
- 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 +4 -4
- package/renovate.json +6 -6
- package/src/selected-facets.ts +216 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
/* eslint-disable import/no-duplicates */
|
|
2
|
-
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
-
import { html } from 'lit';
|
|
4
|
-
import '../../../src/tiles/list/tile-list';
|
|
5
|
-
import { MockCollectionNameCache } from '../../mocks/mock-collection-name-cache';
|
|
6
|
-
describe('List Tile', () => {
|
|
7
|
-
it('should render initial component', async () => {
|
|
8
|
-
var _a, _b, _c;
|
|
9
|
-
const el = await fixture(html `<tile-list .model=${{}}></tile-list>`);
|
|
10
|
-
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#list-line');
|
|
11
|
-
const itemTitle = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#title');
|
|
12
|
-
const imageBlock = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('image-block');
|
|
13
|
-
expect(listContainer).to.exist;
|
|
14
|
-
expect(itemTitle).to.exist;
|
|
15
|
-
expect(imageBlock).to.exist;
|
|
16
|
-
});
|
|
17
|
-
it('should render the mobile template if below mobile breakpoint', async () => {
|
|
18
|
-
var _a, _b, _c;
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import '../../../src/tiles/list/tile-list';
|
|
5
|
+
import { MockCollectionNameCache } from '../../mocks/mock-collection-name-cache';
|
|
6
|
+
describe('List Tile', () => {
|
|
7
|
+
it('should render initial component', async () => {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
const el = await fixture(html `<tile-list .model=${{}}></tile-list>`);
|
|
10
|
+
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#list-line');
|
|
11
|
+
const itemTitle = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#title');
|
|
12
|
+
const imageBlock = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('image-block');
|
|
13
|
+
expect(listContainer).to.exist;
|
|
14
|
+
expect(itemTitle).to.exist;
|
|
15
|
+
expect(imageBlock).to.exist;
|
|
16
|
+
});
|
|
17
|
+
it('should render the mobile template if below mobile breakpoint', async () => {
|
|
18
|
+
var _a, _b, _c;
|
|
19
19
|
const el = await fixture(html `
|
|
20
20
|
<tile-list .mobileBreakpoint=${500} .currentWidth=${400}> </tile-list>
|
|
21
|
-
`);
|
|
22
|
-
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('list-line');
|
|
23
|
-
const topLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('list-line-top');
|
|
24
|
-
const bottomLine = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('list-line-bottom');
|
|
25
|
-
expect(listContainer).to.exist;
|
|
26
|
-
expect(listContainer === null || listContainer === void 0 ? void 0 : listContainer.classList.contains('mobile')).to.be.true;
|
|
27
|
-
expect(topLine).to.exist;
|
|
28
|
-
expect(bottomLine).to.exist;
|
|
29
|
-
});
|
|
30
|
-
it('should render title link with model href if provided', async () => {
|
|
31
|
-
var _a;
|
|
21
|
+
`);
|
|
22
|
+
const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('list-line');
|
|
23
|
+
const topLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('list-line-top');
|
|
24
|
+
const bottomLine = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('list-line-bottom');
|
|
25
|
+
expect(listContainer).to.exist;
|
|
26
|
+
expect(listContainer === null || listContainer === void 0 ? void 0 : listContainer.classList.contains('mobile')).to.be.true;
|
|
27
|
+
expect(topLine).to.exist;
|
|
28
|
+
expect(bottomLine).to.exist;
|
|
29
|
+
});
|
|
30
|
+
it('should render title link with model href if provided', async () => {
|
|
31
|
+
var _a;
|
|
32
32
|
const el = await fixture(html `
|
|
33
33
|
<tile-list
|
|
34
34
|
.baseNavigationUrl=${''}
|
|
35
35
|
.model=${{ title: 'foo', href: '/foo/bar' }}
|
|
36
36
|
></tile-list>
|
|
37
|
-
`);
|
|
38
|
-
const title = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#title > a');
|
|
39
|
-
expect(title).to.exist;
|
|
40
|
-
expect(title === null || title === void 0 ? void 0 : title.getAttribute('href')).to.equal('/foo/bar');
|
|
41
|
-
});
|
|
42
|
-
it('should render with creator element but not dates', async () => {
|
|
43
|
-
var _a, _b;
|
|
37
|
+
`);
|
|
38
|
+
const title = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#title > a');
|
|
39
|
+
expect(title).to.exist;
|
|
40
|
+
expect(title === null || title === void 0 ? void 0 : title.getAttribute('href')).to.equal('/foo/bar');
|
|
41
|
+
});
|
|
42
|
+
it('should render with creator element but not dates', async () => {
|
|
43
|
+
var _a, _b;
|
|
44
44
|
const el = await fixture(html `
|
|
45
45
|
<tile-list .model=${{ creators: ['someone'] }}></tile-list>
|
|
46
|
-
`);
|
|
47
|
-
const creator = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#creator');
|
|
48
|
-
const datesLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#dates-line');
|
|
49
|
-
expect(creator).to.exist;
|
|
50
|
-
expect(datesLine === null || datesLine === void 0 ? void 0 : datesLine.children.length).to.equal(0);
|
|
51
|
-
});
|
|
52
|
-
it('should render with snippet block when it has snippets', async () => {
|
|
53
|
-
var _a;
|
|
46
|
+
`);
|
|
47
|
+
const creator = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#creator');
|
|
48
|
+
const datesLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#dates-line');
|
|
49
|
+
expect(creator).to.exist;
|
|
50
|
+
expect(datesLine === null || datesLine === void 0 ? void 0 : datesLine.children.length).to.equal(0);
|
|
51
|
+
});
|
|
52
|
+
it('should render with snippet block when it has snippets', async () => {
|
|
53
|
+
var _a;
|
|
54
54
|
const el = await fixture(html `
|
|
55
55
|
<tile-list .model=${{ snippets: ['some {{{snippet}}} text'] }}>
|
|
56
56
|
</tile-list>
|
|
57
|
-
`);
|
|
58
|
-
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
59
|
-
expect(snippetBlock).to.exist;
|
|
60
|
-
});
|
|
61
|
-
it('should not render snippet block when no snippets are present', async () => {
|
|
62
|
-
var _a;
|
|
63
|
-
const el = await fixture(html `<tile-list></tile-list>`);
|
|
64
|
-
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
65
|
-
expect(snippetBlock).to.not.exist;
|
|
66
|
-
});
|
|
67
|
-
it('should not render suppressed collections', async () => {
|
|
68
|
-
var _a;
|
|
69
|
-
const collectionNameCache = new MockCollectionNameCache();
|
|
57
|
+
`);
|
|
58
|
+
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
59
|
+
expect(snippetBlock).to.exist;
|
|
60
|
+
});
|
|
61
|
+
it('should not render snippet block when no snippets are present', async () => {
|
|
62
|
+
var _a;
|
|
63
|
+
const el = await fixture(html `<tile-list></tile-list>`);
|
|
64
|
+
const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
|
|
65
|
+
expect(snippetBlock).to.not.exist;
|
|
66
|
+
});
|
|
67
|
+
it('should not render suppressed collections', async () => {
|
|
68
|
+
var _a;
|
|
69
|
+
const collectionNameCache = new MockCollectionNameCache();
|
|
70
70
|
const el = await fixture(html `
|
|
71
71
|
<tile-list
|
|
72
72
|
.model=${{ collections: ['deemphasize', 'community', 'foo'] }}
|
|
@@ -74,16 +74,16 @@ describe('List Tile', () => {
|
|
|
74
74
|
.collectionNameCache=${collectionNameCache}
|
|
75
75
|
>
|
|
76
76
|
</tile-list>
|
|
77
|
-
`);
|
|
78
|
-
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
79
|
-
expect(collectionsRow).to.exist;
|
|
80
|
-
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
81
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
82
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/foo');
|
|
83
|
-
});
|
|
84
|
-
it('should not render fav- collections', async () => {
|
|
85
|
-
var _a;
|
|
86
|
-
const collectionNameCache = new MockCollectionNameCache();
|
|
77
|
+
`);
|
|
78
|
+
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
79
|
+
expect(collectionsRow).to.exist;
|
|
80
|
+
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
81
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
82
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/foo');
|
|
83
|
+
});
|
|
84
|
+
it('should not render fav- collections', async () => {
|
|
85
|
+
var _a;
|
|
86
|
+
const collectionNameCache = new MockCollectionNameCache();
|
|
87
87
|
const el = await fixture(html `
|
|
88
88
|
<tile-list
|
|
89
89
|
.model=${{ collections: ['fav-foo', 'bar'] }}
|
|
@@ -91,247 +91,247 @@ describe('List Tile', () => {
|
|
|
91
91
|
.collectionNameCache=${collectionNameCache}
|
|
92
92
|
>
|
|
93
93
|
</tile-list>
|
|
94
|
-
`);
|
|
95
|
-
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
96
|
-
expect(collectionsRow).to.exist;
|
|
97
|
-
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
98
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
99
|
-
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/bar');
|
|
100
|
-
});
|
|
101
|
-
it('should render weekly views when sorting by week', async () => {
|
|
102
|
-
var _a, _b;
|
|
94
|
+
`);
|
|
95
|
+
const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
|
|
96
|
+
expect(collectionsRow).to.exist;
|
|
97
|
+
const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
|
|
98
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
|
|
99
|
+
expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/bar');
|
|
100
|
+
});
|
|
101
|
+
it('should render weekly views when sorting by week', async () => {
|
|
102
|
+
var _a, _b;
|
|
103
103
|
const el = await fixture(html `
|
|
104
104
|
<tile-list
|
|
105
105
|
.model=${{ viewCount: 50, weeklyViewCount: 10 }}
|
|
106
106
|
.sortParam=${{ field: 'week', direction: 'desc' }}
|
|
107
107
|
>
|
|
108
108
|
</tile-list>
|
|
109
|
-
`);
|
|
110
|
-
const viewsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('views-line');
|
|
111
|
-
expect(viewsRow).to.exist;
|
|
112
|
-
expect((_b = viewsRow === null || viewsRow === void 0 ? void 0 : viewsRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Views: 10');
|
|
113
|
-
});
|
|
114
|
-
it('should render published date when sorting by it', async () => {
|
|
115
|
-
var _a, _b;
|
|
116
|
-
const model = {
|
|
117
|
-
dateAdded: new Date(2010, 0, 2),
|
|
118
|
-
dateArchived: new Date(2011, 0, 2),
|
|
119
|
-
datePublished: new Date(2012, 0, 2),
|
|
120
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
121
|
-
};
|
|
109
|
+
`);
|
|
110
|
+
const viewsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('views-line');
|
|
111
|
+
expect(viewsRow).to.exist;
|
|
112
|
+
expect((_b = viewsRow === null || viewsRow === void 0 ? void 0 : viewsRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Views: 10');
|
|
113
|
+
});
|
|
114
|
+
it('should render published date when sorting by it', async () => {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
const model = {
|
|
117
|
+
dateAdded: new Date(2010, 0, 2),
|
|
118
|
+
dateArchived: new Date(2011, 0, 2),
|
|
119
|
+
datePublished: new Date(2012, 0, 2),
|
|
120
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
121
|
+
};
|
|
122
122
|
const el = await fixture(html `
|
|
123
123
|
<tile-list
|
|
124
124
|
.model=${model}
|
|
125
125
|
.sortParam=${{ field: 'date', direction: 'desc' }}
|
|
126
126
|
>
|
|
127
127
|
</tile-list>
|
|
128
|
-
`);
|
|
129
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
130
|
-
expect(dateRow).to.exist;
|
|
131
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: Jan 02, 2012');
|
|
132
|
-
});
|
|
133
|
-
it('should render added date when sorting by it', async () => {
|
|
134
|
-
var _a, _b;
|
|
135
|
-
const model = {
|
|
136
|
-
dateAdded: new Date(2010, 0, 2),
|
|
137
|
-
dateArchived: new Date(2011, 0, 2),
|
|
138
|
-
datePublished: new Date(2012, 0, 2),
|
|
139
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
140
|
-
};
|
|
128
|
+
`);
|
|
129
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
130
|
+
expect(dateRow).to.exist;
|
|
131
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: Jan 02, 2012');
|
|
132
|
+
});
|
|
133
|
+
it('should render added date when sorting by it', async () => {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
const model = {
|
|
136
|
+
dateAdded: new Date(2010, 0, 2),
|
|
137
|
+
dateArchived: new Date(2011, 0, 2),
|
|
138
|
+
datePublished: new Date(2012, 0, 2),
|
|
139
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
140
|
+
};
|
|
141
141
|
const el = await fixture(html `
|
|
142
142
|
<tile-list
|
|
143
143
|
.model=${model}
|
|
144
144
|
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
145
145
|
>
|
|
146
146
|
</tile-list>
|
|
147
|
-
`);
|
|
148
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
149
|
-
expect(dateRow).to.exist;
|
|
150
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 02, 2010');
|
|
151
|
-
});
|
|
152
|
-
it('should render archived date when sorting by it', async () => {
|
|
153
|
-
var _a, _b;
|
|
154
|
-
const model = {
|
|
155
|
-
dateAdded: new Date(2010, 0, 2),
|
|
156
|
-
dateArchived: new Date(2011, 0, 2),
|
|
157
|
-
datePublished: new Date(2012, 0, 2),
|
|
158
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
159
|
-
};
|
|
147
|
+
`);
|
|
148
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
149
|
+
expect(dateRow).to.exist;
|
|
150
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 02, 2010');
|
|
151
|
+
});
|
|
152
|
+
it('should render archived date when sorting by it', async () => {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
const model = {
|
|
155
|
+
dateAdded: new Date(2010, 0, 2),
|
|
156
|
+
dateArchived: new Date(2011, 0, 2),
|
|
157
|
+
datePublished: new Date(2012, 0, 2),
|
|
158
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
159
|
+
};
|
|
160
160
|
const el = await fixture(html `
|
|
161
161
|
<tile-list
|
|
162
162
|
.model=${model}
|
|
163
163
|
.sortParam=${{ field: 'publicdate', direction: 'desc' }}
|
|
164
164
|
>
|
|
165
165
|
</tile-list>
|
|
166
|
-
`);
|
|
167
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
168
|
-
expect(dateRow).to.exist;
|
|
169
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Archived: Jan 02, 2011');
|
|
170
|
-
});
|
|
171
|
-
it('should render reviewed date when sorting by it', async () => {
|
|
172
|
-
var _a, _b;
|
|
173
|
-
const model = {
|
|
174
|
-
dateAdded: new Date(2010, 0, 2),
|
|
175
|
-
dateArchived: new Date(2011, 0, 2),
|
|
176
|
-
datePublished: new Date(2012, 0, 2),
|
|
177
|
-
dateReviewed: new Date(2013, 0, 2),
|
|
178
|
-
};
|
|
166
|
+
`);
|
|
167
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
168
|
+
expect(dateRow).to.exist;
|
|
169
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Archived: Jan 02, 2011');
|
|
170
|
+
});
|
|
171
|
+
it('should render reviewed date when sorting by it', async () => {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
const model = {
|
|
174
|
+
dateAdded: new Date(2010, 0, 2),
|
|
175
|
+
dateArchived: new Date(2011, 0, 2),
|
|
176
|
+
datePublished: new Date(2012, 0, 2),
|
|
177
|
+
dateReviewed: new Date(2013, 0, 2),
|
|
178
|
+
};
|
|
179
179
|
const el = await fixture(html `
|
|
180
180
|
<tile-list
|
|
181
181
|
.model=${model}
|
|
182
182
|
.sortParam=${{ field: 'reviewdate', direction: 'desc' }}
|
|
183
183
|
>
|
|
184
184
|
</tile-list>
|
|
185
|
-
`);
|
|
186
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
187
|
-
expect(dateRow).to.exist;
|
|
188
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Reviewed: Jan 02, 2013');
|
|
189
|
-
});
|
|
190
|
-
it('should only show the year for a date published of Jan 1 at midnight', async () => {
|
|
191
|
-
var _a, _b;
|
|
192
|
-
const model = {
|
|
193
|
-
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
194
|
-
};
|
|
185
|
+
`);
|
|
186
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
187
|
+
expect(dateRow).to.exist;
|
|
188
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Reviewed: Jan 02, 2013');
|
|
189
|
+
});
|
|
190
|
+
it('should only show the year for a date published of Jan 1 at midnight', async () => {
|
|
191
|
+
var _a, _b;
|
|
192
|
+
const model = {
|
|
193
|
+
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
194
|
+
};
|
|
195
195
|
const el = await fixture(html `
|
|
196
196
|
<tile-list
|
|
197
197
|
.model=${model}
|
|
198
198
|
.sortParam=${{ field: 'date', direction: 'desc' }}
|
|
199
199
|
>
|
|
200
200
|
</tile-list>
|
|
201
|
-
`);
|
|
202
|
-
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
203
|
-
expect(dateRow).to.exist;
|
|
204
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: 2012');
|
|
205
|
-
});
|
|
206
|
-
it('should show full date added/archived/reviewed, even on Jan 1 at midnight', async () => {
|
|
207
|
-
var _a, _b, _c, _d, _e, _f;
|
|
208
|
-
const model = {
|
|
209
|
-
dateAdded: new Date(2010, 0, 1, 0, 0, 0, 0),
|
|
210
|
-
dateArchived: new Date(2011, 0, 1, 0, 0, 0, 0),
|
|
211
|
-
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
212
|
-
dateReviewed: new Date(2013, 0, 1, 0, 0, 0, 0),
|
|
213
|
-
};
|
|
201
|
+
`);
|
|
202
|
+
const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
203
|
+
expect(dateRow).to.exist;
|
|
204
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: 2012');
|
|
205
|
+
});
|
|
206
|
+
it('should show full date added/archived/reviewed, even on Jan 1 at midnight', async () => {
|
|
207
|
+
var _a, _b, _c, _d, _e, _f;
|
|
208
|
+
const model = {
|
|
209
|
+
dateAdded: new Date(2010, 0, 1, 0, 0, 0, 0),
|
|
210
|
+
dateArchived: new Date(2011, 0, 1, 0, 0, 0, 0),
|
|
211
|
+
datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
|
|
212
|
+
dateReviewed: new Date(2013, 0, 1, 0, 0, 0, 0),
|
|
213
|
+
};
|
|
214
214
|
const el = await fixture(html `
|
|
215
215
|
<tile-list
|
|
216
216
|
.model=${model}
|
|
217
217
|
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
218
218
|
>
|
|
219
219
|
</tile-list>
|
|
220
|
-
`);
|
|
221
|
-
let dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
222
|
-
expect(dateRow).to.exist;
|
|
223
|
-
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 01, 2010');
|
|
224
|
-
el.sortParam = { field: 'publicdate', direction: 'desc' };
|
|
225
|
-
await el.updateComplete;
|
|
226
|
-
dateRow = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('dates-line');
|
|
227
|
-
expect(dateRow).to.exist;
|
|
228
|
-
expect((_d = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _d === void 0 ? void 0 : _d.trim()).to.contain('Archived: Jan 01, 2011');
|
|
229
|
-
el.sortParam = { field: 'reviewdate', direction: 'desc' };
|
|
230
|
-
await el.updateComplete;
|
|
231
|
-
dateRow = (_e = el.shadowRoot) === null || _e === void 0 ? void 0 : _e.getElementById('dates-line');
|
|
232
|
-
expect(dateRow).to.exist;
|
|
233
|
-
expect((_f = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _f === void 0 ? void 0 : _f.trim()).to.contain('Reviewed: Jan 01, 2013');
|
|
234
|
-
});
|
|
235
|
-
it('should render links to /search pages (not search.php) for subject, creator, and source', async () => {
|
|
236
|
-
var _a, _b, _c;
|
|
237
|
-
const model = {
|
|
238
|
-
subjects: ['foo'],
|
|
239
|
-
creators: ['bar'],
|
|
240
|
-
source: 'baz',
|
|
241
|
-
};
|
|
220
|
+
`);
|
|
221
|
+
let dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
|
|
222
|
+
expect(dateRow).to.exist;
|
|
223
|
+
expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Added: Jan 01, 2010');
|
|
224
|
+
el.sortParam = { field: 'publicdate', direction: 'desc' };
|
|
225
|
+
await el.updateComplete;
|
|
226
|
+
dateRow = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('dates-line');
|
|
227
|
+
expect(dateRow).to.exist;
|
|
228
|
+
expect((_d = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _d === void 0 ? void 0 : _d.trim()).to.contain('Archived: Jan 01, 2011');
|
|
229
|
+
el.sortParam = { field: 'reviewdate', direction: 'desc' };
|
|
230
|
+
await el.updateComplete;
|
|
231
|
+
dateRow = (_e = el.shadowRoot) === null || _e === void 0 ? void 0 : _e.getElementById('dates-line');
|
|
232
|
+
expect(dateRow).to.exist;
|
|
233
|
+
expect((_f = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _f === void 0 ? void 0 : _f.trim()).to.contain('Reviewed: Jan 01, 2013');
|
|
234
|
+
});
|
|
235
|
+
it('should render links to /search pages (not search.php) for subject, creator, and source', async () => {
|
|
236
|
+
var _a, _b, _c;
|
|
237
|
+
const model = {
|
|
238
|
+
subjects: ['foo'],
|
|
239
|
+
creators: ['bar'],
|
|
240
|
+
source: 'baz',
|
|
241
|
+
};
|
|
242
242
|
const el = await fixture(html `
|
|
243
243
|
<tile-list .model=${model}></tile-list>
|
|
244
|
-
`);
|
|
245
|
-
const subjectLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#topics a[href]');
|
|
246
|
-
expect(subjectLink).to.exist;
|
|
247
|
-
expect(subjectLink === null || subjectLink === void 0 ? void 0 : subjectLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
|
|
248
|
-
const creatorLink = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#creator a[href]');
|
|
249
|
-
expect(creatorLink).to.exist;
|
|
250
|
-
expect(creatorLink === null || creatorLink === void 0 ? void 0 : creatorLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
|
|
251
|
-
const sourceLink = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('#source a[href]');
|
|
252
|
-
expect(sourceLink).to.exist;
|
|
253
|
-
expect(sourceLink === null || sourceLink === void 0 ? void 0 : sourceLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
|
|
254
|
-
});
|
|
255
|
-
it('should render multi-line descriptions with spaces b/w lines', async () => {
|
|
256
|
-
var _a, _b;
|
|
244
|
+
`);
|
|
245
|
+
const subjectLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#topics a[href]');
|
|
246
|
+
expect(subjectLink).to.exist;
|
|
247
|
+
expect(subjectLink === null || subjectLink === void 0 ? void 0 : subjectLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
|
|
248
|
+
const creatorLink = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#creator a[href]');
|
|
249
|
+
expect(creatorLink).to.exist;
|
|
250
|
+
expect(creatorLink === null || creatorLink === void 0 ? void 0 : creatorLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
|
|
251
|
+
const sourceLink = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('#source a[href]');
|
|
252
|
+
expect(sourceLink).to.exist;
|
|
253
|
+
expect(sourceLink === null || sourceLink === void 0 ? void 0 : sourceLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
|
|
254
|
+
});
|
|
255
|
+
it('should render multi-line descriptions with spaces b/w lines', async () => {
|
|
256
|
+
var _a, _b;
|
|
257
257
|
const el = await fixture(html `
|
|
258
258
|
<tile-list .model=${{ description: 'line1\nline2' }}> </tile-list>
|
|
259
|
-
`);
|
|
260
|
-
const descriptionBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('description');
|
|
261
|
-
expect(descriptionBlock).to.exist;
|
|
262
|
-
expect((_b = descriptionBlock === null || descriptionBlock === void 0 ? void 0 : descriptionBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('line1 line2'); // line break replaced by space
|
|
263
|
-
});
|
|
264
|
-
it('should render mediatype icon as link to corresponding mediatype collection details', async () => {
|
|
265
|
-
var _a;
|
|
266
|
-
const model = {
|
|
267
|
-
mediatype: 'texts',
|
|
268
|
-
};
|
|
259
|
+
`);
|
|
260
|
+
const descriptionBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('description');
|
|
261
|
+
expect(descriptionBlock).to.exist;
|
|
262
|
+
expect((_b = descriptionBlock === null || descriptionBlock === void 0 ? void 0 : descriptionBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('line1 line2'); // line break replaced by space
|
|
263
|
+
});
|
|
264
|
+
it('should render mediatype icon as link to corresponding mediatype collection details', async () => {
|
|
265
|
+
var _a;
|
|
266
|
+
const model = {
|
|
267
|
+
mediatype: 'texts',
|
|
268
|
+
};
|
|
269
269
|
const el = await fixture(html `
|
|
270
270
|
<tile-list
|
|
271
271
|
.baseNavigationUrl=${'https://archive.org'}
|
|
272
272
|
.model=${model}
|
|
273
273
|
></tile-list>
|
|
274
|
-
`);
|
|
275
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
276
|
-
expect(mediatypeLink).to.exist;
|
|
277
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
|
|
278
|
-
});
|
|
279
|
-
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
|
|
280
|
-
var _a;
|
|
281
|
-
const model = {
|
|
282
|
-
mediatype: 'texts',
|
|
283
|
-
};
|
|
274
|
+
`);
|
|
275
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
276
|
+
expect(mediatypeLink).to.exist;
|
|
277
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
|
|
278
|
+
});
|
|
279
|
+
it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
|
|
280
|
+
var _a;
|
|
281
|
+
const model = {
|
|
282
|
+
mediatype: 'texts',
|
|
283
|
+
};
|
|
284
284
|
const el = await fixture(html `
|
|
285
285
|
<tile-list .baseNavigationUrl=${''} .model=${model}></tile-list>
|
|
286
|
-
`);
|
|
287
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
288
|
-
expect(mediatypeLink).to.exist;
|
|
289
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`/details/texts`);
|
|
290
|
-
});
|
|
291
|
-
it('should render collection mediatype icon as link to search page', async () => {
|
|
292
|
-
var _a;
|
|
293
|
-
const model = {
|
|
294
|
-
mediatype: 'collection',
|
|
295
|
-
};
|
|
286
|
+
`);
|
|
287
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
288
|
+
expect(mediatypeLink).to.exist;
|
|
289
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`/details/texts`);
|
|
290
|
+
});
|
|
291
|
+
it('should render collection mediatype icon as link to search page', async () => {
|
|
292
|
+
var _a;
|
|
293
|
+
const model = {
|
|
294
|
+
mediatype: 'collection',
|
|
295
|
+
};
|
|
296
296
|
const el = await fixture(html `
|
|
297
297
|
<tile-list
|
|
298
298
|
.baseNavigationUrl=${'https://archive.org'}
|
|
299
299
|
.model=${model}
|
|
300
300
|
></tile-list>
|
|
301
|
-
`);
|
|
302
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
303
|
-
expect(mediatypeLink).to.exist;
|
|
304
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
|
|
305
|
-
});
|
|
306
|
-
it('should not render account mediatype icon as link', async () => {
|
|
307
|
-
var _a;
|
|
308
|
-
const model = {
|
|
309
|
-
mediatype: 'account',
|
|
310
|
-
};
|
|
301
|
+
`);
|
|
302
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
303
|
+
expect(mediatypeLink).to.exist;
|
|
304
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
|
|
305
|
+
});
|
|
306
|
+
it('should not render account mediatype icon as link', async () => {
|
|
307
|
+
var _a;
|
|
308
|
+
const model = {
|
|
309
|
+
mediatype: 'account',
|
|
310
|
+
};
|
|
311
311
|
const el = await fixture(html `
|
|
312
312
|
<tile-list
|
|
313
313
|
.baseNavigationUrl=${'https://archive.org'}
|
|
314
314
|
.model=${model}
|
|
315
315
|
></tile-list>
|
|
316
|
-
`);
|
|
317
|
-
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
318
|
-
expect(mediatypeLink).to.exist;
|
|
319
|
-
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).not.to.exist;
|
|
320
|
-
});
|
|
321
|
-
it('should render date added for accounts', async () => {
|
|
322
|
-
var _a, _b;
|
|
316
|
+
`);
|
|
317
|
+
const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
|
|
318
|
+
expect(mediatypeLink).to.exist;
|
|
319
|
+
expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).not.to.exist;
|
|
320
|
+
});
|
|
321
|
+
it('should render date added for accounts', async () => {
|
|
322
|
+
var _a, _b;
|
|
323
323
|
const el = await fixture(html `
|
|
324
324
|
<tile-list
|
|
325
|
-
.model=${{
|
|
326
|
-
mediatype: 'account',
|
|
327
|
-
dateAdded: new Date('2015-05-05T00:00:00'),
|
|
325
|
+
.model=${{
|
|
326
|
+
mediatype: 'account',
|
|
327
|
+
dateAdded: new Date('2015-05-05T00:00:00'),
|
|
328
328
|
}}
|
|
329
329
|
>
|
|
330
330
|
</tile-list>
|
|
331
|
-
`);
|
|
332
|
-
const creatorBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('creator');
|
|
333
|
-
expect(creatorBlock).to.exist;
|
|
334
|
-
expect((_b = creatorBlock === null || creatorBlock === void 0 ? void 0 : creatorBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Archivist since 2015');
|
|
335
|
-
});
|
|
336
|
-
});
|
|
331
|
+
`);
|
|
332
|
+
const creatorBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('creator');
|
|
333
|
+
expect(creatorBlock).to.exist;
|
|
334
|
+
expect((_b = creatorBlock === null || creatorBlock === void 0 ? void 0 : creatorBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Archivist since 2015');
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
337
|
//# sourceMappingURL=tile-list.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../../src/tiles/tile-dispatcher';
|
|
1
|
+
import '../../src/tiles/tile-dispatcher';
|