Cleanup, add tests and storybook

This commit is contained in:
adilallo
2026-04-04 10:57:01 -06:00
parent 5d6530e914
commit 427dc44476
26 changed files with 700 additions and 7 deletions
@@ -0,0 +1,38 @@
import { describe, it, expect } from "vitest";
import { renderWithProviders as render, screen } from "../utils/test-utils";
import "@testing-library/jest-dom/vitest";
import DecisionMakingSidebar from "../../app/components/utility/DecisionMakingSidebar";
describe("DecisionMakingSidebar", () => {
const messageBoxItems = [{ id: "1", label: "Consensus" }];
it("renders title and description", () => {
render(
<DecisionMakingSidebar
title="How are decisions made?"
description="Pick approaches for your group."
messageBoxTitle="Select methods"
messageBoxItems={messageBoxItems}
/>,
);
expect(
screen.getByRole("heading", { name: "How are decisions made?" }),
).toBeInTheDocument();
expect(
screen.getByText("Pick approaches for your group."),
).toBeInTheDocument();
});
it("renders InfoMessageBox section", () => {
render(
<DecisionMakingSidebar
title="Decisions"
description="Desc"
messageBoxTitle="Select methods"
messageBoxItems={messageBoxItems}
/>,
);
expect(screen.getByText("Select methods")).toBeInTheDocument();
expect(screen.getByText("Consensus")).toBeInTheDocument();
});
});