fixed page - 85% ready if you asked me
This commit is contained in:
+29
-4
@@ -4,6 +4,7 @@ import { whatsappUrl } from "../src/data.js";
|
||||
const pages = [
|
||||
["/", "Built to develop."],
|
||||
["/fabrics", "Different yarns."],
|
||||
["/products", "Knitted for"],
|
||||
["/about", "Built around"],
|
||||
["/contact", "Bring us your"],
|
||||
];
|
||||
@@ -79,12 +80,13 @@ test("desktop navigation, anchored CTA and browser back work", async ({
|
||||
.getByRole("link", { name: "Fabrics", exact: true }),
|
||||
).toHaveAttribute("aria-current", "page");
|
||||
await page
|
||||
.getByRole("link", { name: "Talk to us on WhatsApp", exact: true })
|
||||
.locator(".contact-banner")
|
||||
.getByRole("link", { name: "Talk to us", exact: true })
|
||||
.click();
|
||||
await expect(page).toHaveURL("/contact#whatsapp");
|
||||
await expect(page.locator("#whatsapp")).toBeInViewport();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Talk to us on WhatsApp", exact: true }),
|
||||
page.getByRole("button", { name: "Talk to us", exact: true }),
|
||||
).toBeDisabled();
|
||||
await expect(page.locator("#whatsapp-status")).toContainText(
|
||||
"number to be supplied",
|
||||
@@ -93,7 +95,8 @@ test("desktop navigation, anchored CTA and browser back work", async ({
|
||||
await expect(page).toHaveURL("/fabrics");
|
||||
await page.goto("/contact#whatsapp");
|
||||
await page
|
||||
.getByRole("link", { name: "Talk to us on WhatsApp", exact: true })
|
||||
.locator(".contact-banner")
|
||||
.getByRole("link", { name: "Talk to us", exact: true })
|
||||
.click();
|
||||
await expect(page.locator("#whatsapp")).toBeInViewport();
|
||||
});
|
||||
@@ -198,7 +201,7 @@ test("homepage presents proof, fabrics and process in that order", async ({
|
||||
await page.goto("/");
|
||||
const fabricsHeading = page.getByRole("heading", {
|
||||
level: 2,
|
||||
name: "Greige is where it begins.",
|
||||
name: "Grey is where it begins.",
|
||||
});
|
||||
const developmentsHeading = page.getByRole("heading", {
|
||||
level: 2,
|
||||
@@ -215,6 +218,28 @@ test("homepage presents proof, fabrics and process in that order", async ({
|
||||
expect(sections.indexOf("gallery")).toBeLessThan(sections.indexOf("process"));
|
||||
});
|
||||
|
||||
test("home and products heroes cycle through four product images", async ({
|
||||
page,
|
||||
}) => {
|
||||
for (const path of ["/", "/products"]) {
|
||||
await page.goto(path);
|
||||
const slides = page
|
||||
.locator(".image-carousel")
|
||||
.first()
|
||||
.locator(".image-carousel__image");
|
||||
await expect(slides).toHaveCount(4);
|
||||
expect(
|
||||
await slides.first().evaluate((image) => image.getAnimations().length),
|
||||
).toBeGreaterThan(0);
|
||||
}
|
||||
await page.goto("/products");
|
||||
await expect(page.locator(".product")).toHaveCount(4);
|
||||
await expect(
|
||||
page.getByText("Daily-wear T-shirts", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByText("Women’s wear", { exact: true })).toBeVisible();
|
||||
});
|
||||
|
||||
test("capacity values roll in opposite directions and settle at 60–70", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user