@museumwnf/viewer-layout 3.70.1 → 3.72.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/README.md +47 -27
- package/dist/TimelineResultsView-Bn4rC_Se.js +614 -0
- package/dist/dxa.js +507 -487
- package/dist/minisite.js +837 -735
- package/dist/standalone.js +57 -32
- package/dist/views.js +1 -1
- package/package.json +6 -4
- package/src/minisite/testing.js +281 -0
- package/dist/TimelineResultsView-BF3VoCs_.js +0 -686
package/dist/standalone.js
CHANGED
|
@@ -1794,11 +1794,15 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
1794
1794
|
props: {
|
|
1795
1795
|
labels: {
|
|
1796
1796
|
type: Object,
|
|
1797
|
-
|
|
1797
|
+
default: null
|
|
1798
|
+
},
|
|
1799
|
+
texts: {
|
|
1800
|
+
type: String,
|
|
1801
|
+
default: ""
|
|
1798
1802
|
},
|
|
1799
1803
|
alerts: {
|
|
1800
1804
|
type: Object,
|
|
1801
|
-
default:
|
|
1805
|
+
default: null
|
|
1802
1806
|
},
|
|
1803
1807
|
countries: {
|
|
1804
1808
|
type: Array,
|
|
@@ -1815,48 +1819,60 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
1815
1819
|
},
|
|
1816
1820
|
emits: ["search"],
|
|
1817
1821
|
setup(e, { emit: t }) {
|
|
1818
|
-
let n = e, r = t, i =
|
|
1822
|
+
let n = e, r = t, i = n.texts ? q().t : (e) => e, a = (e) => i(`${n.texts}.${e}`), o = l(() => n.labels ?? {
|
|
1823
|
+
selectCountry: a("tl.selectCountry"),
|
|
1824
|
+
allCountries: a("tl.allCountries"),
|
|
1825
|
+
startDate: a("tl.startDate"),
|
|
1826
|
+
endDate: a("tl.endDate"),
|
|
1827
|
+
go: a("db.go")
|
|
1828
|
+
}), s = l(() => n.alerts ?? (n.texts ? {
|
|
1829
|
+
country: a("tl.alertCountry"),
|
|
1830
|
+
countryOrDates: a("tl.alertCountryOrDates"),
|
|
1831
|
+
startDate: a("tl.alertStartDate"),
|
|
1832
|
+
endDate: a("tl.alertEndDate"),
|
|
1833
|
+
period: a("tl.alertPeriod")
|
|
1834
|
+
} : {})), u = E({
|
|
1819
1835
|
country: "none",
|
|
1820
1836
|
start: "none",
|
|
1821
1837
|
end: "none"
|
|
1822
1838
|
});
|
|
1823
|
-
function
|
|
1824
|
-
return
|
|
1839
|
+
function d() {
|
|
1840
|
+
return u.country === "none" ? s.value.country : u.country === "" ? u.start === "none" && u.end === "none" ? s.value.countryOrDates : u.start === "none" ? s.value.startDate : u.end === "none" ? s.value.endDate : Number(u.start) > Number(u.end) ? s.value.period : "" : "";
|
|
1825
1841
|
}
|
|
1826
|
-
function
|
|
1827
|
-
let e =
|
|
1828
|
-
e ? window.alert(e) : r("search", { ...
|
|
1842
|
+
function m() {
|
|
1843
|
+
let e = d();
|
|
1844
|
+
e ? window.alert(e) : r("search", { ...u });
|
|
1829
1845
|
}
|
|
1830
1846
|
return (t, n) => (T(), f("form", {
|
|
1831
1847
|
class: "mwnf-standalone-tle",
|
|
1832
|
-
onSubmit: V(
|
|
1848
|
+
onSubmit: V(m, ["prevent"])
|
|
1833
1849
|
}, [
|
|
1834
1850
|
p("p", ri, [B(p("select", {
|
|
1835
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
1836
|
-
"aria-label":
|
|
1851
|
+
"onUpdate:modelValue": n[0] ||= (e) => u.country = e,
|
|
1852
|
+
"aria-label": o.value.selectCountry
|
|
1837
1853
|
}, [
|
|
1838
|
-
p("option", ai, A(
|
|
1839
|
-
p("option", oi, A(
|
|
1854
|
+
p("option", ai, A(o.value.selectCountry), 1),
|
|
1855
|
+
p("option", oi, A(o.value.allCountries), 1),
|
|
1840
1856
|
(T(!0), f(c, null, O(e.countries, (e) => (T(), f("option", {
|
|
1841
1857
|
key: e.value,
|
|
1842
1858
|
value: e.value
|
|
1843
1859
|
}, A(e.label), 9, si))), 128))
|
|
1844
|
-
], 8, ii), [[F,
|
|
1860
|
+
], 8, ii), [[F, u.country]])]),
|
|
1845
1861
|
p("p", ci, [B(p("select", {
|
|
1846
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
1847
|
-
"aria-label":
|
|
1848
|
-
}, [p("option", ui, A(
|
|
1862
|
+
"onUpdate:modelValue": n[1] ||= (e) => u.start = e,
|
|
1863
|
+
"aria-label": o.value.startDate
|
|
1864
|
+
}, [p("option", ui, A(o.value.startDate), 1), (T(!0), f(c, null, O(e.starts, (e) => (T(), f("option", {
|
|
1849
1865
|
key: e.value,
|
|
1850
1866
|
value: e.value
|
|
1851
|
-
}, A(e.label), 9, di))), 128))], 8, li), [[F,
|
|
1867
|
+
}, A(e.label), 9, di))), 128))], 8, li), [[F, u.start]])]),
|
|
1852
1868
|
p("p", fi, [B(p("select", {
|
|
1853
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
1854
|
-
"aria-label":
|
|
1855
|
-
}, [p("option", mi, A(
|
|
1869
|
+
"onUpdate:modelValue": n[2] ||= (e) => u.end = e,
|
|
1870
|
+
"aria-label": o.value.endDate
|
|
1871
|
+
}, [p("option", mi, A(o.value.endDate), 1), (T(!0), f(c, null, O(e.ends, (e) => (T(), f("option", {
|
|
1856
1872
|
key: e.value,
|
|
1857
1873
|
value: e.value
|
|
1858
|
-
}, A(e.label), 9, hi))), 128))], 8, pi), [[F,
|
|
1859
|
-
p("p", gi, [p("button", _i, A(
|
|
1874
|
+
}, A(e.label), 9, hi))), 128))], 8, pi), [[F, u.end]])]),
|
|
1875
|
+
p("p", gi, [p("button", _i, A(o.value.go), 1)])
|
|
1860
1876
|
], 32));
|
|
1861
1877
|
}
|
|
1862
1878
|
}, yi = {
|
|
@@ -2136,7 +2152,11 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
2136
2152
|
props: {
|
|
2137
2153
|
labels: {
|
|
2138
2154
|
type: Object,
|
|
2139
|
-
|
|
2155
|
+
default: null
|
|
2156
|
+
},
|
|
2157
|
+
texts: {
|
|
2158
|
+
type: String,
|
|
2159
|
+
default: ""
|
|
2140
2160
|
},
|
|
2141
2161
|
start: {
|
|
2142
2162
|
type: Number,
|
|
@@ -2181,7 +2201,12 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
2181
2201
|
},
|
|
2182
2202
|
emits: ["change"],
|
|
2183
2203
|
setup(e, { emit: t }) {
|
|
2184
|
-
let n = e, r = t, i = l(() => {
|
|
2204
|
+
let n = e, r = t, i = n.texts ? q().t : (e) => e, a = l(() => n.labels ?? {
|
|
2205
|
+
heading: i(`${n.texts}.tl.title`),
|
|
2206
|
+
close: i("record.glossary.close"),
|
|
2207
|
+
country: i(`${n.texts}.hcr.country`),
|
|
2208
|
+
range: i(`${n.texts}.hcr.range`)
|
|
2209
|
+
}), o = l(() => {
|
|
2185
2210
|
let e = (Math.floor(n.start / 50) - 2) * 50;
|
|
2186
2211
|
return e + 700 > 2050 && (e = 1350), Array.from({ length: 14 }, (t, r) => {
|
|
2187
2212
|
let i = e + 50 * r;
|
|
@@ -2193,19 +2218,19 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
2193
2218
|
});
|
|
2194
2219
|
return (t, n) => (T(), u($, {
|
|
2195
2220
|
class: "mwnf-standalone-hcr",
|
|
2196
|
-
heading:
|
|
2197
|
-
"close-label":
|
|
2221
|
+
heading: a.value.heading,
|
|
2222
|
+
"close-label": a.value.close,
|
|
2198
2223
|
dir: e.dir
|
|
2199
2224
|
}, {
|
|
2200
|
-
before: z(() => [p("section", $i, [p("div", ea, [(T(!0), f(c, null, O(
|
|
2225
|
+
before: z(() => [p("section", $i, [p("div", ea, [(T(!0), f(c, null, O(o.value, (e) => (T(), f("span", {
|
|
2201
2226
|
key: e.value,
|
|
2202
2227
|
class: b({ "mwnf-standalone-hcr__year--active": e.active })
|
|
2203
2228
|
}, A(e.value), 3))), 128))]), n[2] ||= p("div", { class: "mwnf-standalone-hcr__lines" }, null, -1)])]),
|
|
2204
2229
|
default: z(() => [p("div", ta, [p("div", na, [
|
|
2205
|
-
p("p", ra, A(
|
|
2230
|
+
p("p", ra, A(a.value.country), 1),
|
|
2206
2231
|
p("select", {
|
|
2207
2232
|
value: e.country,
|
|
2208
|
-
"aria-label":
|
|
2233
|
+
"aria-label": a.value.country,
|
|
2209
2234
|
onChange: n[0] ||= (e) => r("change", {
|
|
2210
2235
|
key: "country",
|
|
2211
2236
|
value: e.target.value
|
|
@@ -2214,10 +2239,10 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
|
|
|
2214
2239
|
key: e.value,
|
|
2215
2240
|
value: e.value
|
|
2216
2241
|
}, A(e.label), 9, aa))), 128))], 40, ia),
|
|
2217
|
-
p("p", oa, A(
|
|
2242
|
+
p("p", oa, A(a.value.range), 1),
|
|
2218
2243
|
p("select", {
|
|
2219
2244
|
value: String(e.range),
|
|
2220
|
-
"aria-label":
|
|
2245
|
+
"aria-label": a.value.range,
|
|
2221
2246
|
onChange: n[1] ||= (e) => r("change", {
|
|
2222
2247
|
key: "start",
|
|
2223
2248
|
value: e.target.value
|
package/dist/views.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e, t } from "./FeaturedRecord-Fe19w6_G.js";
|
|
2
|
-
import { n, r, t as i } from "./TimelineResultsView-
|
|
2
|
+
import { n, r, t as i } from "./TimelineResultsView-Bn4rC_Se.js";
|
|
3
3
|
import { t as a } from "./RecordView-CBC7tBCX.js";
|
|
4
4
|
import { t as o } from "./GlossaryPopover-DbQKXhx9.js";
|
|
5
5
|
import { d as s, i as ee, l as te, n as c } from "./PartnerMap-DdyMLtgH.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@museumwnf/viewer-layout",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.72.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",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"src/tokens.reference.css",
|
|
18
18
|
"src/styles/dxa-gallery.css",
|
|
19
19
|
"src/styles/dxa-exhibition.css",
|
|
20
|
-
"src/dxa/testing.js"
|
|
20
|
+
"src/dxa/testing.js",
|
|
21
|
+
"src/minisite/testing.js"
|
|
21
22
|
],
|
|
22
23
|
"main": "./dist/index.js",
|
|
23
24
|
"module": "./dist/index.js",
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
"./dxa/gallery.css": "./src/styles/dxa-gallery.css",
|
|
33
34
|
"./dxa/exhibition.css": "./src/styles/dxa-exhibition.css",
|
|
34
35
|
"./dxa/testing": "./src/dxa/testing.js",
|
|
36
|
+
"./minisite/testing": "./src/minisite/testing.js",
|
|
35
37
|
"./style.css": "./dist/viewer-layout.css",
|
|
36
38
|
"./tokens.reference.css": "./src/tokens.reference.css"
|
|
37
39
|
},
|
|
@@ -43,12 +45,12 @@
|
|
|
43
45
|
"test": "vitest run"
|
|
44
46
|
},
|
|
45
47
|
"peerDependencies": {
|
|
46
|
-
"@museumwnf/viewer-core": "^2.
|
|
48
|
+
"@museumwnf/viewer-core": "^2.21.0",
|
|
47
49
|
"vue": "^3.5.0",
|
|
48
50
|
"vue-router": "^4.5.0 || ^5.0.0"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
|
-
"@museumwnf/viewer-core": "^2.
|
|
53
|
+
"@museumwnf/viewer-core": "^2.21.0",
|
|
52
54
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
53
55
|
"@vue/test-utils": "^2.5.1",
|
|
54
56
|
"jsdom": "^30.1.3",
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// The mini-sites' smoke tests, written once (`@museumwnf/viewer-layout/minisite/testing`).
|
|
2
|
+
//
|
|
3
|
+
// Every mini-site of a family renders the same pages (minisiteConfig() and its
|
|
4
|
+
// siblings), so the family shares one smoke test. A site's own
|
|
5
|
+
// tests/smoke.test.js calls it with what only the site knows: its config, its
|
|
6
|
+
// minisite.json, its texts, its chrome's SOURCES.json and its text namespace.
|
|
7
|
+
// The family is minisite.json's `family`: `ISL` (Discover Islamic Art's
|
|
8
|
+
// exhibitions), `GAI` (its Artistic Introduction), `BAR` (Discover Baroque
|
|
9
|
+
// Art's) or `SH` (Sharing History's). A site may add tests of its own after
|
|
10
|
+
// the call.
|
|
11
|
+
//
|
|
12
|
+
// Runs inside the site's own Vitest, as ../dxa/testing.js does: `vitest`,
|
|
13
|
+
// node:fs and the data package resolve from the site.
|
|
14
|
+
import { readFileSync } from 'node:fs'
|
|
15
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
16
|
+
import { mergeMessages } from '@museumwnf/viewer-core'
|
|
17
|
+
import {
|
|
18
|
+
checkChromeSources, checkOfferedLanguages, checkRoutes, checkSectionMeta, checkTextsRendered, mountSite as mountOn,
|
|
19
|
+
} from '@museumwnf/viewer-core/testing'
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const WAIT = { timeout: 20000 }
|
|
23
|
+
|
|
24
|
+
// What legacy's address and the theme file of each family look like, the
|
|
25
|
+
// marks that a copy of a template has become a mini-site.
|
|
26
|
+
// Each family's text set; the same names as exhibition.js's LABELS, repeated
|
|
27
|
+
// because this file ships as source on its own, without the built entry.
|
|
28
|
+
const LABEL_SETS = { ISL: 'minisite', GAI: 'minisiteArtIntro', BAR: 'minisiteBaroque', SH: 'minisiteSharingHistory' }
|
|
29
|
+
|
|
30
|
+
const FAMILIES = {
|
|
31
|
+
ISL: { legacy: /^https:\/\/.+\/exhibitions\//, token: '--minisite-' },
|
|
32
|
+
GAI: { legacy: /^https:\/\/.+\/gai\//, token: '--minisite-' },
|
|
33
|
+
BAR: { legacy: /^https:\/\/.+\/exhibitions\/BAR\//, token: '--minisite-' },
|
|
34
|
+
SH: { legacy: /^https:\/\/sharinghistory\.museumwnf\.org\/exhibitions\/AWE\//, token: '--sh-head-bg' },
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The family's smoke test, against this site's own dataset:
|
|
39
|
+
* - `config`, `exhibition` — the site's dataset.config.js and minisite.json;
|
|
40
|
+
* - `sharedTexts`, `ownTexts` — its family's viewer-i18n bundle and its
|
|
41
|
+
* locales/en.json, merged as main.js merges them;
|
|
42
|
+
* - `sources` — theme/assets/legacy/SOURCES.json, its chrome's provenance;
|
|
43
|
+
* - `namespace` — its own texts' namespace (package.json `viewerI18n.namespace`).
|
|
44
|
+
*/
|
|
45
|
+
export function describeMinisiteSmoke({ config, exhibition, sharedTexts, ownTexts, sources, namespace }) {
|
|
46
|
+
const family = exhibition.family ?? 'ISL'
|
|
47
|
+
const marks = FAMILIES[family]
|
|
48
|
+
if (!marks) throw new Error(`describeMinisiteSmoke: unknown family "${family}" in minisite.json.`)
|
|
49
|
+
const messages = mergeMessages(sharedTexts, { en: ownTexts })
|
|
50
|
+
const mountSite = (hash) => mountOn(config, messages, hash)
|
|
51
|
+
const namespaces = [config.minisite?.texts ?? LABEL_SETS[family], namespace, 'core', 'layout']
|
|
52
|
+
|
|
53
|
+
describe('mini-site smoke test', () => {
|
|
54
|
+
// A copy of the family's template is not a mini-site until inventory-app's
|
|
55
|
+
// scripts/minisites generator has written what legacy configured for it:
|
|
56
|
+
// the settings, the theme and the frame's pictures.
|
|
57
|
+
it("carries this site's own settings, theme and pictures", () => {
|
|
58
|
+
expect(exhibition.legacy).toMatch(marks.legacy)
|
|
59
|
+
if (family === 'ISL' || family === 'BAR') expect(exhibition.curators.length).toBeGreaterThan(0)
|
|
60
|
+
if (family === 'SH') expect(exhibition.profiles.length).toBeGreaterThan(0)
|
|
61
|
+
expect(readFileSync('theme/tokens.css', 'utf8')).toContain(marks.token)
|
|
62
|
+
expect(Object.keys(sources.files).length).toBeGreaterThan(0)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('holds the chrome taken from legacy, byte for byte, and nothing else', () => {
|
|
66
|
+
expect(checkChromeSources(sources)).toEqual([])
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('declares the entities every route reads, and the section it belongs to', () => {
|
|
70
|
+
for (const route of config.extraViews) expect(Array.isArray(route.meta?.entities), route.name).toBe(true)
|
|
71
|
+
expect(checkSectionMeta(config)).toEqual([])
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('publishes no generic entity pages', () => {
|
|
75
|
+
expect(config.features.entities).toEqual([])
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('offers the languages the package declares, where the exhibition has texts in them', () => {
|
|
79
|
+
const rule = family === 'ISL' || family === 'GAI' ? { entity: 'collections' } : undefined
|
|
80
|
+
expect(checkOfferedLanguages(config, rule)).toEqual([])
|
|
81
|
+
expect(config.languages.length).toBeGreaterThan(0)
|
|
82
|
+
expect(config.navigation.languages.map((l) => l.code)).toEqual(config.languages)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
PAGES[family]({ config, mountSite, namespaces })
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ── Each family's pages ────────────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
const PAGES = {
|
|
92
|
+
ISL({ config, mountSite, namespaces }) {
|
|
93
|
+
it('draws the home page: the title, the menu and the curators', async () => {
|
|
94
|
+
const { app, host } = await mountSite('#/?lang=en')
|
|
95
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-home__title')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
96
|
+
// The introduction and one entry per theme.
|
|
97
|
+
expect(host.querySelectorAll('.mwnf-minisite-home__menu div').length).toBeGreaterThan(1)
|
|
98
|
+
expect(host.querySelectorAll('.mwnf-minisite-partners__curator').length).toBe(config.minisite.curators.length)
|
|
99
|
+
// The frame: the menu over the footer, legacy's links in its order.
|
|
100
|
+
expect(host.querySelectorAll('.mwnf-minisite-menu li').length).toBe(config.navigation.menu.length)
|
|
101
|
+
app.unmount()
|
|
102
|
+
}, 30000)
|
|
103
|
+
|
|
104
|
+
it('draws the introduction: its text and its captioned pictures', async () => {
|
|
105
|
+
const { app, host } = await mountSite('#/introduction?lang=en')
|
|
106
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-intro__content')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
107
|
+
// The captions come with the items' texts, which may arrive after the introduction's.
|
|
108
|
+
await vi.waitFor(() => expect(host.querySelectorAll('.mwnf-minisite-intro-item strong').length).toBeGreaterThan(0), WAIT)
|
|
109
|
+
app.unmount()
|
|
110
|
+
}, 30000)
|
|
111
|
+
|
|
112
|
+
it('draws an exhibition page: thumbnails, the item on show and its caption', async () => {
|
|
113
|
+
const { app, host } = await mountSite('#/exhibition/1/1?lang=en')
|
|
114
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-page__caption strong')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
115
|
+
expect(host.querySelectorAll('.mwnf-minisite-page__thumbs a').length).toBeGreaterThan(0)
|
|
116
|
+
expect(host.querySelector('.mwnf-minisite-page__page-title').textContent.trim()).not.toBe('')
|
|
117
|
+
// The first page's previous page is the introduction.
|
|
118
|
+
expect(host.querySelector('.mwnf-minisite-page__nav--end a').getAttribute('href')).toContain('#/introduction')
|
|
119
|
+
app.unmount()
|
|
120
|
+
}, 30000)
|
|
121
|
+
|
|
122
|
+
it("draws legacy's windows without the frame", async () => {
|
|
123
|
+
const { app, host } = await mountSite('#/credits?lang=en')
|
|
124
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-credits h1')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
125
|
+
expect(host.querySelector('.mwnf-minisite-header')).toBeNull()
|
|
126
|
+
app.unmount()
|
|
127
|
+
}, 30000)
|
|
128
|
+
|
|
129
|
+
it('declares every route by name, and leaves the catch-all to the router', () => {
|
|
130
|
+
expect(checkRoutes(config, { names: ['home', 'introduction', 'exhibition', 'credits', 'map', 'zoom'] })).toEqual([])
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
it('renders its own texts, none as a bare entry name', async () => {
|
|
134
|
+
const { app, host } = await mountSite('#/exhibition/1/1?lang=en')
|
|
135
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-page__caption')).not.toBeNull(), WAIT)
|
|
136
|
+
expect(host.textContent).toContain('Exhibition homepage')
|
|
137
|
+
expect(checkTextsRendered(host, { namespaces })).toEqual([])
|
|
138
|
+
app.unmount()
|
|
139
|
+
}, 30000)
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
GAI({ config, mountSite, namespaces }) {
|
|
143
|
+
it('draws the home page: the title, the subtitle, the menu of its themes and the social-media links', async () => {
|
|
144
|
+
const { app, host } = await mountSite('#/?lang=en')
|
|
145
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-artintro-home__title')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
146
|
+
expect(host.querySelector('.mwnf-artintro-home__subtitle').textContent.trim()).not.toBe('')
|
|
147
|
+
expect(host.querySelectorAll('.mwnf-artintro-home__menu div, .mwnf-artintro-home__menu2 div').length).toBeGreaterThan(1)
|
|
148
|
+
expect(host.querySelectorAll('.mwnf-artintro-home__social a').length).toBe(config.minisite.social.length)
|
|
149
|
+
// No menu over the footer.
|
|
150
|
+
expect(host.querySelector('.mwnf-minisite-menu')).toBeNull()
|
|
151
|
+
app.unmount()
|
|
152
|
+
}, 30000)
|
|
153
|
+
|
|
154
|
+
it("draws a theme's page: its pages, the item on show, its caption and the thumbnails", async () => {
|
|
155
|
+
const { app, host } = await mountSite('#/page/1/1?lang=en')
|
|
156
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-artintro-page__caption strong')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
157
|
+
expect(host.querySelector('.mwnf-artintro-page__title').textContent.trim()).not.toBe('')
|
|
158
|
+
expect(host.querySelectorAll('.mwnf-artintro-page__pages a').length).toBeGreaterThan(0)
|
|
159
|
+
expect(host.querySelectorAll('.mwnf-artintro-page__thumbs a').length).toBeGreaterThan(0)
|
|
160
|
+
app.unmount()
|
|
161
|
+
}, 30000)
|
|
162
|
+
|
|
163
|
+
it('draws the zoom window without the frame', async () => {
|
|
164
|
+
const { app, host } = await mountSite('#/zoom?lang=en')
|
|
165
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-minisite-zoom')).not.toBeNull(), WAIT)
|
|
166
|
+
expect(host.querySelector('.mwnf-minisite-header')).toBeNull()
|
|
167
|
+
app.unmount()
|
|
168
|
+
}, 30000)
|
|
169
|
+
|
|
170
|
+
it('declares every route by name, and leaves the catch-all to the router', () => {
|
|
171
|
+
expect(checkRoutes(config, { names: ['home', 'page', 'zoom'] })).toEqual([])
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it('renders its own texts, none as a bare entry name', async () => {
|
|
175
|
+
const { app, host } = await mountSite('#/page/1/1?lang=en')
|
|
176
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-artintro-page__caption')).not.toBeNull(), WAIT)
|
|
177
|
+
expect(host.textContent).toContain('More information')
|
|
178
|
+
expect(checkTextsRendered(host, { namespaces })).toEqual([])
|
|
179
|
+
app.unmount()
|
|
180
|
+
}, 30000)
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
BAR({ config, mountSite, namespaces }) {
|
|
184
|
+
it('draws the home page: the title, the menu, the curators and the designer', async () => {
|
|
185
|
+
const { app, host } = await mountSite('#/?lang=en')
|
|
186
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-baroqueart-home__title')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
187
|
+
// The introduction and one entry per theme.
|
|
188
|
+
expect(host.querySelectorAll('.mwnf-baroqueart-home__menu div').length).toBeGreaterThan(1)
|
|
189
|
+
expect(host.querySelectorAll('.mwnf-baroqueart-partners__curator').length).toBe(config.minisite.curators.length)
|
|
190
|
+
expect(Boolean(host.querySelector('.mwnf-baroqueart-partners__design'))).toBe(Boolean(config.minisite.design))
|
|
191
|
+
// The frame: the menu over the footer, legacy's links in its order.
|
|
192
|
+
expect(host.querySelectorAll('.mwnf-baroqueart-menu li').length).toBe(config.navigation.menu.length)
|
|
193
|
+
app.unmount()
|
|
194
|
+
}, 30000)
|
|
195
|
+
|
|
196
|
+
it('draws the introduction: its text and its captioned pictures', async () => {
|
|
197
|
+
const { app, host } = await mountSite('#/introduction?lang=en')
|
|
198
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-baroqueart-intro__content')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
199
|
+
await vi.waitFor(() => expect(host.querySelectorAll('.mwnf-baroqueart-intro-item strong').length).toBeGreaterThan(0), WAIT)
|
|
200
|
+
app.unmount()
|
|
201
|
+
}, 30000)
|
|
202
|
+
|
|
203
|
+
it('draws an exhibition page: thumbnails, the item on show and its caption', async () => {
|
|
204
|
+
const { app, host } = await mountSite('#/exhibition/1/1?lang=en')
|
|
205
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-baroqueart-page__caption strong')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
206
|
+
expect(host.querySelectorAll('.mwnf-baroqueart-page__thumbs a').length).toBeGreaterThan(0)
|
|
207
|
+
expect(host.querySelector('.mwnf-baroqueart-page__page-title').textContent.trim()).not.toBe('')
|
|
208
|
+
expect(host.querySelector('.mwnf-baroqueart-page__nav--end a').getAttribute('href')).toContain('#/introduction')
|
|
209
|
+
app.unmount()
|
|
210
|
+
}, 30000)
|
|
211
|
+
|
|
212
|
+
it('draws the zoom window without the frame', async () => {
|
|
213
|
+
const { app, host } = await mountSite('#/zoom?lang=en')
|
|
214
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-baroqueart-zoom')).not.toBeNull(), WAIT)
|
|
215
|
+
expect(host.querySelector('.mwnf-baroqueart-header')).toBeNull()
|
|
216
|
+
app.unmount()
|
|
217
|
+
}, 30000)
|
|
218
|
+
|
|
219
|
+
it('declares every route by name, and leaves the catch-all to the router', () => {
|
|
220
|
+
expect(checkRoutes(config, { names: ['home', 'introduction', 'exhibition', 'zoom'] })).toEqual([])
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
it('renders its own texts, none as a bare entry name', async () => {
|
|
224
|
+
const { app, host } = await mountSite('#/exhibition/1/1?lang=en')
|
|
225
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-baroqueart-page__caption')).not.toBeNull(), WAIT)
|
|
226
|
+
expect(host.textContent).toContain('Exhibition homepage')
|
|
227
|
+
expect(checkTextsRendered(host, { namespaces })).toEqual([])
|
|
228
|
+
app.unmount()
|
|
229
|
+
}, 30000)
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
SH({ config, mountSite, namespaces }) {
|
|
233
|
+
it('draws the home page: the title, the theme menu, the logos and the frame', async () => {
|
|
234
|
+
const { app, host } = await mountSite('#/?lang=en')
|
|
235
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-home__title')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
236
|
+
expect(host.querySelectorAll('.mwnf-sh-home__theme').length).toBeGreaterThan(0)
|
|
237
|
+
expect(host.querySelectorAll('.mwnf-sh-band__logos img').length).toBeGreaterThan(0)
|
|
238
|
+
expect(host.querySelectorAll('.mwnf-sh-menu > ul > li').length).toBe(config.navigation.menu.length)
|
|
239
|
+
app.unmount()
|
|
240
|
+
}, 30000)
|
|
241
|
+
|
|
242
|
+
it('draws the introduction: its text and a captioned picture', async () => {
|
|
243
|
+
const { app, host } = await mountSite('#/introduction?lang=en')
|
|
244
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-intro__body')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
245
|
+
// The caption is the record's, whose texts load after the exhibition's.
|
|
246
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-intro__picture b')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
247
|
+
app.unmount()
|
|
248
|
+
}, 30000)
|
|
249
|
+
|
|
250
|
+
it("draws a theme's overview and a subtheme: thumbnails, the item on show and its caption", async () => {
|
|
251
|
+
for (const address of ['#/theme/1?lang=en', '#/theme/1/1?lang=en']) {
|
|
252
|
+
const { app, host } = await mountSite(address)
|
|
253
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-panel__name')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
254
|
+
expect(host.querySelectorAll('.mwnf-sh-page__thumbs img').length).toBeGreaterThan(0)
|
|
255
|
+
expect(host.querySelector('.mwnf-sh-page__name').textContent.trim()).not.toBe('')
|
|
256
|
+
app.unmount()
|
|
257
|
+
}
|
|
258
|
+
}, 60000)
|
|
259
|
+
|
|
260
|
+
it("draws legacy's windows without the frame", async () => {
|
|
261
|
+
const { app, host } = await mountSite('#/credits?lang=en')
|
|
262
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-window h3')?.textContent.trim()).toBeTruthy(), WAIT)
|
|
263
|
+
expect(host.querySelector('.mwnf-sh-header')).toBeNull()
|
|
264
|
+
app.unmount()
|
|
265
|
+
}, 30000)
|
|
266
|
+
|
|
267
|
+
it('declares every route by name, and leaves the catch-all to the router', () => {
|
|
268
|
+
expect(
|
|
269
|
+
checkRoutes(config, { names: ['home', 'introduction', 'theme', 'subtheme', 'further-reading', 'credits', 'cover-image', 'zoom'] }),
|
|
270
|
+
).toEqual([])
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
it('renders its own texts, none as a bare entry name', async () => {
|
|
274
|
+
const { app, host } = await mountSite('#/theme/1/1?lang=en')
|
|
275
|
+
await vi.waitFor(() => expect(host.querySelector('.mwnf-sh-panel')).not.toBeNull(), WAIT)
|
|
276
|
+
expect(host.textContent).toContain('Exhibition homepage')
|
|
277
|
+
expect(checkTextsRendered(host, { namespaces })).toEqual([])
|
|
278
|
+
app.unmount()
|
|
279
|
+
}, 30000)
|
|
280
|
+
},
|
|
281
|
+
}
|