feat: compose the portfolio journey layer
This commit is contained in:
@@ -213,10 +213,19 @@ const assertSemanticHtml = (html, inputs, contract) => {
|
||||
}
|
||||
for (const section of sections) {
|
||||
const label = inputs.content.navigation.find((item) => item.id === section.id)?.label;
|
||||
if (section.id === 'start') {
|
||||
const heroHeadings = [...section.querySelectorAll(':scope h1')]
|
||||
.filter((node) => isVisibleSemanticNode(node, appRoot));
|
||||
if (heroHeadings.length !== 1 || heroHeadings[0].id !== 'start-heading' ||
|
||||
heroHeadings[0].textContent !== inputs.content.identity.name) {
|
||||
throw new Error('Missing visible hero heading: start');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const headings = [...section.querySelectorAll(':scope > h2')]
|
||||
.filter((node) => isVisibleSemanticNode(node, appRoot));
|
||||
if (label === undefined || headings.length !== 1 || headings[0].id !== `${section.id}-heading` ||
|
||||
headings[0].textContent !== label.toUpperCase()) {
|
||||
headings[0].textContent !== label) {
|
||||
throw new Error(`Missing visible section heading: ${section.id}`);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +244,7 @@ const assertSemanticHtml = (html, inputs, contract) => {
|
||||
}
|
||||
const mailLinks = [...appRoot.querySelectorAll(`a[href="mailto:${inputs.content.contact.email}"]`)]
|
||||
.filter((node) => isVisibleSemanticNode(node, appRoot));
|
||||
if (mailLinks.length !== 1 || mailLinks[0].textContent !== inputs.content.contact.email) {
|
||||
if (mailLinks.length !== 1 || mailLinks[0].textContent !== 'Start a conversation') {
|
||||
throw new Error('Missing visible semantic mailto contact link.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user