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.
This commit is contained in:
adilallo committed 2026-11-09 17:34:33 -07:00
1 parent 53d236d0d5
commit 6498d52541
37 files changed
+1450 -733

No files matched your search

+33
View File
@@ -332,4 +332,37 @@ describe("Rule Component", () => {
expect(screen.queryByText("RECOMMENDED")).not.toBeInTheDocument();
});
it("renders name, logo upload, and description fields when hasNameField is set", () => {
const onNameChange = vi.fn();
const onDescriptionChange = vi.fn();
const onLogoClick = vi.fn();
render(
<Rule
title=""
interactive={false}
expanded
hasNameField
nameValue=""
nameLabel="Community name"
namePlaceholder="Enter community name"
onNameChange={onNameChange}
descriptionLabel="What does your community do?"
descriptionPlaceholder="Describe your community"
descriptionHelperText="Optional"
onDescriptionChange={onDescriptionChange}
onLogoClick={onLogoClick}
logoUploadAriaLabel="Add a logo"
/>,
);
expect(screen.getByLabelText("Community name")).toBeInTheDocument();
expect(screen.getByPlaceholderText("Enter community name")).toBeInTheDocument();
expect(
screen.getByLabelText("What does your community do?"),
).toBeInTheDocument();
expect(screen.getByText("Optional")).toBeInTheDocument();
fireEvent.click(screen.getByRole("button", { name: "Add a logo" }));
expect(onLogoClick).toHaveBeenCalledTimes(1);
});
});