Run Use without changes through name, description, and photo so final review never holds an editable field.

This commit is contained in:
adilallo committed 2026-11-24 21:05:40 -07:00
1 parent 53e27ef122
commit 6bf890fa78
13 files changed
+156 -145

No files matched your search

+35 -11
View File
@@ -113,29 +113,43 @@ describe("flowSteps", () => {
expect(getPreviousStep("final-review", opts)).toBe("conflict-management");
});
it("templatePathMode useWithoutChanges skips community setup and the decks", () => {
it("templatePathMode useWithoutChanges runs name, description, and photo, then skips the decks", () => {
const opts = { templatePathMode: "useWithoutChanges" as const };
expect(getNextStep("informational", opts)).toBe("final-review");
expect(getNextStep("community-name", opts)).toBe("final-review");
expect(getNextStep("setup-questions", opts)).toBe("final-review");
expect(getNextStep("informational", opts)).toBe("community-name");
expect(getNextStep("community-name", opts)).toBe("community-context");
expect(getNextStep("community-context", opts)).toBe("community-upload");
expect(getNextStep("community-upload", opts)).toBe("final-review");
expect(getNextStep("setup-questions", opts)).toBe("community-upload");
expect(getNextStep("core-values", opts)).toBe("final-review");
expect(getNextStep("final-review", opts)).toBe("confirm-stakeholders");
expect(getPreviousStep("final-review", opts)).toBeNull();
expect(getPreviousStep("community-name", opts)).toBeNull();
expect(getPreviousStep("community-context", opts)).toBe("community-name");
expect(getPreviousStep("community-upload", opts)).toBe("community-context");
expect(getPreviousStep("final-review", opts)).toBe("community-upload");
});
it("templatePathSkippedCommunityRedirect resumes setup steps and leaves decks", () => {
expect(
templatePathSkippedCommunityRedirect("setup-questions", "customize"),
).toBe("core-values");
expect(
templatePathSkippedCommunityRedirect("community-name", "customize"),
).toBe("core-values");
expect(templatePathSkippedCommunityRedirect("review", "customize")).toBe(
"core-values",
);
expect(
templatePathSkippedCommunityRedirect(
"setup-questions",
"useWithoutChanges",
),
).toBe("community-name");
expect(
templatePathSkippedCommunityRedirect(
"community-name",
"useWithoutChanges",
),
).toBe("final-review");
).toBeNull();
expect(
templatePathSkippedCommunityRedirect("core-values", "useWithoutChanges"),
).toBeNull();
@@ -153,17 +167,27 @@ describe("flowSteps", () => {
templatePathMode: "useWithoutChanges" as const,
};
expect(getNextStep("community-upload", opts)).toBe("final-review");
expect(getPreviousStep("final-review", opts)).toBeNull();
expect(getPreviousStep("final-review", opts)).toBe("community-upload");
});
it("resolveCreateFlowBackTarget returns template review from use-without-changes final-review", () => {
it("resolveCreateFlowBackTarget returns template review from use-without-changes name", () => {
expect(
resolveCreateFlowBackTarget(
"community-name",
{ templatePathMode: "useWithoutChanges" },
"mutual-aid-mondays",
),
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
});
it("resolveCreateFlowBackTarget returns photo from use-without-changes final-review", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
{ templatePathMode: "useWithoutChanges" },
"mutual-aid-mondays",
),
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
).toEqual({ kind: "step", step: "community-upload" });
});
it("resolveCreateFlowBackTarget returns template review from customize values", () => {
@@ -186,10 +210,10 @@ describe("flowSteps", () => {
).toEqual({ kind: "step", step: "conflict-management" });
});
it("resolveCreateFlowBackTarget returns template review when a slug is set without a mode", () => {
it("resolveCreateFlowBackTarget returns template review from name when a slug is set without a mode", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
"community-name",
undefined,
"mutual-aid-mondays",
),