Normal
Disabled
-
Home
+
+ Home
+
Home Disabled
diff --git a/stories/cards/Card.stories.js b/stories/cards/Card.stories.js
index 1c4af0a..7f37b5d 100644
--- a/stories/cards/Card.stories.js
+++ b/stories/cards/Card.stories.js
@@ -46,8 +46,7 @@ export default {
export const Default = {
args: {
label: "Label",
- supportText:
- "Members vote to resolve a dispute democratically.",
+ supportText: "Members vote to resolve a dispute democratically.",
recommended: true,
selected: false,
orientation: "horizontal",
@@ -69,8 +68,7 @@ export const HorizontalRecommended = {
export const HorizontalSelected = {
args: {
label: "Label",
- supportText:
- "Members vote to resolve a dispute democratically.",
+ supportText: "Members vote to resolve a dispute democratically.",
recommended: false,
selected: true,
orientation: "horizontal",
@@ -157,8 +155,7 @@ export const AllVariants = {
parameters: {
docs: {
description: {
- story:
- "All four variants: horizontal/vertical × recommended/selected.",
+ story: "All four variants: horizontal/vertical × recommended/selected.",
},
},
},
diff --git a/stories/cards/RuleCard.stories.js b/stories/cards/RuleCard.stories.js
index 3dafa02..9bca2ba 100644
--- a/stories/cards/RuleCard.stories.js
+++ b/stories/cards/RuleCard.stories.js
@@ -75,7 +75,8 @@ export const Expanded = {
backgroundColor: "bg-[#b7d9d5]",
expanded: true,
size: "L",
- logoUrl: "http://localhost:3845/assets/d2513a6ab56f2b2927e8a7c442c06326e7a29541.png",
+ logoUrl:
+ "http://localhost:3845/assets/d2513a6ab56f2b2927e8a7c442c06326e7a29541.png",
logoAlt: "Mutual Aid Mondays",
categories: [
{
@@ -96,9 +97,7 @@ export const Expanded = {
},
{
name: "Communication",
- chipOptions: [
- { id: "comm-1", label: "Signal", state: "Unselected" },
- ],
+ chipOptions: [{ id: "comm-1", label: "Signal", state: "Unselected" }],
onChipClick: (categoryName, chipId) => {
console.log(`Chip clicked: ${categoryName} - ${chipId}`);
},
@@ -122,7 +121,11 @@ export const Expanded = {
name: "Decision-making",
chipOptions: [
{ id: "decision-1", label: "Lazy Consensus", state: "Unselected" },
- { id: "decision-2", label: "Modified Consensus", state: "Unselected" },
+ {
+ id: "decision-2",
+ label: "Modified Consensus",
+ state: "Unselected",
+ },
],
onChipClick: (categoryName, chipId) => {
console.log(`Chip clicked: ${categoryName} - ${chipId}`);
@@ -135,7 +138,11 @@ export const Expanded = {
name: "Conflict management",
chipOptions: [
{ id: "conflict-1", label: "Code of Conduct", state: "Unselected" },
- { id: "conflict-2", label: "Restorative Justice", state: "Unselected" },
+ {
+ id: "conflict-2",
+ label: "Restorative Justice",
+ state: "Unselected",
+ },
],
onChipClick: (categoryName, chipId) => {
console.log(`Chip clicked: ${categoryName} - ${chipId}`);
@@ -232,7 +239,8 @@ export const ExpandedMedium = {
backgroundColor: "bg-[#b7d9d5]",
expanded: true,
size: "M",
- logoUrl: "http://localhost:3845/assets/d2513a6ab56f2b2927e8a7c442c06326e7a29541.png",
+ logoUrl:
+ "http://localhost:3845/assets/d2513a6ab56f2b2927e8a7c442c06326e7a29541.png",
logoAlt: "Mutual Aid Mondays",
categories: [
{
@@ -247,9 +255,7 @@ export const ExpandedMedium = {
},
{
name: "Communication",
- chipOptions: [
- { id: "comm-1", label: "Signal", state: "Unselected" },
- ],
+ chipOptions: [{ id: "comm-1", label: "Signal", state: "Unselected" }],
},
{
name: "Membership",
@@ -261,14 +267,22 @@ export const ExpandedMedium = {
name: "Decision-making",
chipOptions: [
{ id: "decision-1", label: "Lazy Consensus", state: "Unselected" },
- { id: "decision-2", label: "Modified Consensus", state: "Unselected" },
+ {
+ id: "decision-2",
+ label: "Modified Consensus",
+ state: "Unselected",
+ },
],
},
{
name: "Conflict management",
chipOptions: [
{ id: "conflict-1", label: "Code of Conduct", state: "Unselected" },
- { id: "conflict-2", label: "Restorative Justice", state: "Unselected" },
+ {
+ id: "conflict-2",
+ label: "Restorative Justice",
+ state: "Unselected",
+ },
],
},
],
@@ -393,9 +407,7 @@ export const InteractiveStates = {
},
{
name: "Communication",
- chipOptions: [
- { id: "comm-1", label: "Signal", state: "Unselected" },
- ],
+ chipOptions: [{ id: "comm-1", label: "Signal", state: "Unselected" }],
onChipClick: (categoryName, chipId) => {
console.log(`Chip clicked: ${categoryName} - ${chipId}`);
},
diff --git a/stories/controls/Checkbox.stories.js b/stories/controls/Checkbox.stories.js
index b38afe7..2963390 100644
--- a/stories/controls/Checkbox.stories.js
+++ b/stories/controls/Checkbox.stories.js
@@ -47,12 +47,14 @@ export default {
mode: {
control: "select",
options: ["standard", "inverse", "Standard", "Inverse"],
- description: "Visual mode of the checkbox (case-insensitive: accepts both lowercase and PascalCase)",
+ description:
+ "Visual mode of the checkbox (case-insensitive: accepts both lowercase and PascalCase)",
},
state: {
control: "select",
options: ["default", "hover", "focus", "Default", "Hover", "Focus"],
- description: "Interaction state for static display (case-insensitive: accepts both lowercase and PascalCase)",
+ description:
+ "Interaction state for static display (case-insensitive: accepts both lowercase and PascalCase)",
},
disabled: {
control: "boolean",
@@ -215,9 +217,12 @@ export const FigmaPascalCase = () => {
return (
-
Figma PascalCase Props (Standard/Inverse)
+
+ Figma PascalCase Props (Standard/Inverse)
+
- These components accept both PascalCase (from Figma) and lowercase (from codebase) prop values.
+ These components accept both PascalCase (from Figma) and lowercase
+ (from codebase) prop values.
{
-
Mixed Case (backward compatibility)
+
+ Mixed Case (backward compatibility)
+
{
return (
-
Standard Mode - Unselected
+
+ Standard Mode - Unselected
+
{
-
Standard Mode - Selected
+
+ Standard Mode - Selected
+
{
return (
-
Inverse Mode - Unselected
+
+ Inverse Mode - Unselected
+
{
-
Inverse Mode - Selected
+
+ Inverse Mode - Selected
+
{
return (
-
Figma PascalCase Props (Standard/Inverse)
+
+ Figma PascalCase Props (Standard/Inverse)
+
- These components accept both PascalCase (from Figma) and lowercase (from codebase) prop values.
+ These components accept both PascalCase (from Figma) and lowercase
+ (from codebase) prop values.
{
-
Mixed Case (backward compatibility)
+
+ Mixed Case (backward compatibility)
+
(
@@ -76,7 +82,7 @@ export const Sizes = {
export const IconOnly = {
args: {
size: "default",
- showText: false,
+ wordmark: false,
},
render: (args) => (
@@ -123,11 +129,11 @@ export const TopNavContext = {
FolderTop:
-
+
Header:
-
+
@@ -148,13 +154,11 @@ export const CreateFlowContext = {
render: () => (
-
- Create Flow Context
-
+
Create Flow Context
@@ -169,3 +173,30 @@ export const CreateFlowContext = {
},
},
};
+
+export const CreateFlowCompletedInverse = {
+ args: {},
+ render: () => (
+
+
+
+ Completed page (inverse on teal)
+
+
+
+
+
+
+ ),
+ parameters: {
+ docs: {
+ description: {
+ story:
+ "Same size as CreateFlowTopNav with inverse palette, as used on the completed page.",
+ },
+ },
+ },
+};
diff --git a/stories/modals/Create.stories.js b/stories/modals/Create.stories.js
index 8b1a039..7d8ddc8 100644
--- a/stories/modals/Create.stories.js
+++ b/stories/modals/Create.stories.js
@@ -139,7 +139,8 @@ WithCustomHeader.args = {
children: (
- When headerContent is provided, the default title and description are not shown.
+ When headerContent is provided, the default title and description are
+ not shown.
),
diff --git a/stories/navigation/MenuBarItem.stories.js b/stories/navigation/MenuBarItem.stories.js
index 9e5a45f..645bc38 100644
--- a/stories/navigation/MenuBarItem.stories.js
+++ b/stories/navigation/MenuBarItem.stories.js
@@ -136,9 +136,15 @@ export const AllModes = {
Default Mode
- X Small
- Large
- X Large
+
+ X Small
+
+
+ Large
+
+
+ X Large
+
@@ -173,8 +179,7 @@ export const AllModes = {
parameters: {
docs: {
description: {
- story:
- "Complete overview of all menu item modes, sizes, and states.",
+ story: "Complete overview of all menu item modes, sizes, and states.",
},
},
},
diff --git a/stories/navigation/TopNav.stories.js b/stories/navigation/TopNav.stories.js
index c1b6d26..d52a538 100644
--- a/stories/navigation/TopNav.stories.js
+++ b/stories/navigation/TopNav.stories.js
@@ -15,11 +15,13 @@ export default {
argTypes: {
folderTop: {
control: "boolean",
- description: "When true, renders the home page variant with yellow tab container. When false, renders the standard header variant.",
+ description:
+ "When true, renders the home page variant with yellow tab container. When false, renders the standard header variant.",
},
loggedIn: {
control: "boolean",
- description: "Whether the user is logged in (affects displayed elements).",
+ description:
+ "Whether the user is logged in (affects displayed elements).",
},
profile: {
control: "boolean",
@@ -123,8 +125,8 @@ export const StandardInPageContext = {
This demonstrates how the standard header looks in a realistic page
- context. The header maintains its responsive behavior while providing
- navigation for the page content.
+ context. The header maintains its responsive behavior while
+ providing navigation for the page content.
{[1, 2, 3, 4, 5, 6].map((i) => (
diff --git a/stories/type/HeaderLockup.stories.js b/stories/type/HeaderLockup.stories.js
index 4e3aa34..f8175d8 100644
--- a/stories/type/HeaderLockup.stories.js
+++ b/stories/type/HeaderLockup.stories.js
@@ -44,8 +44,7 @@ export const SizeM = {
export const CenterJustified = {
args: {
title: "How should conflicts be resolved?",
- description:
- "You can also combine or add new approaches to the list",
+ description: "You can also combine or add new approaches to the list",
justification: "center",
size: "L",
},
diff --git a/stories/utility/CreateFlowFooter.stories.js b/stories/utility/CreateFlowFooter.stories.js
index 4943f23..086f196 100644
--- a/stories/utility/CreateFlowFooter.stories.js
+++ b/stories/utility/CreateFlowFooter.stories.js
@@ -20,7 +20,8 @@ export default {
},
secondButton: {
control: false,
- description: "The second button (typically Next) to display on the right side",
+ description:
+ "The second button (typically Next) to display on the right side",
},
},
tags: ["autodocs"],
diff --git a/tests/components/CompletedPage.test.tsx b/tests/components/CompletedPage.test.tsx
new file mode 100644
index 0000000..51d8ed2
--- /dev/null
+++ b/tests/components/CompletedPage.test.tsx
@@ -0,0 +1,72 @@
+import React from "react";
+import { describe, it, expect } from "vitest";
+import { renderWithProviders as render, screen } from "../utils/test-utils";
+import "@testing-library/jest-dom/vitest";
+import CompletedPage from "../../app/create/completed/page";
+
+describe("CompletedPage", () => {
+ it("renders without crashing", () => {
+ render( );
+ expect(screen.getByRole("heading", { level: 1 })).toBeInTheDocument();
+ });
+
+ it("renders HeaderLockup with expected title", () => {
+ render( );
+ expect(
+ screen.getByRole("heading", {
+ name: "Mutual Aid Mondays",
+ }),
+ ).toBeInTheDocument();
+ });
+
+ it("renders HeaderLockup with expected description", () => {
+ render( );
+ expect(
+ screen.getByText(
+ /Mutual Aid Monday is a grassroots community in Denver, founded in November 2020 by Kelsang Virya, dedicated to supporting neighbors experiencing homelessness./i,
+ ),
+ ).toBeInTheDocument();
+ });
+
+ it("renders Community Rule document with section labels", () => {
+ render( );
+ expect(screen.getByText("Values")).toBeInTheDocument();
+ expect(screen.getByText("Communication")).toBeInTheDocument();
+ expect(screen.getByText("Membership")).toBeInTheDocument();
+ expect(screen.getByText("Decision-making")).toBeInTheDocument();
+ expect(screen.getByText("Conflict management")).toBeInTheDocument();
+ });
+
+ it("renders document entry titles", () => {
+ render( );
+ expect(screen.getByText("Solidarity Forever")).toBeInTheDocument();
+ expect(screen.getByText("Shared Leadership")).toBeInTheDocument();
+ expect(screen.getByText("Organizing Offline")).toBeInTheDocument();
+ expect(screen.getByText("Circular Food Systems")).toBeInTheDocument();
+ });
+
+ it("renders toast alert when page loads", () => {
+ render( );
+ expect(
+ screen.getByText(
+ "This is what folks see when you share your CommunityRule",
+ ),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ "Your group can use this document as an operating manual.",
+ ),
+ ).toBeInTheDocument();
+ });
+
+ it("renders toast with role status", () => {
+ render( );
+ const statusRegions = screen.getAllByRole("status");
+ expect(statusRegions.length).toBeGreaterThanOrEqual(1);
+ expect(
+ statusRegions.some((el) =>
+ el.textContent?.includes("This is what folks see when you share"),
+ ),
+ ).toBe(true);
+ });
+});
diff --git a/tests/components/Logo.test.tsx b/tests/components/Logo.test.tsx
index ad6fde4..ffcbd66 100644
--- a/tests/components/Logo.test.tsx
+++ b/tests/components/Logo.test.tsx
@@ -1,7 +1,7 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
-import Logo from "../../app/components/icons/Logo";
+import Logo from "../../app/components/asset/logo";
import {
componentTestSuite,
ComponentTestSuiteConfig,
@@ -45,13 +45,22 @@ describe("Logo (behavioral tests)", () => {
expect(screen.getByText("CommunityRule")).toBeInTheDocument();
});
- it("hides text when showText is false", () => {
- const { container } = render( );
+ it("hides wordmark when wordmark is false", () => {
+ const { container } = render( );
const textElement = container.querySelector(".hidden");
expect(textElement).toBeInTheDocument();
expect(screen.getByAltText("CommunityRule Logo Icon")).toBeInTheDocument();
});
+ it("applies inverse palette styling when palette is inverse", () => {
+ render( );
+ const link = screen.getByRole("link");
+ const textEl = link.querySelector(".font-bricolage-grotesque");
+ const img = link.querySelector("img");
+ expect(textEl).toHaveClass("text-[var(--color-content-invert-primary)]");
+ expect(img).toHaveClass("brightness-0");
+ });
+
it("renders with different size variants", () => {
const { rerender } = render( );
expect(screen.getByRole("link")).toBeInTheDocument();
diff --git a/tests/pages/user-journey.test.jsx b/tests/pages/user-journey.test.jsx
index e1bcbbc..955526f 100644
--- a/tests/pages/user-journey.test.jsx
+++ b/tests/pages/user-journey.test.jsx
@@ -17,9 +17,7 @@ vi.mock("next/dynamic", () => {
function DynamicWrapper(props) {
const [Component, setComponent] = React.useState(null);
React.useEffect(() => {
- importFn().then((mod) =>
- setComponent(() => mod.default || mod),
- );
+ importFn().then((mod) => setComponent(() => mod.default || mod));
}, []);
if (!Component) {
return options?.loading ? options.loading() : null;