This commit is contained in:
2026-10-05 13:52:45 -04:00
parent 9eb71e9855
commit e90ebde399
34 changed files with 465 additions and 581 deletions
+13 -7
View File
@@ -5,7 +5,7 @@ const pages = [
["/", "Built to develop."],
["/fabrics", "Different yarns."],
["/about", "Built around"],
["/contact", "Let’s talk"],
["/contact", "Bring us your"],
];
for (const width of [1440, 768, 390, 320]) {
@@ -24,6 +24,7 @@ for (const width of [1440, 768, 390, 320]) {
heading,
);
await page.evaluate(() => document.fonts.ready);
await expect(page.locator(".loader")).toHaveCount(0, { timeout: 3500 });
for (const image of await page.locator("img").all()) {
await image.scrollIntoViewIfNeeded();
await expect(image).toHaveJSProperty("complete", true);
@@ -41,8 +42,8 @@ for (const width of [1440, 768, 390, 320]) {
(image) => !image.complete || !image.naturalWidth,
).length,
fontsLoaded:
document.fonts.check('16px "Instrument Serif"') &&
document.fonts.check('16px "DM Sans"'),
document.fonts.check('16px "Roboto Condensed"') &&
document.fonts.check('16px "Noto Sans"'),
contentWidthRatio:
document.querySelector("#main-content").getBoundingClientRect()
.width / window.innerWidth,
@@ -109,7 +110,7 @@ test("mobile navigation closes on selection and Escape", async ({ page }) => {
await toggle.click();
await page
.getByRole("navigation", { name: "Main navigation" })
.getByRole("link", { name: "About", exact: true })
.getByRole("link", { name: "Manufacturing", exact: true })
.click();
await expect(page).toHaveURL("/about");
await expect(toggle).toHaveAttribute("aria-expanded", "false");
@@ -191,7 +192,7 @@ test("every page section unveils once when scrolled into view", async ({
}
});
test("homepage feature headings are centered semantic h2 elements", async ({
test("homepage presents proof, fabrics and process in that order", async ({
page,
}) => {
await page.goto("/");
@@ -201,12 +202,17 @@ test("homepage feature headings are centered semantic h2 elements", async ({
});
const developmentsHeading = page.getByRole("heading", {
level: 2,
name: "Structure changes everything.",
name: "What we make. What we can develop.",
});
await expect(fabricsHeading).toHaveCSS("text-align", "center");
await expect(developmentsHeading.locator("..").locator("..")).toHaveClass(
/section-heading--centered/,
);
const sections = await page
.locator("#main-content > section")
.evaluateAll((nodes) => nodes.map((node) => node.classList[0]));
expect(sections.indexOf("stats")).toBeLessThan(sections.indexOf("gallery"));
expect(sections.indexOf("gallery")).toBeLessThan(sections.indexOf("process"));
});
test("capacity values roll in opposite directions and settle at 60–70", async ({
@@ -261,7 +267,7 @@ test("the woven loading page introduces the site and clears", async ({
await page.goto("/");
const loader = page.locator(".loader");
await expect(loader).toContainText("Loading Radhe Radhe Synthetics");
await expect(page.locator(".loader__canvas")).toHaveCount(1);
await expect(page.locator(".loader__machine-image")).toHaveCount(1);
await expect(loader).toHaveCount(0, { timeout: 3500 });
});