feat: refine portfolio content, contact, and supporting media
This commit is contained in:
@@ -37,10 +37,10 @@ const navigationLabels: Readonly<Record<(typeof sectionIds)[number], string>> =
|
||||
};
|
||||
|
||||
const visibleTextLeafSelector =
|
||||
"h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a,svg text";
|
||||
"h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a,summary,svg text";
|
||||
const visibleTextSelector = [
|
||||
".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 :is(h1,h2,h3,h4,p,dt,dd,li,figcaption,caption,th,td,a,summary)",
|
||||
".portfolio-main svg text",
|
||||
].join(",");
|
||||
|
||||
@@ -111,6 +111,7 @@ const expectedVisibleTextSegments = (
|
||||
(project.media ?? []).flatMap((presentation) => [
|
||||
presentation.caption,
|
||||
presentation.longDescription,
|
||||
...(presentation.kind === "video" ? ["Open gameplay video"] : []),
|
||||
...(presentation.kind === "chart"
|
||||
? [
|
||||
"Variables",
|
||||
@@ -136,7 +137,7 @@ const expectedVisibleTextSegments = (
|
||||
content.identity.role,
|
||||
content.identity.valueProposition,
|
||||
content.identity.availability,
|
||||
"Email Luca",
|
||||
"Contact Me",
|
||||
"Explore work",
|
||||
...section("profile", [
|
||||
content.profile.introduction,
|
||||
@@ -197,7 +198,6 @@ const expectedVisibleTextSegments = (
|
||||
project.summary,
|
||||
...projectMediaText(project),
|
||||
project.contribution,
|
||||
project.outcome,
|
||||
...projectLinkText(project),
|
||||
]),
|
||||
),
|
||||
@@ -212,8 +212,7 @@ const expectedVisibleTextSegments = (
|
||||
"contact",
|
||||
[
|
||||
content.contact.introduction,
|
||||
"Email Luca",
|
||||
content.contact.email,
|
||||
"Email Me",
|
||||
content.contact.cvMessage,
|
||||
...content.contact.social.map((link) => link.service),
|
||||
],
|
||||
@@ -230,6 +229,7 @@ const rawVisibleTextSegments = async (
|
||||
({ html, leafSelector, rootSelector }) => {
|
||||
const document = new DOMParser().parseFromString(html, "text/html");
|
||||
const isHidden = (element: Element): boolean => {
|
||||
if (element.closest('.project-media--video[data-enhanced="false"] .video-controls')) return true;
|
||||
for (
|
||||
let current: Element | null = element;
|
||||
current;
|
||||
@@ -420,12 +420,14 @@ test("keeps every raw SSR reading-path segment visible without JavaScript", asyn
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
const email = page.locator('a[href="mailto:luca.pislaru@gmail.com"]');
|
||||
await expect(email).toHaveCount(2);
|
||||
await expect(email).toHaveText(["Email Luca", "Email Luca"]);
|
||||
await expect(page.locator('a[href^="mailto:"]')).toHaveCount(0);
|
||||
const email = page.locator('#contact-email-details');
|
||||
await email.locator('summary').click();
|
||||
await expect(email.locator('.contact-email__address')).toBeVisible();
|
||||
await expect(email.locator('.contact-email__address')).toHaveText('luca.pislaru [at] gmail [dot] com');
|
||||
await expect(
|
||||
page.getByText(
|
||||
"For a current CV or role-specific information, contact me directly.",
|
||||
"Get in touch for my CV or to talk about a role.",
|
||||
{ exact: true },
|
||||
),
|
||||
).toBeVisible();
|
||||
@@ -528,5 +530,5 @@ test("retains native section navigation when scripts are disabled", async ({
|
||||
|
||||
await expect(page).toHaveURL(`${distUrl}/#contact`);
|
||||
await expect(page.locator("#contact")).toBeInViewport();
|
||||
await expect(page.locator('#contact a[href^="mailto:"]')).toBeVisible();
|
||||
await expect(page.locator('#contact :is(a, summary):text-is("Email Me")')).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user