test: cover responsive no-script acceptance
This commit is contained in:
@@ -36,10 +36,11 @@ const navigationLabels: Readonly<Record<(typeof sectionIds)[number], string>> =
|
||||
contact: "Contact",
|
||||
};
|
||||
|
||||
const visibleTextLeafSelector = "h1,h2,h3,h4,p,dt,dd,li,figcaption,a,svg text";
|
||||
const visibleTextLeafSelector =
|
||||
"h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a,svg text";
|
||||
const visibleTextSelector = [
|
||||
".site-header :is(h1,h2,h3,h4,p,dt,dd,li,figcaption,a)",
|
||||
".portfolio-main :is(h1,h2,h3,h4,p,dt,dd,li,figcaption,a)",
|
||||
".site-header :is(h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a)",
|
||||
".portfolio-main :is(h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a)",
|
||||
".portfolio-main svg text",
|
||||
].join(",");
|
||||
|
||||
@@ -104,6 +105,30 @@ const expectedVisibleTextSegments = (
|
||||
project: PortfolioContent["projects"]["selected"][number],
|
||||
): string[] =>
|
||||
project.visibility === "public" && project.url ? [project.title] : [];
|
||||
const projectMediaText = (
|
||||
project: PortfolioContent["projects"]["selected"][number],
|
||||
): string[] =>
|
||||
(project.media ?? []).flatMap((presentation) => [
|
||||
presentation.caption,
|
||||
presentation.longDescription,
|
||||
...(presentation.kind === "chart"
|
||||
? [
|
||||
"Variables",
|
||||
presentation.chart.variables,
|
||||
"Trend",
|
||||
presentation.chart.trend,
|
||||
"Conclusion",
|
||||
presentation.chart.conclusion,
|
||||
...(presentation.chart.table === undefined
|
||||
? []
|
||||
: [
|
||||
presentation.chart.table.caption,
|
||||
...presentation.chart.table.columns,
|
||||
...presentation.chart.table.rows.flat(),
|
||||
]),
|
||||
]
|
||||
: []),
|
||||
].filter((segment): segment is string => segment !== undefined));
|
||||
|
||||
return [
|
||||
...sectionIds.map((id) => navigationLabels[id]),
|
||||
@@ -152,6 +177,7 @@ const expectedVisibleTextSegments = (
|
||||
content.projects.selected.flatMap((project) => [
|
||||
project.title,
|
||||
project.summary,
|
||||
...projectMediaText(project),
|
||||
"Problem",
|
||||
project.problem,
|
||||
"Contribution",
|
||||
@@ -169,6 +195,7 @@ const expectedVisibleTextSegments = (
|
||||
content.projects.additional.flatMap((project) => [
|
||||
project.title,
|
||||
project.summary,
|
||||
...projectMediaText(project),
|
||||
project.contribution,
|
||||
project.outcome,
|
||||
...projectLinkText(project),
|
||||
|
||||
Reference in New Issue
Block a user