@museumwnf/viewer-layout 3.61.0 → 3.63.0
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/dist/FeaturedRecord-Fe19w6_G.js +213 -0
- package/dist/LegacyItemSheet-Bmg8etGz.js +532 -0
- package/dist/{OnDisplayIn-DW4iC5BB.js → OnDisplayIn-BH3Bqope.js} +16 -9
- package/dist/{PageShell-CPtgzcxv.js → PageShell-CIGVv7sK.js} +144 -111
- package/dist/{PartnerMap-U-Hi2FBi.js → PartnerMap-DdyMLtgH.js} +5 -1
- package/dist/RecordView-Bgd5mm_e.js +384 -0
- package/dist/{SiteShell-qvsZO4Iz.js → SiteShell-UsZ_cpe9.js} +3 -2
- package/dist/Theme-Daezwp0p.js +391 -0
- package/dist/{TimelineEventList-1feZA5t7.js → TimelineEventList-CIkKxyQu.js} +122 -238
- package/dist/TimelineResultsView-BF3VoCs_.js +686 -0
- package/dist/components.js +1 -1
- package/dist/{content-BNS5U0Xv.js → content-hV5uyd-b.js} +2 -2
- package/dist/content.js +6 -6
- package/dist/data-CsMfGCkv.js +77 -0
- package/dist/data-DzrH9ikw.js +45 -0
- package/dist/dxa.js +2046 -1008
- package/dist/index.js +7 -7
- package/dist/standalone.js +3 -3
- package/dist/{themeSpecs-CsDpl4rR.js → themeSpecs-DIdmAEc3.js} +1 -1
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +755 -37
- package/package.json +1 -1
- package/src/dxa/testing.js +176 -120
- package/src/styles/dxa-exhibition.css +2289 -32
- package/src/styles/dxa-gallery.css +17 -2
- package/dist/FeaturedRecord-DaGLHyhD.js +0 -87
- package/dist/ItemDetailView-D7m2C1Mg.js +0 -310
- package/dist/RecordView-BE4mbj6G.js +0 -363
- package/dist/Theme-4RmyRY0x.js +0 -318
- package/dist/TimelineResultsView-CkH3NDqL.js +0 -1401
- package/dist/data-EKYeMQcC.js +0 -45
- package/dist/data-kqAkoQvf.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@museumwnf/viewer-layout",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.63.0",
|
|
4
4
|
"description": "Page structure for MWNF websites: PageShell composing seven optional, token-styled sections, the content components a page is made of, and the composed views a website names instead of writing a page.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/dxa/testing.js
CHANGED
|
@@ -62,39 +62,73 @@ const TILE = '.mwnf-dxa-grid__entry'
|
|
|
62
62
|
const GALLERY_PAGE = 20
|
|
63
63
|
const firstPage = (count) => Math.min(GALLERY_PAGE, Number(count))
|
|
64
64
|
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const tile = gallery ? TILE : EXHIBITION_TILE
|
|
76
|
-
it('renders the collection results on the composed results view', async () => {
|
|
65
|
+
// The collection results as legacy's: the tiles, the "filter further by"
|
|
66
|
+
// column, "<n> result(s) out of <total>" and the page links. The first page
|
|
67
|
+
// holds twenty tiles, or every record when there are fewer, and page links
|
|
68
|
+
// come only with a second page, above and below the grid. A gallery's pages
|
|
69
|
+
// are the platform's pagination, an exhibition's legacy's own pager
|
|
70
|
+
// (inventory-app#2423, #2379). `collection` is no longer read: it pinned the
|
|
71
|
+
// old nine a page.
|
|
72
|
+
function collectionTest(mountSite, collection = {}, { pager = '.mwnf-pagination' } = {}) {
|
|
73
|
+
void collection
|
|
74
|
+
it('renders the collection results as legacy', async () => {
|
|
77
75
|
const { app, host } = await mountSite('#/collection-results')
|
|
78
|
-
await vi.waitFor(() => expect(host.querySelector(
|
|
76
|
+
await vi.waitFor(() => expect(host.querySelector(TILE)).not.toBeNull(), WAIT)
|
|
79
77
|
expect(host.querySelector('.mwnf-catalogue')).not.toBeNull()
|
|
80
78
|
expect(host.querySelector('.mwnf-catalogue__aside .mwnf-filter')).not.toBeNull()
|
|
81
|
-
const count = host.querySelector('.mwnf-
|
|
79
|
+
const count = host.querySelector('.mwnf-dxa-gallery-results__info p + p')
|
|
82
80
|
expect(count).not.toBeNull()
|
|
83
|
-
const objects = Number(count.textContent.
|
|
84
|
-
|
|
85
|
-
const paginations = host.querySelectorAll(
|
|
86
|
-
if (
|
|
87
|
-
else
|
|
88
|
-
else expect(tiles).toBeGreaterThan(0)
|
|
89
|
-
if (gallery && objects <= GALLERY_PAGE) expect(paginations).toBe(0)
|
|
90
|
-
else if (collection.paginations) expect(paginations).toBe(collection.paginations)
|
|
91
|
-
else expect(paginations).toBeGreaterThan(0)
|
|
81
|
+
const objects = Number(count.textContent.match(/\d+/)?.[0] ?? NaN)
|
|
82
|
+
expect(host.querySelectorAll(TILE).length).toBe(firstPage(objects))
|
|
83
|
+
const paginations = host.querySelectorAll(pager).length
|
|
84
|
+
if (objects <= GALLERY_PAGE) expect(paginations).toBe(0)
|
|
85
|
+
else expect(paginations).toBe(2)
|
|
92
86
|
app.unmount()
|
|
93
87
|
}, 60000)
|
|
94
88
|
}
|
|
95
89
|
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
// An exhibition's search as legacy's (inventory-app#2379): the record in
|
|
91
|
+
// focus beside two columns of results, the empty search (`all-items`) every
|
|
92
|
+
// record, the empty result's three paragraphs with its link back to every
|
|
93
|
+
// record, and the tips under a Back button.
|
|
94
|
+
const EXHIBITION_RESULT = '.mwnf-dxa-exhibition-search__result'
|
|
95
|
+
function exhibitionSearchTests(mountSite, loadItems) {
|
|
96
|
+
it('returns every renderable record for the all-items sentinel', async () => {
|
|
97
|
+
const { app, host } = await mountSite('#/search?q=all-items')
|
|
98
|
+
await vi.waitFor(() => expect(host.querySelector(EXHIBITION_RESULT)).not.toBeNull(), WAIT)
|
|
99
|
+
expect(host.textContent).toContain('Results of your search')
|
|
100
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-search__main')).not.toBeNull()
|
|
101
|
+
app.unmount()
|
|
102
|
+
}, 30000)
|
|
103
|
+
|
|
104
|
+
it('finds a record by a word of its name', async () => {
|
|
105
|
+
const item = await loadItems()
|
|
106
|
+
const term = firstWord(item.internal_name)
|
|
107
|
+
const { app, host } = await mountSite(`#/search?q=${encodeURIComponent(term)}`)
|
|
108
|
+
await vi.waitFor(() => expect(host.querySelector(EXHIBITION_RESULT)).not.toBeNull(), WAIT)
|
|
109
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-search__input').value).toBe(term)
|
|
110
|
+
app.unmount()
|
|
111
|
+
}, 30000)
|
|
112
|
+
|
|
113
|
+
it('offers every record again after an empty keyword search', async () => {
|
|
114
|
+
const { app, host } = await mountSite('#/search?q=zzz-nonexistent-keyword-zzz')
|
|
115
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-exhibition-search__none')).not.toBeNull(), WAIT)
|
|
116
|
+
expect(host.textContent).toContain('No results found.')
|
|
117
|
+
expect(host.querySelector('a[href="#/search?q=all-items"]')).not.toBeNull()
|
|
118
|
+
expect(host.querySelector('a[href="#/how-to-search"]')).not.toBeNull()
|
|
119
|
+
app.unmount()
|
|
120
|
+
}, 30000)
|
|
121
|
+
|
|
122
|
+
it('renders the search tips under a Back button', async () => {
|
|
123
|
+
const { app, host } = await mountSite('#/how-to-search')
|
|
124
|
+
await vi.waitFor(() => expect(host.textContent).toContain('Boolean Full Text Search'), WAIT)
|
|
125
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-how-to .mwnf-back-link__button')).not.toBeNull()
|
|
126
|
+
app.unmount()
|
|
127
|
+
}, 30000)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function searchTests(mountSite, loadItems) {
|
|
131
|
+
const tile = TILE
|
|
98
132
|
it('returns every renderable object for the all-objects sentinel', async () => {
|
|
99
133
|
const { app, host } = await mountSite('#/search?q=all-objects')
|
|
100
134
|
await vi.waitFor(() => expect(host.querySelector(tile)).not.toBeNull(), WAIT)
|
|
@@ -224,13 +258,17 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
|
|
|
224
258
|
|
|
225
259
|
collectionTest(mountSite, picks.collection, { gallery: true })
|
|
226
260
|
|
|
227
|
-
it(
|
|
261
|
+
it("renders the collection entrance as legacy's", async () => {
|
|
228
262
|
const { app, host } = await mountSite('#/collection')
|
|
229
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
230
|
-
// The country dropdown plus at least one populated
|
|
231
|
-
// the
|
|
232
|
-
|
|
233
|
-
expect(
|
|
263
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-gallery-collection__select')).not.toBeNull(), WAIT)
|
|
264
|
+
// The country dropdown plus at least one populated category, each
|
|
265
|
+
// opening on its name, and the start and end dates with their years.
|
|
266
|
+
const lists = [...host.querySelectorAll('.mwnf-dxa-gallery-collection__select')]
|
|
267
|
+
expect(lists.length).toBeGreaterThan(3)
|
|
268
|
+
for (const list of lists) expect(list.selectedOptions[0]?.disabled).toBe(true)
|
|
269
|
+
const dates = host.querySelectorAll('.mwnf-dxa-gallery-collection__dates select')
|
|
270
|
+
expect(dates).toHaveLength(2)
|
|
271
|
+
expect(dates[0].options.length).toBeGreaterThan(1)
|
|
234
272
|
expect(host.textContent).toContain('this Gallery’s database')
|
|
235
273
|
app.unmount()
|
|
236
274
|
}, 30000)
|
|
@@ -273,6 +311,24 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
|
|
|
273
311
|
app.unmount()
|
|
274
312
|
}, 60000)
|
|
275
313
|
|
|
314
|
+
// On display in (inventory-app#2423): the exhibition pages that show an
|
|
315
|
+
// item, a mini-site's under its project, each an online exhibition's under
|
|
316
|
+
// its title. A package exported before the field has none to show.
|
|
317
|
+
it('lists the exhibition pages that show an item under On display in', async () => {
|
|
318
|
+
const [items] = await loadEntities(['items'])
|
|
319
|
+
const item = items.find((i) => i.exhibition_references?.some((ref) => ref.list !== 'exhibition'))
|
|
320
|
+
?? items.find((i) => i.exhibition_references?.length)
|
|
321
|
+
if (!item) return
|
|
322
|
+
const { app, host } = await mountSite(`#/item/${item.id}`)
|
|
323
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-on-display__caption')).not.toBeNull(), WAIT)
|
|
324
|
+
const lines = [...host.querySelectorAll('.mwnf-on-display__item')].map((li) => li.textContent)
|
|
325
|
+
for (const ref of item.exhibition_references.filter((r) => r.list !== 'exhibition')) {
|
|
326
|
+
const name = ref.exhibition.titles.en ?? Object.values(ref.exhibition.titles)[0]
|
|
327
|
+
if (name) expect(lines.some((line) => line.includes(name))).toBe(true)
|
|
328
|
+
}
|
|
329
|
+
app.unmount()
|
|
330
|
+
}, 60000)
|
|
331
|
+
|
|
276
332
|
outsideReferenceTest(mountSite, manifest, sharedTexts)
|
|
277
333
|
|
|
278
334
|
// The Source box takes the colour `projectColors` gives the item's
|
|
@@ -578,29 +634,39 @@ export function describeExhibitionSmoke({
|
|
|
578
634
|
app.unmount()
|
|
579
635
|
}, 20000)
|
|
580
636
|
|
|
581
|
-
collectionTest(mountSite, collection)
|
|
637
|
+
collectionTest(mountSite, collection, { pager: '.mwnf-dxa-exhibition-pages' })
|
|
582
638
|
|
|
583
|
-
|
|
639
|
+
// Legacy's sheet, the galleries' (inventory-app#2379): Source and My
|
|
640
|
+
// Collection under the pictures, the citation naming the item's project,
|
|
641
|
+
// the related content in the sidebar.
|
|
642
|
+
it('renders the item sheet as legacy', async () => {
|
|
584
643
|
const items = await loadItems()
|
|
585
644
|
const item = items.find((i) => i.project_id) ?? items[0]
|
|
586
645
|
const { app, host } = await mountSite(`#/item/${item.id}`)
|
|
587
646
|
await vi.waitFor(() => expect(host.querySelector('.mwnf-sheet__label')).not.toBeNull(), WAIT)
|
|
588
647
|
expect(host.querySelector('.mwnf-record')).not.toBeNull()
|
|
589
|
-
expect(host.querySelector('.mwnf-dxa-item__languages')).not.toBeNull()
|
|
590
|
-
expect(host.querySelector('.mwnf-sheet-related')).not.toBeNull()
|
|
591
|
-
// Related content is legacy's sidebar, and the record's internal key
|
|
592
|
-
// is never shown.
|
|
648
|
+
expect(host.querySelector('.mwnf-dxa-item__languages .mwnf-languages__button')).not.toBeNull()
|
|
593
649
|
expect(host.querySelector('.mwnf-record__aside .mwnf-sheet-related')).not.toBeNull()
|
|
594
650
|
expect(host.textContent).not.toContain('mwnf3:')
|
|
651
|
+
expect(host.querySelectorAll('.mwnf-record__media .mwnf-dxa-gallery-item__links a')).toHaveLength(2)
|
|
595
652
|
const projectName = manifest.projects?.[item.project_id]?.name?.en
|
|
596
|
-
if (projectName) expect(host.querySelector('.mwnf-
|
|
653
|
+
if (projectName) expect(host.querySelector('.mwnf-dxa-gallery-item__credits').textContent).toContain(projectName)
|
|
597
654
|
// The glossary tool is the layout's own, on every sheet.
|
|
598
655
|
expect(host.querySelector('.mwnf-glossary-tool')).not.toBeNull()
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
656
|
+
expect(host.querySelector('.mwnf-dxa-gallery-item__source a')).not.toBeNull()
|
|
657
|
+
app.unmount()
|
|
658
|
+
}, 60000)
|
|
659
|
+
|
|
660
|
+
// On display in: this exhibition's own pages that show the item open
|
|
661
|
+
// here, as legacy's did.
|
|
662
|
+
it("lists the exhibition's own pages that show an item under On display in", async () => {
|
|
663
|
+
const items = await loadItems()
|
|
664
|
+
const item = items.find((i) => i.exhibition_references?.some((ref) => ref.site === manifest.site?.key))
|
|
665
|
+
if (!item) return
|
|
666
|
+
const { app, host } = await mountSite(`#/item/${item.id}`)
|
|
667
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-on-display__caption')).not.toBeNull(), WAIT)
|
|
668
|
+
const own = item.exhibition_references.find((ref) => ref.site === manifest.site.key)
|
|
669
|
+
expect(host.querySelector(`.mwnf-on-display a[href="#${own.path}"]`)).not.toBeNull()
|
|
604
670
|
app.unmount()
|
|
605
671
|
}, 60000)
|
|
606
672
|
|
|
@@ -644,13 +710,13 @@ export function describeExhibitionSmoke({
|
|
|
644
710
|
app.unmount()
|
|
645
711
|
}, 60000)
|
|
646
712
|
|
|
647
|
-
it(
|
|
713
|
+
it("renders the partners list as legacy's", async () => {
|
|
648
714
|
const partner = (await visiblePartners()).find((p) => partnerNames[p.id]?.name)
|
|
649
715
|
const { app, host } = await mountSite('#/partners')
|
|
650
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
651
|
-
// Country
|
|
652
|
-
expect(host.querySelectorAll('.mwnf-
|
|
653
|
-
expect(host.querySelector('.mwnf-
|
|
716
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-gallery-partners__partner')).not.toBeNull(), WAIT)
|
|
717
|
+
// Country bands, the A-Z / Z-A toggle beside Back.
|
|
718
|
+
expect(host.querySelectorAll('.mwnf-dxa-gallery-partners__country').length).toBeGreaterThan(0)
|
|
719
|
+
expect(host.querySelector('.mwnf-dxa-gallery-partners__order button')).not.toBeNull()
|
|
654
720
|
expect(host.textContent).toContain(partnerNames[partner.id].name)
|
|
655
721
|
app.unmount()
|
|
656
722
|
}, 30000)
|
|
@@ -666,91 +732,85 @@ export function describeExhibitionSmoke({
|
|
|
666
732
|
app.unmount()
|
|
667
733
|
}, 30000)
|
|
668
734
|
|
|
669
|
-
it(
|
|
735
|
+
it("renders a partner's items on legacy's grid", async () => {
|
|
670
736
|
const partner = (await visiblePartners()).find((p) => p.item_count > 0)
|
|
671
737
|
const { app, host } = await mountSite(`#/partner/${partner.id}/objects`)
|
|
672
|
-
await vi.waitFor(() => expect(host.querySelector(
|
|
673
|
-
expect(host.
|
|
738
|
+
await vi.waitFor(() => expect(host.querySelector(TILE)).not.toBeNull(), WAIT)
|
|
739
|
+
expect(host.querySelectorAll(TILE).length).toBeLessThanOrEqual(GALLERY_PAGE)
|
|
740
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-partner-objects__profile a')).not.toBeNull()
|
|
674
741
|
expect(host.textContent).toContain(partnerNames[partner.id]?.name ?? partner.id)
|
|
675
742
|
app.unmount()
|
|
676
743
|
}, 30000)
|
|
677
744
|
|
|
678
|
-
it(
|
|
745
|
+
it("renders the collection entrance as legacy's", async () => {
|
|
679
746
|
const { app, host } = await mountSite('#/collection')
|
|
680
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
681
|
-
expect(host.querySelectorAll('.mwnf-
|
|
682
|
-
expect(host.querySelector('.mwnf-
|
|
683
|
-
expect(host.querySelector('.mwnf-search-form__how-to')).not.toBeNull()
|
|
747
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-exhibition-collection')).not.toBeNull(), WAIT)
|
|
748
|
+
expect(host.querySelectorAll('.mwnf-dxa-exhibition-collection__select').length).toBeGreaterThan(3)
|
|
749
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-collection__dates')).not.toBeNull()
|
|
684
750
|
expect(host.textContent).toContain('Have you already been at')
|
|
685
751
|
app.unmount()
|
|
686
752
|
}, 30000)
|
|
687
753
|
|
|
688
|
-
|
|
754
|
+
exhibitionSearchTests(mountSite, async () => (await loadItems()).find((i) => !i.languages?.length || i.languages.includes('en')))
|
|
689
755
|
|
|
690
|
-
it(
|
|
756
|
+
it("renders the themes list as legacy's", async () => {
|
|
691
757
|
const { app, host } = await mountSite('#/themes')
|
|
692
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
693
|
-
expect(host.querySelectorAll('.mwnf-
|
|
758
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-themes-page__theme')).not.toBeNull(), WAIT)
|
|
759
|
+
expect(host.querySelectorAll('.mwnf-dxa-themes-page__theme').length).toBeGreaterThan(0)
|
|
760
|
+
expect(host.querySelector('.mwnf-dxa-themes-page__show-all')).not.toBeNull()
|
|
694
761
|
app.unmount()
|
|
695
762
|
}, 30000)
|
|
696
763
|
|
|
697
|
-
|
|
764
|
+
// Legacy's ThemeComponent (inventory-app#2379): the thumbnails, the
|
|
765
|
+
// chosen picture and its details, the theme's bar with its numeral, its
|
|
766
|
+
// texts, the tour and "In This Theme".
|
|
767
|
+
it("renders a theme as legacy's", async () => {
|
|
698
768
|
const [, , , themes] = await loadEntities(['exhibition', 'items', 'partners', 'themes'])
|
|
699
769
|
const theme = themePick
|
|
700
770
|
? themes.find((t) => t.id === themePick.id)
|
|
701
771
|
: themes.find((t) => t.display_order > 1) ?? themes[0]
|
|
702
772
|
const { app, host } = await mountSite(`#/theme/${themePick ? themePick.id : theme.display_order - 1}`)
|
|
703
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
expect(host.querySelector('.mwnf-dxa-
|
|
707
|
-
expect(host.querySelector('.mwnf-
|
|
708
|
-
expect(host.querySelector('.mwnf-picture-gallery__selected, .mwnf-picture-gallery__empty')).not.toBeNull()
|
|
709
|
-
expect(host.querySelector('.mwnf-essay__nav')).not.toBeNull()
|
|
710
|
-
// The selected picture's caption is its parent record's label.
|
|
773
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-theme-page__content')).not.toBeNull(), WAIT)
|
|
774
|
+
// The numeral is in the section banner's "Theme I ▪ …", as legacy's SubBanner.
|
|
775
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-banner').textContent).toMatch(/ [IVX]+ ▪ /), WAIT)
|
|
776
|
+
expect(host.querySelector('.mwnf-dxa-theme-page__selected, .mwnf-dxa-theme-page__empty')).not.toBeNull()
|
|
777
|
+
expect(host.querySelector('.mwnf-dxa-theme-page__tour')).not.toBeNull()
|
|
711
778
|
if (themePick?.pictureTitle) {
|
|
712
|
-
expect(host.querySelector('.mwnf-
|
|
713
|
-
} else {
|
|
714
|
-
expect(host.querySelector('.mwnf-picture-gallery__detail--title, .mwnf-picture-gallery__empty')).not.toBeNull()
|
|
779
|
+
expect(host.querySelector('.mwnf-dxa-theme-page__details').textContent).toContain(themePick.pictureTitle)
|
|
715
780
|
}
|
|
716
|
-
const
|
|
717
|
-
for (const title of themePick?.subthemes ?? []) expect(
|
|
718
|
-
if (subNav) expect(subNav.textContent.trim().length).toBeGreaterThan(0)
|
|
781
|
+
const inThisTheme = host.querySelector('.mwnf-dxa-theme-page__links')
|
|
782
|
+
for (const title of themePick?.subthemes ?? []) expect(inThisTheme.textContent).toContain(title)
|
|
719
783
|
// The texts are read through the tree's own entity: a wrong one renders
|
|
720
784
|
// internal names or nothing.
|
|
721
|
-
const
|
|
722
|
-
expect(
|
|
723
|
-
|
|
724
|
-
if (title && theme) expect(title.textContent).not.toBe(theme.internal_name)
|
|
725
|
-
const creditLink = host.querySelector('.mwnf-source-credit a')
|
|
726
|
-
expect(creditLink).not.toBeNull()
|
|
727
|
-
expect(creditLink.textContent.startsWith(config.site.origin)).toBe(true)
|
|
785
|
+
const title = host.querySelector('.mwnf-dxa-theme-page__title')
|
|
786
|
+
expect(title?.textContent?.trim()).toBeTruthy()
|
|
787
|
+
if (theme) expect(title.textContent).not.toBe(theme.internal_name)
|
|
728
788
|
app.unmount()
|
|
729
789
|
}, 30000)
|
|
730
790
|
|
|
731
|
-
it(
|
|
791
|
+
it("renders a theme's gallery on legacy's grid", async () => {
|
|
732
792
|
const { app, host } = await mountSite('#/theme-gallery/1')
|
|
733
|
-
await vi.waitFor(() => expect(host.querySelector(
|
|
734
|
-
expect(host.querySelector('.mwnf-
|
|
793
|
+
await vi.waitFor(() => expect(host.querySelector(TILE)).not.toBeNull(), WAIT)
|
|
794
|
+
expect(host.querySelector('.mwnf-dxa-theme-gallery-page')).not.toBeNull()
|
|
735
795
|
app.unmount()
|
|
736
796
|
}, 30000)
|
|
737
797
|
|
|
738
|
-
|
|
798
|
+
// The timeline pages as legacy's (inventory-app#2379). An exhibition
|
|
799
|
+
// without a chronology keeps the pages reachable by address, empty.
|
|
800
|
+
const EVENT = '.mwnf-dxa-exhibition-timeline-results__event'
|
|
801
|
+
it("renders the timeline entrance as legacy's form", async () => {
|
|
739
802
|
const { app, host } = await mountSite('#/timeline')
|
|
740
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
741
|
-
expect(host.querySelector('.mwnf-
|
|
742
|
-
|
|
743
|
-
expect(host.querySelector('.mwnf-timeline__row')).toBeNull()
|
|
744
|
-
expect(host.querySelector('.mwnf-summary')).toBeNull()
|
|
803
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-timeline__dates')).not.toBeNull(), WAIT)
|
|
804
|
+
expect(host.querySelector('.mwnf-dxa-timeline__go button')).not.toBeNull()
|
|
805
|
+
expect(host.querySelector(EVENT)).toBeNull()
|
|
745
806
|
expect(host.textContent).toContain('Have you already been at')
|
|
746
807
|
app.unmount()
|
|
747
808
|
}, 30000)
|
|
748
809
|
|
|
749
|
-
it(
|
|
810
|
+
it("renders the timeline results as legacy's", async () => {
|
|
750
811
|
const { app, host } = await mountSite('#/timeline-results')
|
|
751
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
752
|
-
expect(host.querySelector('.mwnf-timeline')).
|
|
753
|
-
expect(host.textContent).toContain('Events found')
|
|
812
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-exhibition-timeline-results__band')).not.toBeNull(), WAIT)
|
|
813
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-timeline-results__current').textContent).toContain('Results')
|
|
754
814
|
app.unmount()
|
|
755
815
|
}, 30000)
|
|
756
816
|
|
|
@@ -759,19 +819,23 @@ export function describeExhibitionSmoke({
|
|
|
759
819
|
const { app, host } = await mountSite(
|
|
760
820
|
`#/timeline-results?country=${dated.country_id}&begin=${dated.start_date}&end=${dated.end_date ?? dated.start_date}`,
|
|
761
821
|
)
|
|
762
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
763
|
-
|
|
822
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-exhibition-timeline-results__body')).not.toBeNull(), WAIT)
|
|
823
|
+
// Legacy offered the box only beside events.
|
|
824
|
+
if (host.querySelector(EVENT)) {
|
|
825
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-exhibition-timeline-results__related a')).not.toBeNull(), WAIT)
|
|
826
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-timeline-results__related').textContent).toContain('See Gallery')
|
|
827
|
+
}
|
|
764
828
|
app.unmount()
|
|
765
829
|
}, 30000)
|
|
766
830
|
|
|
767
|
-
it(
|
|
831
|
+
it("renders the timeline gallery on legacy's grid", async () => {
|
|
768
832
|
const dated = await datedItem()
|
|
769
833
|
const { app, host } = await mountSite(
|
|
770
834
|
`#/timeline/gallery?country=${dated.country_id}&begin=${dated.start_date}&end=${dated.end_date ?? dated.start_date}`,
|
|
771
835
|
)
|
|
772
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-catalogue')).not.toBeNull(), WAIT)
|
|
773
836
|
// The item that seeded the query overlaps its own period.
|
|
774
|
-
expect(host.querySelector(
|
|
837
|
+
await vi.waitFor(() => expect(host.querySelector(TILE)).not.toBeNull(), WAIT)
|
|
838
|
+
expect(host.querySelector('.mwnf-dxa-exhibition-timeline-gallery')).not.toBeNull()
|
|
775
839
|
app.unmount()
|
|
776
840
|
}, 30000)
|
|
777
841
|
|
|
@@ -782,39 +846,31 @@ export function describeExhibitionSmoke({
|
|
|
782
846
|
if (!greek) return
|
|
783
847
|
const period = `begin=${greek.start_date}&end=${greek.end_date ?? greek.start_date}`
|
|
784
848
|
const byId = await mountSite(`#/timeline-results?country=grc&${period}`)
|
|
785
|
-
await vi.waitFor(() => expect(byId.host.querySelector('.mwnf-
|
|
849
|
+
await vi.waitFor(() => expect(byId.host.querySelector('.mwnf-dxa-exhibition-timeline-results__body')).not.toBeNull(), WAIT)
|
|
786
850
|
const byCode = await mountSite(`#/timeline-results?country=gr&${period}`)
|
|
787
|
-
await vi.waitFor(() => expect(byCode.host.querySelector('.mwnf-
|
|
788
|
-
expect(byId.host.querySelectorAll(
|
|
789
|
-
const galleryId = byId.host.querySelector('.mwnf-
|
|
790
|
-
const galleryCode = byCode.host.querySelector('.mwnf-
|
|
851
|
+
await vi.waitFor(() => expect(byCode.host.querySelector('.mwnf-dxa-exhibition-timeline-results__body')).not.toBeNull(), WAIT)
|
|
852
|
+
expect(byId.host.querySelectorAll(EVENT).length).toBe(byCode.host.querySelectorAll(EVENT).length)
|
|
853
|
+
const galleryId = byId.host.querySelector('.mwnf-dxa-exhibition-timeline-results__related a')
|
|
854
|
+
const galleryCode = byCode.host.querySelector('.mwnf-dxa-exhibition-timeline-results__related a')
|
|
791
855
|
if (galleryId && galleryCode) expect(galleryId.textContent).toBe(galleryCode.textContent)
|
|
792
|
-
const firstRow = byId.host.querySelector('.mwnf-timeline__row')
|
|
793
|
-
if (firstRow) expect(firstRow.textContent).toContain('Greece')
|
|
794
856
|
byId.app.unmount()
|
|
795
857
|
byCode.app.unmount()
|
|
796
858
|
}, 60000)
|
|
797
859
|
|
|
798
|
-
it(
|
|
860
|
+
it("renders the related content as legacy's", async () => {
|
|
799
861
|
const { app, host } = await mountSite('#/related')
|
|
800
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
862
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-related-page')).not.toBeNull(), WAIT)
|
|
801
863
|
if (relatedContent) {
|
|
802
|
-
expect(host.
|
|
803
|
-
expect(host.querySelectorAll('.mwnf-link-list__item').length).toBeGreaterThan(0)
|
|
804
|
-
} else {
|
|
805
|
-
expect(host.querySelector('.mwnf-link-list__groups, .mwnf-link-list__empty')).not.toBeNull()
|
|
864
|
+
await vi.waitFor(() => expect(host.querySelectorAll('.mwnf-dxa-related-page__entry').length).toBeGreaterThan(0), WAIT)
|
|
806
865
|
}
|
|
807
866
|
app.unmount()
|
|
808
867
|
}, 30000)
|
|
809
868
|
|
|
810
|
-
|
|
869
|
+
// Legacy's AboutPage is its ThemeComponent on the About theme.
|
|
870
|
+
it("renders about as legacy's theme page", async () => {
|
|
811
871
|
const { app, host } = await mountSite('#/about')
|
|
812
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
813
|
-
expect(host.querySelector('.mwnf-
|
|
814
|
-
// About mode keeps legacy's picture column (the About theme's pictures
|
|
815
|
-
// and their captions) and drops the tour and the picture narrative.
|
|
816
|
-
expect(host.querySelector('.mwnf-essay__side .mwnf-picture-gallery')).not.toBeNull()
|
|
817
|
-
expect(host.querySelector('.mwnf-picture-narrative')).toBeNull()
|
|
872
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-about .mwnf-dxa-theme-page__content')).not.toBeNull(), WAIT)
|
|
873
|
+
expect(host.querySelector('.mwnf-dxa-theme-page__selected, .mwnf-dxa-theme-page__empty')).not.toBeNull()
|
|
818
874
|
expect(host.textContent).toContain(config.siteName)
|
|
819
875
|
app.unmount()
|
|
820
876
|
}, 30000)
|