Link every Home feature card to the page that covers it, and keep Ask an organizer from adding a second heading.

This commit is contained in:
adilallo committed 2026-11-12 17:09:48 -07:00
1 parent d3acd9aa9a
commit dc9625c3b2
9 files changed
+119 -49

No files matched your search

+5 -2
View File
@@ -47,9 +47,12 @@ describe("AskOrganizer (behavioral tests)", () => {
it("renders subtitle when provided", () => {
render(<AskOrganizer title="Test" subtitle="Subtitle" />);
const subtitle = screen.getByText("Subtitle");
expect(subtitle).toBeInTheDocument();
expect(subtitle.tagName).toBe("P");
expect(
screen.getByRole("heading", { name: "Subtitle" }),
).toBeInTheDocument();
screen.queryByRole("heading", { name: "Subtitle" }),
).not.toBeInTheDocument();
});
it("renders CTA button with default label", () => {
+14 -24
View File
@@ -47,16 +47,11 @@ describe("FeatureGrid (behavioral tests)", () => {
).not.toBeInTheDocument();
});
it("links the two features that have pages and leaves the others as tiles", () => {
it("links each feature card to the page that covers it", () => {
render(<FeatureGrid title="Test" subtitle="Test" />);
expect(screen.getByText("Choose how you decide")).toBeInTheDocument();
expect(screen.getByText("Plan for conflict")).toBeInTheDocument();
expect(
screen.queryByRole("link", { name: /Choose how you decide/ }),
).not.toBeInTheDocument();
expect(
screen.queryByRole("link", { name: /Plan for conflict/ }),
).not.toBeInTheDocument();
screen.getByRole("link", { name: /Choose how you decide/ }),
).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy");
expect(
screen.getByRole("link", { name: /Name your values/ }),
).toHaveAttribute("href", "/how-it-works");
@@ -66,6 +61,9 @@ describe("FeatureGrid (behavioral tests)", () => {
"href",
"/blog/integrating-new-members-without-dilution",
);
expect(
screen.getByRole("link", { name: /Plan for conflict/ }),
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
});
it("sends Explore the patterns to the templates page", () => {
@@ -96,25 +94,17 @@ describe("FeatureGrid (behavioral tests)", () => {
it("uses Figma invert surface colors on feature cards", () => {
render(<FeatureGrid title="Test" subtitle="Test" />);
expect(
document.querySelector(
'[class*="bg-[var(--color-surface-invert-brand-lavender)]"]',
),
).toBeInTheDocument();
screen.getByRole("link", { name: /Choose how you decide/ }).className,
).toContain("brand-lavender");
expect(
document.querySelector(
'[class*="bg-[var(--color-surface-invert-brand-lime)]"]',
),
).toBeInTheDocument();
screen.getByRole("link", { name: /Name your values/ }).className,
).toContain("brand-lime");
expect(
document.querySelector(
'[class*="bg-[var(--color-surface-invert-brand-rust)]"]',
),
).toBeInTheDocument();
screen.getByRole("link", { name: /Define membership/ }).className,
).toContain("brand-teal");
expect(
document.querySelector(
'[class*="bg-[var(--color-surface-invert-brand-teal)]"]',
),
).toBeInTheDocument();
screen.getByRole("link", { name: /Plan for conflict/ }).className,
).toContain("brand-red");
});
it("marks the content block with the Figma node id", () => {
@@ -84,6 +84,29 @@ describe("ContentLockup", () => {
expect(link.className).toMatch(/focus-visible:outline/);
});
it("renders the ask subtitle as a paragraph, not a heading", () => {
renderWithProviders(
<ContentLockup
variant="ask"
headingLevel="h2"
title="Still have questions?"
subtitle="Get answers from an experienced organizer"
/>,
);
expect(
screen.getByRole("heading", { name: "Still have questions?" }).tagName,
).toBe("H2");
expect(
screen.queryByRole("heading", {
name: "Get answers from an experienced organizer",
}),
).not.toBeInTheDocument();
expect(
screen.getByText("Get answers from an experienced organizer").tagName,
).toBe("P");
});
it("renders the title as h2 when headingLevel is h2", () => {
renderWithProviders(
<ContentLockup