@internetarchive/collection-browser 3.4.1-alpha-webdev7761.2 → 3.4.1-alpha-webdev7761.4

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.
Files changed (208) hide show
  1. package/dist/src/app-root.js +19 -28
  2. package/dist/src/app-root.js.map +1 -1
  3. package/dist/src/collection-browser.d.ts +14 -10
  4. package/dist/src/collection-browser.js +870 -886
  5. package/dist/src/collection-browser.js.map +1 -1
  6. package/dist/src/collection-facets/facet-row.js +3 -4
  7. package/dist/src/collection-facets/facet-row.js.map +1 -1
  8. package/dist/src/collection-facets/models.js.map +1 -1
  9. package/dist/src/collection-facets/more-facets-content.js +145 -156
  10. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  11. package/dist/src/collection-facets/more-facets-pagination.js +6 -10
  12. package/dist/src/collection-facets/more-facets-pagination.js.map +1 -1
  13. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js +16 -21
  14. package/dist/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.js.map +1 -1
  15. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +7 -10
  16. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
  17. package/dist/src/collection-facets/smart-facets/smart-facet-button.js +3 -2
  18. package/dist/src/collection-facets/smart-facets/smart-facet-button.js.map +1 -1
  19. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js +9 -11
  20. package/dist/src/collection-facets/smart-facets/smart-facet-dropdown.js.map +1 -1
  21. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js +7 -7
  22. package/dist/src/collection-facets/smart-facets/smart-facet-heuristics.js.map +1 -1
  23. package/dist/src/collection-facets/toggle-switch.js +4 -6
  24. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  25. package/dist/src/collection-facets.js +34 -50
  26. package/dist/src/collection-facets.js.map +1 -1
  27. package/dist/src/combo-box/caret-closed.js +5 -11
  28. package/dist/src/combo-box/caret-closed.js.map +1 -1
  29. package/dist/src/combo-box/caret-open.js +5 -11
  30. package/dist/src/combo-box/caret-open.js.map +1 -1
  31. package/dist/src/combo-box/clear.d.ts +2 -0
  32. package/dist/src/combo-box/clear.js +11 -0
  33. package/dist/src/combo-box/clear.js.map +1 -0
  34. package/dist/src/combo-box/ia-combo-box.d.ts +40 -9
  35. package/dist/src/combo-box/ia-combo-box.js +363 -272
  36. package/dist/src/combo-box/ia-combo-box.js.map +1 -1
  37. package/dist/src/combo-box/models.d.ts +14 -0
  38. package/dist/src/combo-box/models.js +32 -1
  39. package/dist/src/combo-box/models.js.map +1 -1
  40. package/dist/src/data-source/collection-browser-data-source.js +35 -47
  41. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  42. package/dist/src/empty-placeholder.js +19 -18
  43. package/dist/src/empty-placeholder.js.map +1 -1
  44. package/dist/src/expanded-date-picker.js +6 -10
  45. package/dist/src/expanded-date-picker.js.map +1 -1
  46. package/dist/src/language-code-handler/language-code-handler.js +2 -2
  47. package/dist/src/language-code-handler/language-code-handler.js.map +1 -1
  48. package/dist/src/manage/manage-bar.js +86 -92
  49. package/dist/src/manage/manage-bar.js.map +1 -1
  50. package/dist/src/manage/remove-items-modal-content.js +2 -2
  51. package/dist/src/manage/remove-items-modal-content.js.map +1 -1
  52. package/dist/src/models.js +36 -40
  53. package/dist/src/models.js.map +1 -1
  54. package/dist/src/restoration-state-handler.js +9 -10
  55. package/dist/src/restoration-state-handler.js.map +1 -1
  56. package/dist/src/sort-filter-bar/alpha-bar.js +9 -14
  57. package/dist/src/sort-filter-bar/alpha-bar.js.map +1 -1
  58. package/dist/src/sort-filter-bar/sort-filter-bar.js +14 -24
  59. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  60. package/dist/src/tiles/base-tile-component.js +1 -2
  61. package/dist/src/tiles/base-tile-component.js.map +1 -1
  62. package/dist/src/tiles/grid/account-tile.js +36 -38
  63. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  64. package/dist/src/tiles/grid/collection-tile.js +79 -82
  65. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  66. package/dist/src/tiles/grid/item-tile.js +154 -164
  67. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  68. package/dist/src/tiles/grid/search-tile.js +42 -43
  69. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  70. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +119 -119
  71. package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js.map +1 -1
  72. package/dist/src/tiles/grid/tile-stats.js +2 -3
  73. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  74. package/dist/src/tiles/hover/hover-pane-controller.js +42 -49
  75. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  76. package/dist/src/tiles/hover/tile-hover-pane.js +113 -114
  77. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
  78. package/dist/src/tiles/image-block.js +5 -8
  79. package/dist/src/tiles/image-block.js.map +1 -1
  80. package/dist/src/tiles/item-image.js +12 -19
  81. package/dist/src/tiles/item-image.js.map +1 -1
  82. package/dist/src/tiles/list/tile-list-compact.js +114 -122
  83. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  84. package/dist/src/tiles/list/tile-list.js +326 -347
  85. package/dist/src/tiles/list/tile-list.js.map +1 -1
  86. package/dist/src/tiles/overlay/icon-overlay.js +1 -2
  87. package/dist/src/tiles/overlay/icon-overlay.js.map +1 -1
  88. package/dist/src/tiles/overlay/text-overlay.js +2 -4
  89. package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
  90. package/dist/src/tiles/text-snippet-block.js +2 -4
  91. package/dist/src/tiles/text-snippet-block.js.map +1 -1
  92. package/dist/src/tiles/tile-dispatcher.js +233 -241
  93. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  94. package/dist/src/tiles/tile-display-value-provider.js +5 -9
  95. package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
  96. package/dist/src/tiles/tile-mediatype-icon.js +12 -19
  97. package/dist/src/tiles/tile-mediatype-icon.js.map +1 -1
  98. package/dist/src/utils/collapse-repeated-quotes.js +1 -1
  99. package/dist/src/utils/collapse-repeated-quotes.js.map +1 -1
  100. package/dist/src/utils/facet-utils.js +3 -5
  101. package/dist/src/utils/facet-utils.js.map +1 -1
  102. package/dist/src/utils/format-count.js +10 -10
  103. package/dist/src/utils/format-count.js.map +1 -1
  104. package/dist/src/utils/format-date.js.map +1 -1
  105. package/dist/src/utils/resolve-mediatype.js +2 -3
  106. package/dist/src/utils/resolve-mediatype.js.map +1 -1
  107. package/dist/test/collection-browser.test.js +131 -185
  108. package/dist/test/collection-browser.test.js.map +1 -1
  109. package/dist/test/collection-facets/facet-row.test.js +60 -75
  110. package/dist/test/collection-facets/facet-row.test.js.map +1 -1
  111. package/dist/test/collection-facets/facets-template.test.js +17 -23
  112. package/dist/test/collection-facets/facets-template.test.js.map +1 -1
  113. package/dist/test/collection-facets/more-facets-content.test.js +22 -32
  114. package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
  115. package/dist/test/collection-facets/more-facets-pagination.test.js +16 -22
  116. package/dist/test/collection-facets/more-facets-pagination.test.js.map +1 -1
  117. package/dist/test/collection-facets/toggle-switch.test.js +22 -19
  118. package/dist/test/collection-facets/toggle-switch.test.js.map +1 -1
  119. package/dist/test/collection-facets.test.js +80 -97
  120. package/dist/test/collection-facets.test.js.map +1 -1
  121. package/dist/test/empty-placeholder.test.js +11 -17
  122. package/dist/test/empty-placeholder.test.js.map +1 -1
  123. package/dist/test/expanded-date-picker.test.js +8 -14
  124. package/dist/test/expanded-date-picker.test.js.map +1 -1
  125. package/dist/test/icon-overlay.test.js +7 -6
  126. package/dist/test/icon-overlay.test.js.map +1 -1
  127. package/dist/test/image-block.test.js +16 -26
  128. package/dist/test/image-block.test.js.map +1 -1
  129. package/dist/test/item-image.test.js +23 -32
  130. package/dist/test/item-image.test.js.map +1 -1
  131. package/dist/test/manage/manage-bar.test.js +21 -33
  132. package/dist/test/manage/manage-bar.test.js.map +1 -1
  133. package/dist/test/manage/remove-items-modal-content.test.js +10 -15
  134. package/dist/test/manage/remove-items-modal-content.test.js.map +1 -1
  135. package/dist/test/mocks/mock-search-service.js +2 -3
  136. package/dist/test/mocks/mock-search-service.js.map +1 -1
  137. package/dist/test/restoration-state-handler.test.js +13 -21
  138. package/dist/test/restoration-state-handler.test.js.map +1 -1
  139. package/dist/test/review-block.test.js +16 -18
  140. package/dist/test/review-block.test.js.map +1 -1
  141. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +2 -3
  142. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +1 -1
  143. package/dist/test/sort-filter-bar/alpha-bar.test.js +18 -24
  144. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +1 -1
  145. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +178 -180
  146. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  147. package/dist/test/text-overlay.test.js +16 -15
  148. package/dist/test/text-overlay.test.js.map +1 -1
  149. package/dist/test/text-snippet-block.test.js +14 -19
  150. package/dist/test/text-snippet-block.test.js.map +1 -1
  151. package/dist/test/tile-stats.test.js +73 -34
  152. package/dist/test/tile-stats.test.js.map +1 -1
  153. package/dist/test/tiles/grid/account-tile.test.js +25 -25
  154. package/dist/test/tiles/grid/account-tile.test.js.map +1 -1
  155. package/dist/test/tiles/grid/collection-tile.test.js +13 -19
  156. package/dist/test/tiles/grid/collection-tile.test.js.map +1 -1
  157. package/dist/test/tiles/grid/item-tile.test.js +141 -168
  158. package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
  159. package/dist/test/tiles/grid/search-tile.test.js +9 -13
  160. package/dist/test/tiles/grid/search-tile.test.js.map +1 -1
  161. package/dist/test/tiles/hover/hover-pane-controller.test.js +50 -62
  162. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
  163. package/dist/test/tiles/hover/tile-hover-pane.test.js +12 -16
  164. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +1 -1
  165. package/dist/test/tiles/list/tile-list-compact.test.js +104 -118
  166. package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
  167. package/dist/test/tiles/list/tile-list.test.js +202 -231
  168. package/dist/test/tiles/list/tile-list.test.js.map +1 -1
  169. package/dist/test/tiles/tile-dispatcher.test.js +97 -110
  170. package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
  171. package/dist/test/tiles/tile-mediatype-icon.test.js +12 -24
  172. package/dist/test/tiles/tile-mediatype-icon.test.js.map +1 -1
  173. package/dist/test/utils/format-date.test.js.map +1 -1
  174. package/index.html +1 -1
  175. package/package.json +5 -3
  176. package/src/collection-browser.ts +3060 -3030
  177. package/src/collection-facets/models.ts +10 -10
  178. package/src/collection-facets/more-facets-content.ts +639 -639
  179. package/src/collection-facets.ts +1 -1
  180. package/src/combo-box/caret-closed.ts +5 -11
  181. package/src/combo-box/caret-open.ts +5 -11
  182. package/src/combo-box/clear.ts +11 -0
  183. package/src/combo-box/ia-combo-box.ts +1288 -1180
  184. package/src/combo-box/models.ts +31 -1
  185. package/src/manage/manage-bar.ts +247 -247
  186. package/src/restoration-state-handler.ts +5 -1
  187. package/src/tiles/base-tile-component.ts +65 -65
  188. package/src/tiles/grid/account-tile.ts +113 -113
  189. package/src/tiles/grid/collection-tile.ts +163 -163
  190. package/src/tiles/grid/item-tile.ts +340 -340
  191. package/src/tiles/grid/search-tile.ts +90 -90
  192. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +130 -130
  193. package/src/tiles/hover/hover-pane-controller.ts +613 -613
  194. package/src/tiles/hover/tile-hover-pane.ts +184 -184
  195. package/src/tiles/list/tile-list-compact.ts +239 -239
  196. package/src/tiles/list/tile-list.ts +700 -700
  197. package/src/tiles/tile-dispatcher.ts +517 -517
  198. package/src/utils/format-date.ts +62 -62
  199. package/test/collection-facets/facet-row.test.ts +375 -375
  200. package/test/collection-facets.test.ts +928 -928
  201. package/test/tiles/grid/item-tile.test.ts +520 -520
  202. package/test/tiles/hover/hover-pane-controller.test.ts +418 -418
  203. package/test/tiles/list/tile-list-compact.test.ts +282 -282
  204. package/test/tiles/list/tile-list.test.ts +552 -552
  205. package/test/tiles/tile-dispatcher.test.ts +283 -283
  206. package/test/utils/format-date.test.ts +89 -89
  207. package/tsconfig.json +8 -3
  208. package/vite.config.ts +29 -22
