@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.62.0",
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",
@@ -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
- // An exhibition's tiles: the platform's record grid, nine a page.
66
- const EXHIBITION_TILE = '.mwnf-grid__tile'
67
-
68
- // The collection results: the tiles, the "filter further by" column, the
69
- // summary and the page links. A gallery's first page holds twenty tiles, or
70
- // every object when there are fewer, and offers page links only when there
71
- // is a second page, as legacy; a site may pin its count of page links.
72
- // (A gallery's `collection.tiles` is no longer read: it counted the old nine
73
- // a page. An exhibition may still pin its own.)
74
- function collectionTest(mountSite, collection = {}, { gallery = false } = {}) {
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(tile)).not.toBeNull(), WAIT)
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
- // A gallery prints legacy's "<n> result(s) out of <total> objects".
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
- const tiles = host.querySelectorAll(tile).length
86
- const paginations = host.querySelectorAll('.mwnf-pagination').length
87
- if (gallery) expect(tiles).toBe(firstPage(objects))
88
- else if (collection.tiles) expect(tiles).toBe(collection.tiles)
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
- function searchTests(mountSite, loadItems, { gallery = false } = {}) {
98
- const tile = gallery ? TILE : EXHIBITION_TILE
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
- it('renders the item sheet on the composed record view', async () => {
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-sheet-source__line').textContent).toContain(projectName)
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
- // The source credit: origin plus this item's route.
623
- const creditLink = host.querySelector('.mwnf-source-credit a')
624
- expect(creditLink).not.toBeNull()
625
- expect(creditLink.textContent.startsWith(config.site.origin)).toBe(true)
626
- expect(creditLink.textContent.endsWith(`#/item/${item.id}`)).toBe(true)
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('renders the partners list on the composed list view', async () => {
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-partner-list')).not.toBeNull(), WAIT)
674
- // Country groups, all open, and the A-Z / Z-A toggle.
675
- expect(host.querySelectorAll('.mwnf-partner-list__group-heading').length).toBeGreaterThan(0)
676
- expect(host.querySelector('.mwnf-partner-list__toggle-button')).not.toBeNull()
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('renders a partner objects page on the composed results view', async () => {
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('.mwnf-grid__tile')).not.toBeNull(), WAIT)
696
- expect(host.querySelector('.mwnf-catalogue')).not.toBeNull()
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('renders the collection entrance on the composed search form view', async () => {
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-search-form')).not.toBeNull(), WAIT)
704
- expect(host.querySelectorAll('.mwnf-search-form .mwnf-facet').length).toBeGreaterThan(1)
705
- expect(host.querySelector('.mwnf-search-form__dates')).not.toBeNull()
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
- searchTests(mountSite, async () => (await loadItems()).find((i) => !i.languages?.length || i.languages.includes('en')))
754
+ exhibitionSearchTests(mountSite, async () => (await loadItems()).find((i) => !i.languages?.length || i.languages.includes('en')))
712
755
 
713
- it('renders the themes list on the composed accordion', async () => {
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-cards--accordion')).not.toBeNull(), WAIT)
716
- expect(host.querySelectorAll('.mwnf-cards__details').length).toBeGreaterThan(0)
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
- it('renders a theme on the composed essay view', async () => {
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-essay')).not.toBeNull(), WAIT)
727
- expect(host.querySelector('.mwnf-essay').className).not.toContain('mwnf-essay--about')
728
- // The Roman label beside the theme's own title.
729
- expect(host.querySelector('.mwnf-dxa-theme__heading').textContent).toMatch(/[IVX]/)
730
- expect(host.querySelector('.mwnf-essay__side')).not.toBeNull()
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-picture-gallery__detail--title').textContent).toContain(themePick.pictureTitle)
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 subNav = host.querySelector('.mwnf-dxa-theme__subthemes')
740
- for (const title of themePick?.subthemes ?? []) expect(subNav.textContent).toContain(title)
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 prose = host.querySelector('.mwnf-essay__prose, .mwnf-essay__body')
745
- expect(prose?.textContent?.trim()).toBeTruthy()
746
- const title = host.querySelector('.mwnf-essay__title')
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('renders the theme gallery on the composed results view', async () => {
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('.mwnf-grid__tile')).not.toBeNull(), WAIT)
757
- expect(host.querySelector('.mwnf-catalogue')).not.toBeNull()
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
- it('renders the timeline entrance on the composed timeline view, as a form', async () => {
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-timeline')).not.toBeNull(), WAIT)
764
- expect(host.querySelector('.mwnf-timeline__filters')).not.toBeNull()
765
- // The entrance renders the form alone: no results row, no summary.
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('renders the timeline results on the composed timeline view', async () => {
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-summary')).not.toBeNull(), WAIT)
775
- expect(host.querySelector('.mwnf-timeline')).not.toBeNull()
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-timeline__gallery')).not.toBeNull(), WAIT)
786
- expect(host.querySelector('.mwnf-timeline__gallery').textContent).toContain('See Gallery')
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('renders the timeline gallery on the composed results view', async () => {
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('.mwnf-grid__tile')).not.toBeNull()
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-summary')).not.toBeNull(), WAIT)
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-summary')).not.toBeNull(), WAIT)
811
- expect(byId.host.querySelectorAll('.mwnf-timeline__row').length).toBe(byCode.host.querySelectorAll('.mwnf-timeline__row').length)
812
- const galleryId = byId.host.querySelector('.mwnf-timeline__gallery')
813
- const galleryCode = byCode.host.querySelector('.mwnf-timeline__gallery')
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('renders the related content on the composed link list', async () => {
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-link-list')).not.toBeNull(), WAIT)
862
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-related-page')).not.toBeNull(), WAIT)
824
863
  if (relatedContent) {
825
- expect(host.querySelector('.mwnf-link-list__groups')).not.toBeNull()
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
- it('renders about on the composed essay view, in about mode', async () => {
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-essay')).not.toBeNull(), WAIT)
836
- expect(host.querySelector('.mwnf-essay').className).toContain('mwnf-essay--about')
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)