Walk Create Community through the Figma screens and restore a chosen logo after reload, so a guest can leave without saving until they reach the email step.
This commit is contained in:
1 parent
ca1f58a50c
commit
2348a9e94f
61 files changed
+1110
-421
No files matched your search
@@ -22,6 +22,23 @@ function ReviewWithTitle({ title }: { title: string }) {
|
||||
return <CommunityReviewScreen />;
|
||||
}
|
||||
|
||||
function ReviewWithAnswers() {
|
||||
const { state, updateState } = useCreateFlow();
|
||||
const seededRef = React.useRef(false);
|
||||
useEffect(() => {
|
||||
if (seededRef.current) return;
|
||||
seededRef.current = true;
|
||||
updateState({
|
||||
title: "Garden Club",
|
||||
selectedOrganizationTypeIds: ["mutualAid"],
|
||||
selectedCommunitySizeIds: ["thirteenToOneHundred"],
|
||||
selectedMaturityIds: ["established"],
|
||||
});
|
||||
}, [updateState]);
|
||||
if (state.title !== "Garden Club") return null;
|
||||
return <CommunityReviewScreen />;
|
||||
}
|
||||
|
||||
describe("CommunityReviewScreen", () => {
|
||||
beforeEach(() => {
|
||||
testRouter.replace.mockReset();
|
||||
@@ -53,7 +70,7 @@ describe("CommunityReviewScreen", () => {
|
||||
render(<ReviewWithTitle title="Garden Club" />);
|
||||
expect(
|
||||
screen.getByRole("heading", {
|
||||
name: "Your community is added - congrats!",
|
||||
name: "Here is your community",
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
@@ -62,7 +79,7 @@ describe("CommunityReviewScreen", () => {
|
||||
render(<ReviewWithTitle title="Garden Club" />);
|
||||
expect(
|
||||
screen.getByText(
|
||||
/In the next section, we'll go through membership, decision-making, conflict resolution, and community values and create a custom operating manual for your organization based on the specifics you just shared./i,
|
||||
/Next you will write your Rule/i,
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
@@ -81,6 +98,17 @@ describe("CommunityReviewScreen", () => {
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("lists kind, size, and maturity with Edit controls", () => {
|
||||
render(<ReviewWithAnswers />);
|
||||
expect(screen.getByText("Kind")).toBeInTheDocument();
|
||||
expect(screen.getByText("Mutual aid")).toBeInTheDocument();
|
||||
expect(screen.getByText("Size")).toBeInTheDocument();
|
||||
expect(screen.getByText("13 to 100 people")).toBeInTheDocument();
|
||||
expect(screen.getByText("Maturity")).toBeInTheDocument();
|
||||
expect(screen.getByText("Established")).toBeInTheDocument();
|
||||
expect(screen.getAllByRole("button", { name: "Edit" })).toHaveLength(3);
|
||||
});
|
||||
|
||||
it("renders Rule as a button when a community name exists", () => {
|
||||
render(<ReviewWithTitle title="Garden Club" />);
|
||||
const buttons = screen.getAllByRole("button");
|
||||
|
||||
Reference in new issue
Block a user