@museumwnf/viewer-layout 3.66.0 → 3.66.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.66.0",
3
+ "version": "3.66.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",
@@ -11,6 +11,11 @@
11
11
  // package resolve from the site.
12
12
  import { describe, expect, it, vi } from 'vitest'
13
13
  import { loadEntities, mergeMessages } from '@museumwnf/viewer-core'
14
+ import * as viewerCore from '@museumwnf/viewer-core'
15
+
16
+ // A link to a legacy site that has a new one is drawn with the new site's
17
+ // address from viewer-core 2.18.0 on (inventory-app#2482), as stored before.
18
+ const drawnAs = (url) => (url && typeof viewerCore.toNewSite === 'function' ? viewerCore.toNewSite(url) : url)
14
19
  import {
15
20
  checkOfferedLanguages, checkRoutes, checkSectionMeta, checkTextsRendered, mountSite as mountOn,
16
21
  } from '@museumwnf/viewer-core/testing'
@@ -396,10 +401,10 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
396
401
 
397
402
  expect(project.related_database_url).toBeTruthy()
398
403
  expect(host.textContent).toContain('Search Related Database')
399
- expect(links().some((a) => a.getAttribute('href') === project.related_database_url)).toBe(true)
404
+ expect(links().some((a) => a.getAttribute('href') === drawnAs(project.related_database_url))).toBe(true)
400
405
  if (project.artistic_introduction_url) {
401
406
  expect(host.textContent).toContain('Artistic Introduction')
402
- expect(links().some((a) => a.getAttribute('href') === project.artistic_introduction_url)).toBe(true)
407
+ expect(links().some((a) => a.getAttribute('href') === drawnAs(project.artistic_introduction_url))).toBe(true)
403
408
  } else {
404
409
  expect(host.textContent).not.toContain('Artistic Introduction')
405
410
  }
@@ -718,8 +723,8 @@ export function describeExhibitionSmoke({
718
723
  const project = manifest.projects[item.project_id]
719
724
  const { app, host } = await mountSite(`#/item/${item.id}`)
720
725
  await vi.waitFor(() => expect(host.querySelector('.mwnf-sheet-related')).not.toBeNull(), WAIT)
721
- expect(!!host.querySelector(`a[href="${project.related_database_url}"]`)).toBe(!!project.related_database_url)
722
- expect(!!host.querySelector(`a[href="${project.artistic_introduction_url}"]`)).toBe(!!project.artistic_introduction_url)
726
+ expect(!!host.querySelector(`a[href="${drawnAs(project.related_database_url)}"]`)).toBe(!!project.related_database_url)
727
+ expect(!!host.querySelector(`a[href="${drawnAs(project.artistic_introduction_url)}"]`)).toBe(!!project.artistic_introduction_url)
723
728
  expect(!!host.querySelector('.mwnf-sheet-notice')).toBe(noticeProjects.includes(item.project_id))
724
729
  // Every project needs its chip colour, or the chip falls back to the
725
730
  // layout's default swatch.