Match Home, top nav, hero, and logo wall to the current marketing frames.

Puts Workshops in the header, pairs the hero with a static rule card and breakpoint CTAs, and shows the three pilot marks with no wall label.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-11-02 18:50:32 -07:00
1 parent e12e06f7ce
commit 33cdaf135c
47 files changed
+728 -527

No files matched your search

+3 -3
View File
@@ -40,9 +40,9 @@ componentTestSuite<AskOrganizerProps>(config);
describe("AskOrganizer (behavioral tests)", () => {
it("renders title", () => {
render(<AskOrganizer title="Test Title" />);
expect(
screen.getByRole("heading", { name: "Test Title" }),
).toBeInTheDocument();
const title = screen.getByRole("heading", { name: "Test Title" });
expect(title).toBeInTheDocument();
expect(title.tagName).toBe("H2");
});
it("renders subtitle when provided", () => {
+5 -5
View File
@@ -38,9 +38,9 @@ componentTestSuite<FeatureGridProps>(config);
describe("FeatureGrid (behavioral tests)", () => {
it("renders title and subtitle", () => {
render(<FeatureGrid title="Test Title" subtitle="Test Subtitle" />);
expect(
screen.getByRole("heading", { name: "Test Title" }),
).toBeInTheDocument();
const title = screen.getByRole("heading", { name: "Test Title" });
expect(title).toBeInTheDocument();
expect(title.tagName).toBe("H2");
expect(screen.getByText("Test Subtitle")).toBeInTheDocument();
expect(
screen.queryByRole("heading", { name: "Test Subtitle" }),
@@ -58,10 +58,10 @@ describe("FeatureGrid (behavioral tests)", () => {
).not.toBeInTheDocument();
});
it("sends Explore the toolkit to the Learn page", () => {
it("sends Explore the patterns to the Learn page", () => {
render(<FeatureGrid title="Test" subtitle="Test" />);
expect(
screen.getByRole("link", { name: "Explore the toolkit" }),
screen.getByRole("link", { name: "Explore the patterns" }),
).toHaveAttribute("href", "/learn");
});
+16 -7
View File
@@ -20,8 +20,6 @@ const config: ComponentTestSuiteConfig<HeroBannerProps> = {
optionalProps: {
subtitle: "Subtitle",
description: "Description",
ctaText: "CTA",
ctaHref: "/link",
},
primaryRole: "region",
testCases: {
@@ -50,18 +48,29 @@ describe("HeroBanner (behavioral tests)", () => {
).toBeInTheDocument();
});
it("renders hero image", () => {
it("renders the team Rule card instead of a hero photograph", () => {
render(<HeroBanner title="Test" />);
expect(
screen.getByRole("img", { name: "Hero illustration" }),
screen.getByRole("heading", { name: "CommunityRule Creative Team" }),
).toBeInTheDocument();
expect(
screen.queryByRole("img", { name: "Hero illustration" }),
).not.toBeInTheDocument();
});
it("renders CTA with the inverse (black) filled palette", () => {
render(<HeroBanner title="Test" ctaText="Get Started" ctaHref="/start" />);
const cta = screen.getAllByRole("link", { name: "Get Started" })[0];
it("sends Talk to a facilitator to the workshops page", () => {
render(<HeroBanner title="Test" />);
const cta = screen.getAllByRole("link", { name: "Talk to a facilitator" })[0];
expect(cta).toHaveAttribute("href", "/workshops");
expect(cta?.className).toContain(
"bg-[var(--color-surface-default-primary)]",
);
});
it("renders Create rule as a button for large screens", () => {
render(<HeroBanner title="Test" />);
expect(
screen.getAllByRole("button", { name: "Create rule" }).length,
).toBeGreaterThan(0);
});
});
+10 -2
View File
@@ -79,10 +79,18 @@ describe("Logo (behavioral tests)", () => {
expect(row?.className).toContain("h-[var(--space-1000)]");
});
it("shows the folder-top wordmark without a breakpoint hide", () => {
it("hides the folder-top wordmark below md", () => {
render(<Logo size="topNavFolderTop" wordmark />);
const wordmark = screen.getByText("CommunityRule");
expect(wordmark.className).not.toMatch(/\bhidden\b/);
expect(wordmark.className).toMatch(/\bhidden\b/);
expect(wordmark.className).toContain("md:block");
});
it("hides the standard header wordmark below sm", () => {
render(<Logo size="topNavHeader" wordmark />);
const wordmark = screen.getByText("CommunityRule");
expect(wordmark.className).toContain("hidden");
expect(wordmark.className).toContain("sm:block");
});
it("renders with different size variants", () => {
+18 -10
View File
@@ -131,7 +131,7 @@ describe("Top header chrome", () => {
);
expect(
screen.getAllByRole("menuitem", {
name: /navigate to use cases page/i,
name: /navigate to workshops page/i,
hidden: true,
}),
).toHaveLength(1);
@@ -146,7 +146,7 @@ describe("Top header chrome", () => {
name: /go to your profile/i,
hidden: true,
}),
).toHaveLength(1);
).toHaveLength(2);
expect(
screen.getAllByRole("button", {
name: /create a new rule/i,
@@ -157,11 +157,18 @@ describe("Top header chrome", () => {
}
});
it("points Workshops at /workshops", () => {
renderWithProviders(<Top folderTop={false} />);
expect(
screen.getByRole("menuitem", { name: /navigate to workshops page/i }),
).toHaveAttribute("href", "/workshops");
});
it("shows Profile instead of Log in when signed in", () => {
renderWithProviders(<Top folderTop={false} loggedIn />);
expect(
screen.getByRole("menuitem", { name: /go to your profile/i }),
).toBeInTheDocument();
screen.getAllByRole("menuitem", { name: /go to your profile/i }).length,
).toBeGreaterThan(0);
expect(
screen.queryByRole("button", { name: /log in to your account/i }),
).not.toBeInTheDocument();
@@ -174,6 +181,7 @@ describe("Top header chrome", () => {
const headerNav = document.querySelector("header nav");
expect(logo?.className).not.toMatch(/\bz-20\b/);
expect(nav?.className).not.toMatch(/\babsolute\b/);
expect(headerNav?.className).toContain("flex");
expect(headerNav?.className).toContain(
"md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]",
);
@@ -183,9 +191,8 @@ describe("Top header chrome", () => {
renderWithProviders(<Top folderTop />);
const tab = document.querySelector(".HeaderTab");
const nav = document.querySelector("[data-top='nav']");
expect(tab?.className).toContain("w-fit");
expect(tab?.className).toContain("sm:w-auto");
expect(tab?.className).toContain("sm:flex-1");
expect(tab?.className).toContain("flex-1");
expect(tab?.className).toContain("justify-between");
expect(nav?.className).toContain("md:absolute");
expect(nav?.className).toContain(
"md:left-[calc(50vw-var(--space-400))]",
@@ -193,16 +200,17 @@ describe("Top header chrome", () => {
expect(nav?.className).not.toContain("ml-auto");
});
it("keeps a single home nav cluster and shows the folder wordmark", () => {
it("keeps a single home nav cluster and hides the folder wordmark below md", () => {
renderWithProviders(<Top folderTop />);
expect(
screen.getAllByRole("menuitem", {
name: /navigate to use cases page/i,
name: /navigate to workshops page/i,
hidden: true,
}),
).toHaveLength(1);
const wordmark = screen.getByText("CommunityRule");
expect(wordmark.className).not.toMatch(/\bhidden\b/);
expect(wordmark.className).toMatch(/\bhidden\b/);
expect(wordmark.className).toContain("md:block");
expect(
screen.getByRole("button", { name: /create a new rule/i }).className,
).toContain("md:text-x-small-label");
+2 -2
View File
@@ -25,8 +25,8 @@ describe("TopWithPathname", () => {
it("renders Profile from the server session before /api/auth/session resolves", () => {
renderWithProviders(<TopWithPathname initialSignedIn />);
expect(
screen.getByRole("menuitem", { name: /go to your profile/i }),
).toBeInTheDocument();
screen.getAllByRole("menuitem", { name: /go to your profile/i }).length,
).toBeGreaterThan(0);
expect(
screen.queryByRole("button", { name: /log in to your account/i }),
).not.toBeInTheDocument();
@@ -83,4 +83,27 @@ describe("ContentLockup", () => {
expect(link.className).not.toMatch(/focus:ring-2/);
expect(link.className).toMatch(/focus-visible:outline/);
});
it("renders the title as h2 when headingLevel is h2", () => {
renderWithProviders(
<ContentLockup
variant="feature"
headingLevel="h2"
title="Tools for the parts that get hard"
/>,
);
expect(
screen.getByRole("heading", {
level: 2,
name: "Tools for the parts that get hard",
}),
).toBeInTheDocument();
expect(
screen.queryByRole("heading", {
level: 1,
name: "Tools for the parts that get hard",
}),
).not.toBeInTheDocument();
});
});