@museumwnf/viewer-layout 3.62.0 → 3.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FeaturedRecord-Fe19w6_G.js +213 -0
- package/dist/LegacyItemSheet-Bmg8etGz.js +532 -0
- package/dist/{OnDisplayIn-CPANKcOd.js → OnDisplayIn-BH3Bqope.js} +1 -1
- 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/dxa.js +1982 -1042
- 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 +147 -114
- package/src/styles/dxa-exhibition.css +2292 -32
- package/dist/FeaturedRecord-DaGLHyhD.js +0 -87
- package/dist/ItemDetailView-BcOSmHfr.js +0 -313
- package/dist/RecordView-BE4mbj6G.js +0 -363
- package/dist/Theme-4RmyRY0x.js +0 -318
- package/dist/TimelineResultsView-CkH3NDqL.js +0 -1401
- 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.1",
|
|
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,40 +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
|
-
|
|
82
|
-
const count = host.querySelector(gallery ? '.mwnf-dxa-gallery-results__info p + p' : '.mwnf-summary__count')
|
|
79
|
+
const count = host.querySelector('.mwnf-dxa-gallery-results__info p + p')
|
|
83
80
|
expect(count).not.toBeNull()
|
|
84
81
|
const objects = Number(count.textContent.match(/\d+/)?.[0] ?? NaN)
|
|
85
|
-
|
|
86
|
-
const paginations = host.querySelectorAll(
|
|
87
|
-
if (
|
|
88
|
-
else
|
|
89
|
-
else expect(tiles).toBeGreaterThan(0)
|
|
90
|
-
if (gallery && objects <= GALLERY_PAGE) expect(paginations).toBe(0)
|
|
91
|
-
else if (collection.paginations) expect(paginations).toBe(collection.paginations)
|
|
92
|
-
else expect(paginations).toBeGreaterThan(0)
|
|
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)
|
|
93
86
|
app.unmount()
|
|
94
87
|
}, 60000)
|
|
95
88
|
}
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
99
132
|
it('returns every renderable object for the all-objects sentinel', async () => {
|
|
100
133
|
const { app, host } = await mountSite('#/search?q=all-objects')
|
|
101
134
|
await vi.waitFor(() => expect(host.querySelector(tile)).not.toBeNull(), WAIT)
|
|
@@ -601,29 +634,39 @@ export function describeExhibitionSmoke({
|
|
|
601
634
|
app.unmount()
|
|
602
635
|
}, 20000)
|
|
603
636
|
|
|
604
|
-
collectionTest(mountSite, collection)
|
|
637
|
+
collectionTest(mountSite, collection, { pager: '.mwnf-dxa-exhibition-pages' })
|
|
605
638
|
|
|
606
|
-
|
|
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 () => {
|
|
607
643
|
const items = await loadItems()
|
|
608
644
|
const item = items.find((i) => i.project_id) ?? items[0]
|
|
609
645
|
const { app, host } = await mountSite(`#/item/${item.id}`)
|
|
610
646
|
await vi.waitFor(() => expect(host.querySelector('.mwnf-sheet__label')).not.toBeNull(), WAIT)
|
|
611
647
|
expect(host.querySelector('.mwnf-record')).not.toBeNull()
|
|
612
|
-
expect(host.querySelector('.mwnf-dxa-item__languages')).not.toBeNull()
|
|
613
|
-
expect(host.querySelector('.mwnf-sheet-related')).not.toBeNull()
|
|
614
|
-
// Related content is legacy's sidebar, and the record's internal key
|
|
615
|
-
// is never shown.
|
|
648
|
+
expect(host.querySelector('.mwnf-dxa-item__languages .mwnf-languages__button')).not.toBeNull()
|
|
616
649
|
expect(host.querySelector('.mwnf-record__aside .mwnf-sheet-related')).not.toBeNull()
|
|
617
650
|
expect(host.textContent).not.toContain('mwnf3:')
|
|
651
|
+
expect(host.querySelectorAll('.mwnf-record__media .mwnf-dxa-gallery-item__links a')).toHaveLength(2)
|
|
618
652
|
const projectName = manifest.projects?.[item.project_id]?.name?.en
|
|
619
|
-
if (projectName) expect(host.querySelector('.mwnf-
|
|
653
|
+
if (projectName) expect(host.querySelector('.mwnf-dxa-gallery-item__credits').textContent).toContain(projectName)
|
|
620
654
|
// The glossary tool is the layout's own, on every sheet.
|
|
621
655
|
expect(host.querySelector('.mwnf-glossary-tool')).not.toBeNull()
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
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()
|
|
627
670
|
app.unmount()
|
|
628
671
|
}, 60000)
|
|
629
672
|
|
|
@@ -667,13 +710,13 @@ export function describeExhibitionSmoke({
|
|
|
667
710
|
app.unmount()
|
|
668
711
|
}, 60000)
|
|
669
712
|
|
|
670
|
-
it(
|
|
713
|
+
it("renders the partners list as legacy's", async () => {
|
|
671
714
|
const partner = (await visiblePartners()).find((p) => partnerNames[p.id]?.name)
|
|
672
715
|
const { app, host } = await mountSite('#/partners')
|
|
673
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
674
|
-
// Country
|
|
675
|
-
expect(host.querySelectorAll('.mwnf-
|
|
676
|
-
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()
|
|
677
720
|
expect(host.textContent).toContain(partnerNames[partner.id].name)
|
|
678
721
|
app.unmount()
|
|
679
722
|
}, 30000)
|
|
@@ -689,91 +732,85 @@ export function describeExhibitionSmoke({
|
|
|
689
732
|
app.unmount()
|
|
690
733
|
}, 30000)
|
|
691
734
|
|
|
692
|
-
it(
|
|
735
|
+
it("renders a partner's items on legacy's grid", async () => {
|
|
693
736
|
const partner = (await visiblePartners()).find((p) => p.item_count > 0)
|
|
694
737
|
const { app, host } = await mountSite(`#/partner/${partner.id}/objects`)
|
|
695
|
-
await vi.waitFor(() => expect(host.querySelector(
|
|
696
|
-
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()
|
|
697
741
|
expect(host.textContent).toContain(partnerNames[partner.id]?.name ?? partner.id)
|
|
698
742
|
app.unmount()
|
|
699
743
|
}, 30000)
|
|
700
744
|
|
|
701
|
-
it(
|
|
745
|
+
it("renders the collection entrance as legacy's", async () => {
|
|
702
746
|
const { app, host } = await mountSite('#/collection')
|
|
703
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
704
|
-
expect(host.querySelectorAll('.mwnf-
|
|
705
|
-
expect(host.querySelector('.mwnf-
|
|
706
|
-
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()
|
|
707
750
|
expect(host.textContent).toContain('Have you already been at')
|
|
708
751
|
app.unmount()
|
|
709
752
|
}, 30000)
|
|
710
753
|
|
|
711
|
-
|
|
754
|
+
exhibitionSearchTests(mountSite, async () => (await loadItems()).find((i) => !i.languages?.length || i.languages.includes('en')))
|
|
712
755
|
|
|
713
|
-
it(
|
|
756
|
+
it("renders the themes list as legacy's", async () => {
|
|
714
757
|
const { app, host } = await mountSite('#/themes')
|
|
715
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
716
|
-
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()
|
|
717
761
|
app.unmount()
|
|
718
762
|
}, 30000)
|
|
719
763
|
|
|
720
|
-
|
|
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 () => {
|
|
721
768
|
const [, , , themes] = await loadEntities(['exhibition', 'items', 'partners', 'themes'])
|
|
722
769
|
const theme = themePick
|
|
723
770
|
? themes.find((t) => t.id === themePick.id)
|
|
724
771
|
: themes.find((t) => t.display_order > 1) ?? themes[0]
|
|
725
772
|
const { app, host } = await mountSite(`#/theme/${themePick ? themePick.id : theme.display_order - 1}`)
|
|
726
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
expect(host.querySelector('.mwnf-dxa-
|
|
730
|
-
expect(host.querySelector('.mwnf-
|
|
731
|
-
expect(host.querySelector('.mwnf-picture-gallery__selected, .mwnf-picture-gallery__empty')).not.toBeNull()
|
|
732
|
-
expect(host.querySelector('.mwnf-essay__nav')).not.toBeNull()
|
|
733
|
-
// 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()
|
|
734
778
|
if (themePick?.pictureTitle) {
|
|
735
|
-
expect(host.querySelector('.mwnf-
|
|
736
|
-
} else {
|
|
737
|
-
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)
|
|
738
780
|
}
|
|
739
|
-
const
|
|
740
|
-
for (const title of themePick?.subthemes ?? []) expect(
|
|
741
|
-
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)
|
|
742
783
|
// The texts are read through the tree's own entity: a wrong one renders
|
|
743
784
|
// internal names or nothing.
|
|
744
|
-
const
|
|
745
|
-
expect(
|
|
746
|
-
|
|
747
|
-
if (title && theme) expect(title.textContent).not.toBe(theme.internal_name)
|
|
748
|
-
const creditLink = host.querySelector('.mwnf-source-credit a')
|
|
749
|
-
expect(creditLink).not.toBeNull()
|
|
750
|
-
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)
|
|
751
788
|
app.unmount()
|
|
752
789
|
}, 30000)
|
|
753
790
|
|
|
754
|
-
it(
|
|
791
|
+
it("renders a theme's gallery on legacy's grid", async () => {
|
|
755
792
|
const { app, host } = await mountSite('#/theme-gallery/1')
|
|
756
|
-
await vi.waitFor(() => expect(host.querySelector(
|
|
757
|
-
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()
|
|
758
795
|
app.unmount()
|
|
759
796
|
}, 30000)
|
|
760
797
|
|
|
761
|
-
|
|
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 () => {
|
|
762
802
|
const { app, host } = await mountSite('#/timeline')
|
|
763
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
764
|
-
expect(host.querySelector('.mwnf-
|
|
765
|
-
|
|
766
|
-
expect(host.querySelector('.mwnf-timeline__row')).toBeNull()
|
|
767
|
-
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()
|
|
768
806
|
expect(host.textContent).toContain('Have you already been at')
|
|
769
807
|
app.unmount()
|
|
770
808
|
}, 30000)
|
|
771
809
|
|
|
772
|
-
it(
|
|
810
|
+
it("renders the timeline results as legacy's", async () => {
|
|
773
811
|
const { app, host } = await mountSite('#/timeline-results')
|
|
774
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
775
|
-
expect(host.querySelector('.mwnf-timeline')).
|
|
776
|
-
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')
|
|
777
814
|
app.unmount()
|
|
778
815
|
}, 30000)
|
|
779
816
|
|
|
@@ -782,19 +819,23 @@ export function describeExhibitionSmoke({
|
|
|
782
819
|
const { app, host } = await mountSite(
|
|
783
820
|
`#/timeline-results?country=${dated.country_id}&begin=${dated.start_date}&end=${dated.end_date ?? dated.start_date}`,
|
|
784
821
|
)
|
|
785
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
786
|
-
|
|
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
|
+
}
|
|
787
828
|
app.unmount()
|
|
788
829
|
}, 30000)
|
|
789
830
|
|
|
790
|
-
it(
|
|
831
|
+
it("renders the timeline gallery on legacy's grid", async () => {
|
|
791
832
|
const dated = await datedItem()
|
|
792
833
|
const { app, host } = await mountSite(
|
|
793
834
|
`#/timeline/gallery?country=${dated.country_id}&begin=${dated.start_date}&end=${dated.end_date ?? dated.start_date}`,
|
|
794
835
|
)
|
|
795
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-catalogue')).not.toBeNull(), WAIT)
|
|
796
836
|
// The item that seeded the query overlaps its own period.
|
|
797
|
-
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()
|
|
798
839
|
app.unmount()
|
|
799
840
|
}, 30000)
|
|
800
841
|
|
|
@@ -805,39 +846,31 @@ export function describeExhibitionSmoke({
|
|
|
805
846
|
if (!greek) return
|
|
806
847
|
const period = `begin=${greek.start_date}&end=${greek.end_date ?? greek.start_date}`
|
|
807
848
|
const byId = await mountSite(`#/timeline-results?country=grc&${period}`)
|
|
808
|
-
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)
|
|
809
850
|
const byCode = await mountSite(`#/timeline-results?country=gr&${period}`)
|
|
810
|
-
await vi.waitFor(() => expect(byCode.host.querySelector('.mwnf-
|
|
811
|
-
expect(byId.host.querySelectorAll(
|
|
812
|
-
const galleryId = byId.host.querySelector('.mwnf-
|
|
813
|
-
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')
|
|
814
855
|
if (galleryId && galleryCode) expect(galleryId.textContent).toBe(galleryCode.textContent)
|
|
815
|
-
const firstRow = byId.host.querySelector('.mwnf-timeline__row')
|
|
816
|
-
if (firstRow) expect(firstRow.textContent).toContain('Greece')
|
|
817
856
|
byId.app.unmount()
|
|
818
857
|
byCode.app.unmount()
|
|
819
858
|
}, 60000)
|
|
820
859
|
|
|
821
|
-
it(
|
|
860
|
+
it("renders the related content as legacy's", async () => {
|
|
822
861
|
const { app, host } = await mountSite('#/related')
|
|
823
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
862
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-related-page')).not.toBeNull(), WAIT)
|
|
824
863
|
if (relatedContent) {
|
|
825
|
-
expect(host.
|
|
826
|
-
expect(host.querySelectorAll('.mwnf-link-list__item').length).toBeGreaterThan(0)
|
|
827
|
-
} else {
|
|
828
|
-
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)
|
|
829
865
|
}
|
|
830
866
|
app.unmount()
|
|
831
867
|
}, 30000)
|
|
832
868
|
|
|
833
|
-
|
|
869
|
+
// Legacy's AboutPage is its ThemeComponent on the About theme.
|
|
870
|
+
it("renders about as legacy's theme page", async () => {
|
|
834
871
|
const { app, host } = await mountSite('#/about')
|
|
835
|
-
await vi.waitFor(() => expect(host.querySelector('.mwnf-
|
|
836
|
-
expect(host.querySelector('.mwnf-
|
|
837
|
-
// About mode keeps legacy's picture column (the About theme's pictures
|
|
838
|
-
// and their captions) and drops the tour and the picture narrative.
|
|
839
|
-
expect(host.querySelector('.mwnf-essay__side .mwnf-picture-gallery')).not.toBeNull()
|
|
840
|
-
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()
|
|
841
874
|
expect(host.textContent).toContain(config.siteName)
|
|
842
875
|
app.unmount()
|
|
843
876
|
}, 30000)
|