Link every Home feature card, keep one heading, and call the emailed link a login link #109
No files matched your search
@@ -24,6 +24,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
),
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-lavender)]",
|
||||
iconSrc: getAssetPath(featureIconPath("git-branch")),
|
||||
href: t("featureGrid.features.decisionMaking.href") || undefined,
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]",
|
||||
@@ -33,26 +34,27 @@ const FeatureGridContainer = memo<FeatureGridProps>(
|
||||
),
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-lime)]",
|
||||
iconSrc: getAssetPath(featureIconPath("arrow-left-right")),
|
||||
href: "/how-it-works",
|
||||
href: t("featureGrid.features.valuesAlignment.href") || undefined,
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-rust)]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
|
||||
title: t("pages.home.featureGrid.features.membershipGuidance.title"),
|
||||
description: t(
|
||||
"pages.home.featureGrid.features.membershipGuidance.description",
|
||||
),
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-rust)]",
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-teal)]",
|
||||
iconSrc: getAssetPath(featureIconPath("door-open")),
|
||||
href: "/blog/integrating-new-members-without-dilution",
|
||||
href: t("featureGrid.features.membershipGuidance.href") || undefined,
|
||||
},
|
||||
{
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
|
||||
backgroundColor: "bg-[var(--color-surface-invert-brand-red)]",
|
||||
title: t("pages.home.featureGrid.features.conflictResolution.title"),
|
||||
description: t(
|
||||
"pages.home.featureGrid.features.conflictResolution.description",
|
||||
),
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-teal)]",
|
||||
descriptionClassName: "text-[var(--color-content-invert-brand-red)]",
|
||||
iconSrc: getAssetPath(featureIconPath("message-square-share")),
|
||||
href: t("featureGrid.features.conflictResolution.href") || undefined,
|
||||
},
|
||||
],
|
||||
[t],
|
||||
|
||||
@@ -51,7 +51,13 @@ function ContentLockupView({
|
||||
</TitleTag>
|
||||
) : null}
|
||||
</div>
|
||||
{subtitle ? <h2 className={styles.subtitle}>{subtitle}</h2> : null}
|
||||
{subtitle ? (
|
||||
variant === "ask" || variant === "ask-inverse" ? (
|
||||
<p className={styles.subtitle}>{subtitle}</p>
|
||||
) : (
|
||||
<h2 className={styles.subtitle}>{subtitle}</h2>
|
||||
)
|
||||
) : null}
|
||||
{(variant === "modal" || variant === "login") && description && (
|
||||
<p className={styles.description}>{description}</p>
|
||||
)}
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
{
|
||||
"_comment": "FeatureGrid component defaults (shared across pages). Explore the patterns goes to /templates. Feature cards link only when a matching page exists.",
|
||||
"_comment": "FeatureGrid component defaults (shared across pages). Explore the patterns goes to /templates. Each feature card links to the page that covers it.",
|
||||
"linkText": "Explore the patterns",
|
||||
"linkHref": "/templates",
|
||||
"ariaLabel": "Feature tools and services",
|
||||
"features": {
|
||||
"decisionMaking": {
|
||||
"ariaLabel": "Choose how you decide"
|
||||
"ariaLabel": "Choose how you decide",
|
||||
"href": "/blog/making-decisions-without-hierarchy"
|
||||
},
|
||||
"valuesAlignment": {
|
||||
"ariaLabel": "Name your values"
|
||||
"ariaLabel": "Name your values",
|
||||
"href": "/how-it-works"
|
||||
},
|
||||
"membershipGuidance": {
|
||||
"ariaLabel": "Define membership"
|
||||
"ariaLabel": "Define membership",
|
||||
"href": "/blog/integrating-new-members-without-dilution"
|
||||
},
|
||||
"conflictResolution": {
|
||||
"ariaLabel": "Plan for conflict"
|
||||
"ariaLabel": "Plan for conflict",
|
||||
"href": "/blog/resolving-active-conflicts"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
},
|
||||
"login": {
|
||||
"title": "Log in",
|
||||
"description": "Enter your email and we'll send you a magic link to sign in. No password needed!"
|
||||
"description": "Enter your email and we'll send you a login link. No password needed."
|
||||
},
|
||||
"invite": {
|
||||
"title": "Invitation",
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
"title": "Log in to CommunityRule",
|
||||
"subtitle": "Enter your email and we'll send you a login link. No password needed.",
|
||||
"saveProgressTitle": "Save your progress?",
|
||||
"saveProgressSubtitle": "We need your email to save, and we'll send you a magic link to log in. If you don't save now you could lose your progress.",
|
||||
"saveProgressSubtitle": "We need your email to save, and we'll send you a login link. If you don't save now you could lose your progress.",
|
||||
"keepRuleTitle": "Log in to keep this rule on your profile",
|
||||
"keepRuleSubtitle": "Enter your email and we'll send a magic link. Open it on this same browser to attach the rule to your account. You can also continue without saving.",
|
||||
"keepRuleSubtitle": "Enter your email and we'll send a login link. Open it on this same browser to attach the rule to your account. You can also continue without saving.",
|
||||
"inviteTitle": "Log in to invite your members",
|
||||
"inviteSubtitle": "Only a logged-in person can invite. Enter your email and we’ll send you a magic link to log in.",
|
||||
"inviteSubtitle": "Only a logged-in person can invite. Enter your email and we’ll send you a login link.",
|
||||
"backToYourRule": "← Back to your Rule",
|
||||
"continueWithoutSaving": "Continue without saving",
|
||||
"emailLabel": "Email address",
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -173,6 +173,18 @@ describe("Top header chrome", () => {
|
||||
).toHaveAttribute("href", "/workshops");
|
||||
});
|
||||
|
||||
it("labels the signed-out control Log in, not Sign in", () => {
|
||||
renderWithProviders(<Top folderTop={false} />);
|
||||
const logInControls = screen.getAllByRole("menuitem", {
|
||||
name: /log in to your account/i,
|
||||
});
|
||||
expect(logInControls.length).toBeGreaterThan(0);
|
||||
logInControls.forEach((control) => {
|
||||
expect(control).toHaveTextContent("Log in");
|
||||
});
|
||||
expect(screen.queryByText("Sign in")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows Profile instead of Log in when signed in", () => {
|
||||
renderWithProviders(<Top folderTop={false} loggedIn />);
|
||||
expect(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -59,13 +59,7 @@ test.describe("Critical User Journeys", () => {
|
||||
];
|
||||
|
||||
for (const feature of features) {
|
||||
const featureElement = page.locator(`text=${feature}`);
|
||||
if (
|
||||
(await featureElement.count()) > 0 &&
|
||||
(await featureElement.first().isVisible())
|
||||
) {
|
||||
await featureElement.first().click();
|
||||
}
|
||||
await expect(page.getByText(feature).first()).toBeVisible();
|
||||
}
|
||||
|
||||
// 8. User reads testimonial
|
||||
@@ -134,16 +128,16 @@ test.describe("Critical User Journeys", () => {
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Choose how you decide" }),
|
||||
).toHaveCount(0);
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Plan for conflict" }),
|
||||
).toHaveCount(0);
|
||||
).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy");
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Name your values" }),
|
||||
).toHaveAttribute("href", "/how-it-works");
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Define membership" }),
|
||||
).toHaveAttribute("href", "/blog/integrating-new-members-without-dilution");
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Plan for conflict" }),
|
||||
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
|
||||
await expect(
|
||||
featureSection.getByRole("link", { name: "Explore the patterns" }),
|
||||
).toHaveAttribute("href", "/templates");
|
||||
|
||||
@@ -124,6 +124,53 @@ describe("Page", () => {
|
||||
name: "Explore the patterns",
|
||||
});
|
||||
expect(learnMore[0]).toHaveAttribute("href", "/templates");
|
||||
expect(
|
||||
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");
|
||||
expect(
|
||||
screen.getByRole("link", { name: /Define membership/ }),
|
||||
).toHaveAttribute(
|
||||
"href",
|
||||
"/blog/integrating-new-members-without-dilution",
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("link", { name: /Plan for conflict/ }),
|
||||
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
|
||||
});
|
||||
|
||||
test("keeps a single page heading and leaves Card Steps unlinked", async () => {
|
||||
render(<Page />);
|
||||
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 1, name: "Build structure" }),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getByRole("heading", {
|
||||
name: "Tools for the parts that get hard",
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1);
|
||||
expect(
|
||||
screen.getByRole("heading", {
|
||||
level: 2,
|
||||
name: "Tools for the parts that get hard",
|
||||
}).tagName,
|
||||
).toBe("H2");
|
||||
expect(
|
||||
screen.getByRole("heading", { name: "Still have questions?" }).tagName,
|
||||
).toBe("H2");
|
||||
expect(
|
||||
screen.queryByRole("link", {
|
||||
name: /See what has worked for other communities/,
|
||||
}),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("renders ask organizer section with correct data", () => {
|
||||
|
||||
@@ -187,6 +187,7 @@ describe("Page Flow Integration", () => {
|
||||
|
||||
const headings = screen.getAllByRole("heading");
|
||||
expect(headings.length).toBeGreaterThan(4);
|
||||
expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1);
|
||||
|
||||
const mainContent = screen.getByText(
|
||||
/Strong communities agree on four things early/,
|
||||
|
||||
Reference in new issue
Block a user