Files
community-rule/tests/pages/create-templates.test.tsx
T
adilallo 6498d52541 Skip setup questions on the template path and collect name, photo, and description without recommendations.
Customize opens a dialog then walks the template decks; Use without changes lands on final review with Has Name Field. Template cards stay first, the engine is not called, and the catalog no longer shows a recommended tag.
2026-11-09 17:34:33 -07:00

36 lines
1.1 KiB
TypeScript

import { describe, expect, test } from "vitest";
import {
renderWithProviders as render,
screen,
} from "../utils/test-utils";
import { CreateFlowTemplatesPageClient } from "../../app/(app)/create/templates/CreateFlowTemplatesPageClient";
import { GOVERNANCE_TEMPLATE_CATALOG } from "../../lib/templates/governanceTemplateCatalog";
import "@testing-library/jest-dom/vitest";
describe("Create flow templates picker", () => {
test("renders catalog cards as in-flow template review links", () => {
render(
<CreateFlowTemplatesPageClient
initialGridEntries={GOVERNANCE_TEMPLATE_CATALOG}
/>,
);
expect(
screen.getByRole("heading", { name: "Templates", level: 1 }),
).toBeInTheDocument();
expect(
screen.getByRole("link", { name: /Consensus/i }),
).toHaveAttribute(
"href",
"/create/review-template/consensus?fromFlow=1",
);
expect(
screen.getByRole("link", { name: /Solidarity Network/i }),
).toHaveAttribute(
"href",
"/create/review-template/solidarity-network?fromFlow=1",
);
expect(screen.queryByText("RECOMMENDED")).not.toBeInTheDocument();
});
});