@@ -3,259 +3,241 @@ import { html } from 'lit';
3
3
  import '../../../src/tiles/list/tile-list';
4
4
  describe('List Tile', () => {
5
5
  it('should render initial component', async () => {
6
- var _a, _b, _c;
7
6
  const el = await fixture(html `<tile-list .model=${{}}></tile-list>`);
8
- const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#list-line');
9
- const itemTitle = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#title');
10
- const imageBlock = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('image-block');
7
+ const listContainer = el.shadowRoot?.querySelector('#list-line');
8
+ const itemTitle = el.shadowRoot?.querySelector('#title');
9
+ const imageBlock = el.shadowRoot?.querySelector('image-block');
11
10
  expect(listContainer).to.exist;
12
11
  expect(itemTitle).to.exist;
13
12
  expect(imageBlock).to.exist;
14
13
  });
15
14
  it('should render the mobile template if below mobile breakpoint', async () => {
16
- var _a, _b, _c;
17
- const el = await fixture(html `
18
- <tile-list .mobileBreakpoint=${500} .currentWidth=${400}> </tile-list>
15
+ const el = await fixture(html `
16
+ <tile-list .mobileBreakpoint=${500} .currentWidth=${400}> </tile-list>
19
17
  `);
20
- const listContainer = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('list-line');
21
- const topLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.getElementById('list-line-top');
22
- const bottomLine = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('list-line-bottom');
18
+ const listContainer = el.shadowRoot?.getElementById('list-line');
19
+ const topLine = el.shadowRoot?.getElementById('list-line-top');
20
+ const bottomLine = el.shadowRoot?.getElementById('list-line-bottom');
23
21
  expect(listContainer).to.exist;
24
- expect(listContainer === null || listContainer === void 0 ? void 0 : listContainer.classList.contains('mobile')).to.be.true;
22
+ expect(listContainer?.classList.contains('mobile')).to.be.true;
25
23
  expect(topLine).to.exist;
26
24
  expect(bottomLine).to.exist;
27
25
  });
28
26
  it('should render title link with model href if provided', async () => {
29
- var _a;
30
- const el = await fixture(html `
31
- <tile-list
32
- .baseNavigationUrl=${''}
33
- .model=${{ title: 'foo', href: '/foo/bar' }}
34
- ></tile-list>
27
+ const el = await fixture(html `
28
+ <tile-list
29
+ .baseNavigationUrl=${''}
30
+ .model=${{ title: 'foo', href: '/foo/bar' }}
31
+ ></tile-list>
35
32
  `);
36
- const title = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#title > a');
33
+ const title = el.shadowRoot?.querySelector('#title > a');
37
34
  expect(title).to.exist;
38
- expect(title === null || title === void 0 ? void 0 : title.getAttribute('href')).to.equal('/foo/bar');
35
+ expect(title?.getAttribute('href')).to.equal('/foo/bar');
39
36
  });
40
37
  it('should add title to image link if provided', async () => {
41
- var _a;
42
- const el = await fixture(html `
43
- <tile-list
44
- .baseNavigationUrl=${''}
45
- .model=${{ title: 'foo', href: '/foo/bar' }}
46
- ></tile-list>
38
+ const el = await fixture(html `
39
+ <tile-list
40
+ .baseNavigationUrl=${''}
41
+ .model=${{ title: 'foo', href: '/foo/bar' }}
42
+ ></tile-list>
47
43
  `);
48
- const imageLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#image-link');
44
+ const imageLink = el.shadowRoot?.querySelector('#image-link');
49
45
  expect(imageLink).to.exist;
50
- expect(imageLink === null || imageLink === void 0 ? void 0 : imageLink.getAttribute('title')).to.equal('View foo');
46
+ expect(imageLink?.getAttribute('title')).to.equal('View foo');
51
47
  });
52
48
  it('should render with creator element but not dates', async () => {
53
- var _a, _b;
54
- const el = await fixture(html `
55
- <tile-list .model=${{ creators: ['someone'] }}></tile-list>
49
+ const el = await fixture(html `
50
+ <tile-list .model=${{ creators: ['someone'] }}></tile-list>
56
51
  `);
57
- const creator = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#creator');
58
- const datesLine = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#dates-line');
52
+ const creator = el.shadowRoot?.querySelector('#creator');
53
+ const datesLine = el.shadowRoot?.querySelector('#dates-line');
59
54
  expect(creator).to.exist;
60
- expect(datesLine === null || datesLine === void 0 ? void 0 : datesLine.children.length).to.equal(0);
55
+ expect(datesLine?.children.length).to.equal(0);
61
56
  });
62
57
  it('should render with snippet block when it has snippets', async () => {
63
- var _a;
64
- const el = await fixture(html `
65
- <tile-list .model=${{ snippets: ['some {{{snippet}}} text'] }}>
66
- </tile-list>
58
+ const el = await fixture(html `
59
+ <tile-list .model=${{ snippets: ['some {{{snippet}}} text'] }}>
60
+ </tile-list>
67
61
  `);
68
- const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
62
+ const snippetBlock = el.shadowRoot?.querySelector('text-snippet-block');
69
63
  expect(snippetBlock).to.exist;
70
64
  });
71
65
  it('should not render snippet block when no snippets are present', async () => {
72
- var _a;
73
66
  const el = await fixture(html `<tile-list></tile-list>`);
74
- const snippetBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('text-snippet-block');
67
+ const snippetBlock = el.shadowRoot?.querySelector('text-snippet-block');
75
68
  expect(snippetBlock).to.not.exist;
76
69
  });
77
70
  it('should not render suppressed collections', async () => {
78
- var _a;
79
- const el = await fixture(html `
80
- <tile-list
81
- .model=${{ collections: ['deemphasize', 'community', 'foo'] }}
82
- .baseNavigationUrl=${'base'}
83
- >
84
- </tile-list>
71
+ const el = await fixture(html `
72
+ <tile-list
73
+ .model=${{ collections: ['deemphasize', 'community', 'foo'] }}
74
+ .baseNavigationUrl=${'base'}
75
+ >
76
+ </tile-list>
85
77
  `);
86
- const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
78
+ const collectionsRow = el.shadowRoot?.getElementById('collections');
87
79
  expect(collectionsRow).to.exist;
88
- const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
89
- expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
90
- expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/foo');
80
+ const collectionLinks = collectionsRow?.querySelectorAll('a[href]');
81
+ expect(collectionLinks?.length).to.equal(1);
82
+ expect(collectionLinks?.item(0).getAttribute('href')).to.equal('base/details/foo');
91
83
  });
92
84
  it('should not render fav- collections', async () => {
93
- var _a;
94
- const el = await fixture(html `
95
- <tile-list
96
- .model=${{ collections: ['fav-foo', 'bar'] }}
97
- .baseNavigationUrl=${'base'}
98
- >
99
- </tile-list>
85
+ const el = await fixture(html `
86
+ <tile-list
87
+ .model=${{ collections: ['fav-foo', 'bar'] }}
88
+ .baseNavigationUrl=${'base'}
89
+ >
90
+ </tile-list>
100
91
  `);
101
- const collectionsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('collections');
92
+ const collectionsRow = el.shadowRoot?.getElementById('collections');
102
93
  expect(collectionsRow).to.exist;
103
- const collectionLinks = collectionsRow === null || collectionsRow === void 0 ? void 0 : collectionsRow.querySelectorAll('a[href]');
104
- expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.length).to.equal(1);
105
- expect(collectionLinks === null || collectionLinks === void 0 ? void 0 : collectionLinks.item(0).getAttribute('href')).to.equal('base/details/bar');
94
+ const collectionLinks = collectionsRow?.querySelectorAll('a[href]');
95
+ expect(collectionLinks?.length).to.equal(1);
96
+ expect(collectionLinks?.item(0).getAttribute('href')).to.equal('base/details/bar');
106
97
  });
107
98
  it('should render weekly views when sorting by week', async () => {
108
- var _a, _b;
109
- const el = await fixture(html `
110
- <tile-list
111
- .model=${{ viewCount: 50, weeklyViewCount: 10 }}
112
- .sortParam=${{ field: 'week', direction: 'desc' }}
113
- >
114
- </tile-list>
99
+ const el = await fixture(html `
100
+ <tile-list
101
+ .model=${{ viewCount: 50, weeklyViewCount: 10 }}
102
+ .sortParam=${{ field: 'week', direction: 'desc' }}
103
+ >
104
+ </tile-list>
115
105
  `);
116
- const viewsRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('views-line');
106
+ const viewsRow = el.shadowRoot?.getElementById('views-line');
117
107
  expect(viewsRow).to.exist;
118
- expect((_b = viewsRow === null || viewsRow === void 0 ? void 0 : viewsRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Views: 10');
108
+ expect(viewsRow?.textContent?.trim()).to.equal('Views: 10');
119
109
  });
120
110
  it('should render published date when sorting by it', async () => {
121
- var _a, _b;
122
111
  const model = {
123
112
  dateAdded: new Date(2010, 0, 2),
124
113
  dateArchived: new Date(2011, 0, 2),
125
114
  datePublished: new Date(2012, 0, 2),
126
115
  dateReviewed: new Date(2013, 0, 2),
127
116
  };
128
- const el = await fixture(html `
129
- <tile-list
130
- .model=${model}
131
- .sortParam=${{ field: 'date', direction: 'desc' }}
132
- >
133
- </tile-list>
117
+ const el = await fixture(html `
118
+ <tile-list
119
+ .model=${model}
120
+ .sortParam=${{ field: 'date', direction: 'desc' }}
121
+ >
122
+ </tile-list>
134
123
  `);
135
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
124
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
136
125
  expect(dateRow).to.exist;
137
- 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');
126
+ expect(dateRow?.textContent?.trim()).to.contain('Published: Jan 02, 2012');
138
127
  });
139
128
  it('should render added date when sorting by it', async () => {
140
- var _a, _b;
141
129
  const model = {
142
130
  dateAdded: new Date(2010, 0, 2),
143
131
  dateArchived: new Date(2011, 0, 2),
144
132
  datePublished: new Date(2012, 0, 2),
145
133
  dateReviewed: new Date(2013, 0, 2),
146
134
  };
147
- const el = await fixture(html `
148
- <tile-list
149
- .model=${model}
150
- .sortParam=${{ field: 'addeddate', direction: 'desc' }}
151
- >
152
- </tile-list>
135
+ const el = await fixture(html `
136
+ <tile-list
137
+ .model=${model}
138
+ .sortParam=${{ field: 'addeddate', direction: 'desc' }}
139
+ >
140
+ </tile-list>
153
141
  `);
154
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
142
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
155
143
  expect(dateRow).to.exist;
156
- 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');
144
+ expect(dateRow?.textContent?.trim()).to.contain('Added: Jan 02, 2010');
157
145
  });
158
146
  it('should render archived date when sorting by it', async () => {
159
- var _a, _b;
160
147
  const model = {
161
148
  dateAdded: new Date(2010, 0, 2),
162
149
  dateArchived: new Date(2011, 0, 2),
163
150
  datePublished: new Date(2012, 0, 2),
164
151
  dateReviewed: new Date(2013, 0, 2),
165
152
  };
166
- const el = await fixture(html `
167
- <tile-list
168
- .model=${model}
169
- .sortParam=${{ field: 'publicdate', direction: 'desc' }}
170
- >
171
- </tile-list>
153
+ const el = await fixture(html `
154
+ <tile-list
155
+ .model=${model}
156
+ .sortParam=${{ field: 'publicdate', direction: 'desc' }}
157
+ >
158
+ </tile-list>
172
159
  `);
173
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
160
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
174
161
  expect(dateRow).to.exist;
175
- 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');
162
+ expect(dateRow?.textContent?.trim()).to.contain('Archived: Jan 02, 2011');
176
163
  });
177
164
  it('should render reviewed date when sorting by it', async () => {
178
- var _a, _b;
179
165
  const model = {
180
166
  dateAdded: new Date(2010, 0, 2),
181
167
  dateArchived: new Date(2011, 0, 2),
182
168
  datePublished: new Date(2012, 0, 2),
183
169
  dateReviewed: new Date(2013, 0, 2),
184
170
  };
185
- const el = await fixture(html `
186
- <tile-list
187
- .model=${model}
188
- .sortParam=${{ field: 'reviewdate', direction: 'desc' }}
189
- >
190
- </tile-list>
171
+ const el = await fixture(html `
172
+ <tile-list
173
+ .model=${model}
174
+ .sortParam=${{ field: 'reviewdate', direction: 'desc' }}
175
+ >
176
+ </tile-list>
191
177
  `);
192
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
178
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
193
179
  expect(dateRow).to.exist;
194
- 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');
180
+ expect(dateRow?.textContent?.trim()).to.contain('Reviewed: Jan 02, 2013');
195
181
  });
196
182
  it('should only show the year for a date published of Jan 1 at midnight UTC', async () => {
197
- var _a, _b;
198
183
  const model = {
199
184
  datePublished: new Date('2012-01-01T00:00:00Z'),
200
185
  };
201
- const el = await fixture(html `
202
- <tile-list
203
- .model=${model}
204
- .sortParam=${{ field: 'date', direction: 'desc' }}
205
- >
206
- </tile-list>
186
+ const el = await fixture(html `
187
+ <tile-list
188
+ .model=${model}
189
+ .sortParam=${{ field: 'date', direction: 'desc' }}
190
+ >
191
+ </tile-list>
207
192
  `);
208
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
193
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
209
194
  expect(dateRow).to.exist;
210
- expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: 2012');
195
+ expect(dateRow?.textContent?.trim()).to.contain('Published: 2012');
211
196
  });
212
197
  it('should show full date added/archived/reviewed, even on Jan 1 at midnight UTC', async () => {
213
- var _a, _b, _c, _d, _e, _f;
214
198
  const model = {
215
199
  dateAdded: new Date(2010, 0, 1, 0, 0, 0, 0),
216
200
  dateArchived: new Date(2011, 0, 1, 0, 0, 0, 0),
217
201
  datePublished: new Date(2012, 0, 1, 0, 0, 0, 0),
218
202
  dateReviewed: new Date(2013, 0, 1, 0, 0, 0, 0),
219
203
  };
220
- const el = await fixture(html `
221
- <tile-list
222
- .model=${model}
223
- .sortParam=${{ field: 'addeddate', direction: 'desc' }}
224
- >
225
- </tile-list>
204
+ const el = await fixture(html `
205
+ <tile-list
206
+ .model=${model}
207
+ .sortParam=${{ field: 'addeddate', direction: 'desc' }}
208
+ >
209
+ </tile-list>
226
210
  `);
227
- let dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
211
+ let dateRow = el.shadowRoot?.getElementById('dates-line');
228
212
  expect(dateRow).to.exist;
229
- 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');
213
+ expect(dateRow?.textContent?.trim()).to.contain('Added: Jan 01, 2010');
230
214
  el.sortParam = { field: 'publicdate', direction: 'desc' };
231
215
  await el.updateComplete;
232
- dateRow = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.getElementById('dates-line');
216
+ dateRow = el.shadowRoot?.getElementById('dates-line');
233
217
  expect(dateRow).to.exist;
234
- 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');
218
+ expect(dateRow?.textContent?.trim()).to.contain('Archived: Jan 01, 2011');
235
219
  el.sortParam = { field: 'reviewdate', direction: 'desc' };
236
220
  await el.updateComplete;
237
- dateRow = (_e = el.shadowRoot) === null || _e === void 0 ? void 0 : _e.getElementById('dates-line');
221
+ dateRow = el.shadowRoot?.getElementById('dates-line');
238
222
  expect(dateRow).to.exist;
239
- 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');
223
+ expect(dateRow?.textContent?.trim()).to.contain('Reviewed: Jan 01, 2013');
240
224
  });
241
225
  it('should display dates in UTC time zone by default', async () => {
242
- var _a, _b;
243
226
  const model = {
244
227
  datePublished: new Date('2012-02-15T00:00:00Z'),
245
228
  };
246
- const el = await fixture(html `
247
- <tile-list
248
- .model=${model}
249
- .sortParam=${{ field: 'date', direction: 'desc' }}
250
- >
251
- </tile-list>
229
+ const el = await fixture(html `
230
+ <tile-list
231
+ .model=${model}
232
+ .sortParam=${{ field: 'date', direction: 'desc' }}
233
+ >
234
+ </tile-list>
252
235
  `);
253
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
236
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
254
237
  expect(dateRow).to.exist;
255
- expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain('Published: Feb 15, 2012');
238
+ expect(dateRow?.textContent?.trim()).to.contain('Published: Feb 15, 2012');
256
239
  });
257
240
  it('should display dates in local time when useLocalTime option is true', async () => {
258
- var _a, _b;
259
241
  // Expected behavior depends on the time zone offset where the testing occurs
260
242
  const offset = new Date().getTimezoneOffset();
261
243
  let datePublished, expected;
@@ -277,192 +259,181 @@ describe('List Tile', () => {
277
259
  const model = {
278
260
  datePublished,
279
261
  };
280
- const el = await fixture(html `
281
- <tile-list
282
- useLocalTime
283
- .model=${model}
284
- .sortParam=${{ field: 'date', direction: 'desc' }}
285
- >
286
- </tile-list>
262
+ const el = await fixture(html `
263
+ <tile-list
264
+ useLocalTime
265
+ .model=${model}
266
+ .sortParam=${{ field: 'date', direction: 'desc' }}
267
+ >
268
+ </tile-list>
287
269
  `);
288
- const dateRow = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('dates-line');
270
+ const dateRow = el.shadowRoot?.getElementById('dates-line');
289
271
  expect(dateRow).to.exist;
290
- expect((_b = dateRow === null || dateRow === void 0 ? void 0 : dateRow.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.contain(expected);
272
+ expect(dateRow?.textContent?.trim()).to.contain(expected);
291
273
  });
292
274
  it('should render links to /search pages (not search.php) for subject, creator, and source', async () => {
293
- var _a, _b, _c;
294
275
  const model = {
295
276
  subjects: ['foo'],
296
277
  creators: ['bar'],
297
278
  source: 'baz',
298
279
  };
299
- const el = await fixture(html `
300
- <tile-list .model=${model}></tile-list>
280
+ const el = await fixture(html `
281
+ <tile-list .model=${model}></tile-list>
301
282
  `);
302
- const subjectLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#topics a[href]');
283
+ const subjectLink = el.shadowRoot?.querySelector('#topics a[href]');
303
284
  expect(subjectLink).to.exist;
304
- expect(subjectLink === null || subjectLink === void 0 ? void 0 : subjectLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
305
- const creatorLink = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#creator a[href]');
285
+ expect(subjectLink?.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('subject:"foo"')}`);
286
+ const creatorLink = el.shadowRoot?.querySelector('#creator a[href]');
306
287
  expect(creatorLink).to.exist;
307
- expect(creatorLink === null || creatorLink === void 0 ? void 0 : creatorLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
308
- const sourceLink = (_c = el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('#source a[href]');
288
+ expect(creatorLink?.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('creator:"bar"')}`);
289
+ const sourceLink = el.shadowRoot?.querySelector('#source a[href]');
309
290
  expect(sourceLink).to.exist;
310
- expect(sourceLink === null || sourceLink === void 0 ? void 0 : sourceLink.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
291
+ expect(sourceLink?.getAttribute('href')).to.equal(`/search?query=${encodeURIComponent('source:"baz"')}`);
311
292
  });
312
293
  it('should render multi-line descriptions with spaces b/w lines', async () => {
313
- var _a, _b;
314
- const el = await fixture(html `
315
- <tile-list .model=${{ description: 'line1\nline2' }}> </tile-list>
294
+ const el = await fixture(html `
295
+ <tile-list .model=${{ description: 'line1\nline2' }}> </tile-list>
316
296
  `);
317
- const descriptionBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('description');
297
+ const descriptionBlock = el.shadowRoot?.getElementById('description');
318
298
  expect(descriptionBlock).to.exist;
319
- 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
299
+ expect(descriptionBlock?.textContent?.trim()).to.equal('line1 line2'); // line break replaced by space
320
300
  });
321
301
  it('should render mediatype icon as link to corresponding mediatype collection details', async () => {
322
- var _a;
323
302
  const model = {
324
303
  mediatype: 'texts',
325
304
  };
326
- const el = await fixture(html `
327
- <tile-list
328
- .baseNavigationUrl=${'https://archive.org'}
329
- .model=${model}
330
- ></tile-list>
305
+ const el = await fixture(html `
306
+ <tile-list
307
+ .baseNavigationUrl=${'https://archive.org'}
308
+ .model=${model}
309
+ ></tile-list>
331
310
  `);
332
- const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
311
+ const mediatypeLink = el.shadowRoot?.querySelector('a#icon-right');
333
312
  expect(mediatypeLink).to.exist;
334
- expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
335
- expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('title')).to.equal('See more: texts');
313
+ expect(mediatypeLink?.getAttribute('href')).to.equal(`https://archive.org/details/texts`);
314
+ expect(mediatypeLink?.getAttribute('title')).to.equal('See more: texts');
336
315
  });
337
316
  it('should render mediatype icon as link even with empty baseNavigationUrl', async () => {
338
- var _a;
339
317
  const model = {
340
318
  mediatype: 'texts',
341
319
  };
342
- const el = await fixture(html `
343
- <tile-list .baseNavigationUrl=${''} .model=${model}></tile-list>
320
+ const el = await fixture(html `
321
+ <tile-list .baseNavigationUrl=${''} .model=${model}></tile-list>
344
322
  `);
345
- const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
323
+ const mediatypeLink = el.shadowRoot?.querySelector('a#icon-right');
346
324
  expect(mediatypeLink).to.exist;
347
- expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`/details/texts`);
325
+ expect(mediatypeLink?.getAttribute('href')).to.equal(`/details/texts`);
348
326
  });
349
327
  it('should render collection mediatype icon as link to search page', async () => {
350
- var _a;
351
328
  const model = {
352
329
  mediatype: 'collection',
353
330
  };
354
- const el = await fixture(html `
355
- <tile-list
356
- .baseNavigationUrl=${'https://archive.org'}
357
- .model=${model}
358
- ></tile-list>
331
+ const el = await fixture(html `
332
+ <tile-list
333
+ .baseNavigationUrl=${'https://archive.org'}
334
+ .model=${model}
335
+ ></tile-list>
359
336
  `);
360
- const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
337
+ const mediatypeLink = el.shadowRoot?.querySelector('a#icon-right');
361
338
  expect(mediatypeLink).to.exist;
362
- expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
339
+ expect(mediatypeLink?.getAttribute('href')).to.equal(`https://archive.org/search?query=mediatype:collection&sort=-downloads`);
363
340
  });
364
341
  it('should not render account mediatype icon as link', async () => {
365
- var _a;
366
342
  const model = {
367
343
  mediatype: 'account',
368
344
  };
369
- const el = await fixture(html `
370
- <tile-list
371
- .baseNavigationUrl=${'https://archive.org'}
372
- .model=${model}
373
- ></tile-list>
345
+ const el = await fixture(html `
346
+ <tile-list
347
+ .baseNavigationUrl=${'https://archive.org'}
348
+ .model=${model}
349
+ ></tile-list>
374
350
  `);
375
- const mediatypeLink = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('a#icon-right');
351
+ const mediatypeLink = el.shadowRoot?.querySelector('a#icon-right');
376
352
  expect(mediatypeLink).to.exist;
377
- expect(mediatypeLink === null || mediatypeLink === void 0 ? void 0 : mediatypeLink.getAttribute('href')).not.to.exist;
353
+ expect(mediatypeLink?.getAttribute('href')).not.to.exist;
378
354
  });
379
355
  it('should render date added for accounts', async () => {
380
- var _a, _b;
381
- const el = await fixture(html `
382
- <tile-list
356
+ const el = await fixture(html `
357
+ <tile-list
383
358
  .model=${{
384
359
  mediatype: 'account',
385
360
  dateAdded: new Date('2015-05-05T00:00:00'),
386
- }}
387
- >
388
- </tile-list>
361
+ }}
362
+ >
363
+ </tile-list>
389
364
  `);
390
- const creatorBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('creator');
365
+ const creatorBlock = el.shadowRoot?.getElementById('creator');
391
366
  expect(creatorBlock).to.exist;
392
- expect((_b = creatorBlock === null || creatorBlock === void 0 ? void 0 : creatorBlock.textContent) === null || _b === void 0 ? void 0 : _b.trim()).to.equal('Archivist since 2015');
367
+ expect(creatorBlock?.textContent?.trim()).to.equal('Archivist since 2015');
393
368
  });
394
369
  it('should render web capture date links if present', async () => {
395
- var _a, _b, _c, _d, _e;
396
370
  const captureDates = [
397
371
  new Date('2010-01-02T12:34:56Z'),
398
372
  new Date('2011-02-03T12:43:21Z'),
399
373
  ];
400
- const el = await fixture(html `
401
- <tile-list
374
+ const el = await fixture(html `
375
+ <tile-list
402
376
  .model=${{
403
377
  identifier: 'foo',
404
378
  title: 'https://example.com/',
405
379
  captureDates,
406
- }}
407
- ></tile-list>
380
+ }}
381
+ ></tile-list>
408
382
  `);
409
- const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
383
+ const captureDatesUl = el.shadowRoot?.querySelector('.capture-dates');
410
384
  expect(captureDatesUl, 'capture dates container').to.exist;
411
- expect(captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children.length).to.equal(2);
412
- const firstDateLink = (_b = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[0]) === null || _b === void 0 ? void 0 : _b.querySelector('a[href]');
385
+ expect(captureDatesUl?.children.length).to.equal(2);
386
+ const firstDateLink = captureDatesUl?.children[0]?.querySelector('a[href]');
413
387
  expect(firstDateLink, 'first date link').to.exist;
414
- expect(firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F');
415
- expect((_c = firstDateLink === null || firstDateLink === void 0 ? void 0 : firstDateLink.textContent) === null || _c === void 0 ? void 0 : _c.trim()).to.equal('Jan 02, 2010');
416
- const secondDateLink = (_d = captureDatesUl === null || captureDatesUl === void 0 ? void 0 : captureDatesUl.children[1]) === null || _d === void 0 ? void 0 : _d.querySelector('a[href]');
388
+ expect(firstDateLink?.getAttribute('href')).to.equal('https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F');
389
+ expect(firstDateLink?.textContent?.trim()).to.equal('Jan 02, 2010');
390
+ const secondDateLink = captureDatesUl?.children[1]?.querySelector('a[href]');
417
391
  expect(secondDateLink, 'second date link').to.exist;
418
- expect(secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.getAttribute('href')).to.equal('https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F');
419
- expect((_e = secondDateLink === null || secondDateLink === void 0 ? void 0 : secondDateLink.textContent) === null || _e === void 0 ? void 0 : _e.trim()).to.equal('Feb 03, 2011');
392
+ expect(secondDateLink?.getAttribute('href')).to.equal('https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F');
393
+ expect(secondDateLink?.textContent?.trim()).to.equal('Feb 03, 2011');
420
394
  });
421
395
  it('should not render web captures if no title is present', async () => {
422
- var _a;
423
396
  const captureDates = [
424
397
  new Date('2010-01-02T12:34:56Z'),
425
398
  new Date('2011-02-03T12:43:21Z'),
426
399
  ];
427
- const el = await fixture(html `
428
- <tile-list
400
+ const el = await fixture(html `
401
+ <tile-list
429
402
  .model=${{
430
403
  identifier: 'foo',
431
404
  captureDates,
432
- }}
433
- ></tile-list>
405
+ }}
406
+ ></tile-list>
434
407
  `);
435
- const captureDatesUl = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.capture-dates');
408
+ const captureDatesUl = el.shadowRoot?.querySelector('.capture-dates');
436
409
  expect(captureDatesUl).not.to.exist;
437
410
  });
438
411
  it('should render review snippet if present', async () => {
439
- var _a;
440
412
  const review = {
441
413
  title: 'Foo',
442
414
  body: 'foo bar baz',
443
415
  stars: 3,
444
416
  };
445
- const el = await fixture(html `
446
- <tile-list
417
+ const el = await fixture(html `
418
+ <tile-list
447
419
  .model=${{
448
420
  identifier: 'foo',
449
421
  review,
450
- }}
451
- ></tile-list>
422
+ }}
423
+ ></tile-list>
452
424
  `);
453
- const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
425
+ const reviewBlock = el.shadowRoot?.querySelector('review-block');
454
426
  expect(reviewBlock).to.exist;
455
427
  });
456
428
  it('should not render review snippet block when no review is present', async () => {
457
- var _a;
458
- const el = await fixture(html `
459
- <tile-list
429
+ const el = await fixture(html `
430
+ <tile-list
460
431
  .model=${{
461
432
  identifier: 'foo',
462
- }}
463
- ></tile-list>
433
+ }}
434
+ ></tile-list>
464
435
  `);
465
- const reviewBlock = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('review-block');
436
+ const reviewBlock = el.shadowRoot?.querySelector('review-block');
466
437
  expect(reviewBlock).not.to.exist;
467
438
  });
468
439
  });