From 337a35d367a39fbb95ff38ccc75fd8a406da4b28 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sat, 13 Sep 2025 21:52:46 -0600 Subject: [PATCH] Update ContentLockup.integration.test.jsx --- .../ContentLockup.integration.test.jsx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/integration/ContentLockup.integration.test.jsx b/tests/integration/ContentLockup.integration.test.jsx index ed03bf2..bd4b15e 100644 --- a/tests/integration/ContentLockup.integration.test.jsx +++ b/tests/integration/ContentLockup.integration.test.jsx @@ -16,18 +16,18 @@ describe("ContentLockup Integration", () => { subtitle="Get Started" description="This is a description" ctaText="Get Started" - />, + /> ); expect( - screen.getByRole("heading", { name: "Welcome" }), + screen.getByRole("heading", { name: "Welcome" }) ).toBeInTheDocument(); expect( - screen.getByRole("heading", { name: "Get Started" }), + screen.getByRole("heading", { name: "Get Started" }) ).toBeInTheDocument(); expect(screen.getByText("This is a description")).toBeInTheDocument(); expect(screen.getAllByRole("button", { name: "Get Started" })).toHaveLength( - 3, + 3 ); }); @@ -40,18 +40,18 @@ describe("ContentLockup Integration", () => { description="Feature description" linkText="Learn More" linkHref="/learn" - />, + /> ); expect( - screen.getByRole("heading", { name: "Feature Title" }), + screen.getByRole("heading", { name: "Feature Title" }) ).toBeInTheDocument(); expect( - screen.getByRole("link", { name: "Learn More" }), + screen.getByRole("link", { name: "Learn More" }) ).toBeInTheDocument(); expect(screen.getByRole("link", { name: "Learn More" })).toHaveAttribute( "href", - "/learn", + "/learn" ); }); @@ -61,14 +61,14 @@ describe("ContentLockup Integration", () => { variant="ask" title="Ask Question" subtitle="Ask subtitle" - />, + /> ); expect( - screen.getByRole("heading", { name: "Ask Question" }), + screen.getByRole("heading", { name: "Ask Question" }) ).toBeInTheDocument(); expect( - screen.getByRole("heading", { name: "Ask subtitle" }), + screen.getByRole("heading", { name: "Ask subtitle" }) ).toBeInTheDocument(); // Ask variant should not have description or CTA expect(screen.queryByRole("button")).not.toBeInTheDocument(); @@ -81,7 +81,7 @@ describe("ContentLockup Integration", () => { title="Left Aligned" subtitle="Subtitle" alignment="left" - />, + /> ); const container = screen @@ -92,7 +92,7 @@ describe("ContentLockup Integration", () => { test("renders responsive buttons correctly", () => { render( - , + ); // Should render all three button variants for different breakpoints @@ -107,7 +107,7 @@ describe("ContentLockup Integration", () => { title="Custom Button" ctaText="Custom" buttonClassName="custom-button-class" - />, + /> ); const buttons = screen.getAllByRole("button", { name: "Custom" }); @@ -119,7 +119,7 @@ describe("ContentLockup Integration", () => { render(); expect( - screen.getByRole("heading", { name: "Minimal" }), + screen.getByRole("heading", { name: "Minimal" }) ).toBeInTheDocument(); // Should not crash without subtitle, description, or CTA expect(screen.queryByRole("button")).not.toBeInTheDocument(); @@ -128,15 +128,16 @@ describe("ContentLockup Integration", () => { test("renders decorative shape for hero variant", () => { render(); - const shape = screen.getByAltText("Decorative shapes"); + const shape = screen.getByRole("presentation"); expect(shape).toBeInTheDocument(); expect(shape).toHaveAttribute("src", "assets/Shapes_1.svg"); + expect(shape).toHaveAttribute("alt", ""); }); test("does not render shape for non-hero variants", () => { render(); - expect(screen.queryByAltText("Decorative shapes")).not.toBeInTheDocument(); + expect(screen.queryByRole("presentation")).not.toBeInTheDocument(); }); test("link has proper accessibility attributes", () => { @@ -146,7 +147,7 @@ describe("ContentLockup Integration", () => { title="Accessible" linkText="Accessible Link" linkHref="/accessible" - />, + /> ); const link = screen.getByRole("link", { name: "Accessible Link" });