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

+54 -37
View File
@@ -92,30 +92,67 @@ describe("flowSteps", () => {
expect(getPreviousStep("communication-methods", opts)).toBe("core-values");
});
it("useWithoutChangesIdentityOnly walks name → description → photo → final-review", () => {
const opts = { useWithoutChangesIdentityOnly: true } as const;
expect(getNextStep("community-name", opts)).toBe("community-context");
expect(getNextStep("community-context", opts)).toBe("community-upload");
expect(getNextStep("community-size", opts)).toBe("community-upload");
expect(getNextStep("setup-questions", opts)).toBe("community-upload");
expect(getNextStep("community-upload", opts)).toBe("final-review");
expect(getNextStep("final-review", opts)).toBe("confirm-stakeholders");
expect(getPreviousStep("community-context", opts)).toBe("community-name");
expect(getPreviousStep("community-upload", opts)).toBe("community-context");
expect(getPreviousStep("final-review", opts)).toBe("community-upload");
expect(getPreviousStep("community-name", opts)).toBeNull();
it("templatePathMode customize skips community setup and walks the decks", () => {
const opts = { templatePathMode: "customize" as const };
expect(getNextStep("informational", opts)).toBe("core-values");
expect(getNextStep("community-name", opts)).toBe("core-values");
expect(getNextStep("setup-questions", opts)).toBe("core-values");
expect(getNextStep("core-values", opts)).toBe("communication-methods");
expect(getNextStep("conflict-management", opts)).toBe("final-review");
expect(getPreviousStep("core-values", opts)).toBeNull();
expect(getPreviousStep("final-review", opts)).toBe("conflict-management");
});
it("useWithoutChangesIdentityOnly composes with skipCommunitySave", () => {
it("templatePathMode useWithoutChanges skips community setup and 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("core-values", opts)).toBe("final-review");
expect(getNextStep("final-review", opts)).toBe("confirm-stakeholders");
expect(getPreviousStep("final-review", opts)).toBeNull();
});
it("templatePathMode composes with skipCommunitySave", () => {
const opts = {
skipCommunitySave: true,
useWithoutChangesIdentityOnly: true,
} as const;
templatePathMode: "useWithoutChanges" as const,
};
expect(getNextStep("community-upload", opts)).toBe("final-review");
expect(getPreviousStep("final-review", opts)).toBe("community-upload");
expect(getPreviousStep("final-review", opts)).toBeNull();
});
it("resolveCreateFlowBackTarget returns template review when use-without slug is set on final-review", () => {
it("resolveCreateFlowBackTarget returns template review from use-without-changes final-review", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
{ templatePathMode: "useWithoutChanges" },
"mutual-aid-mondays",
),
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
});
it("resolveCreateFlowBackTarget returns template review from customize values", () => {
expect(
resolveCreateFlowBackTarget(
"core-values",
{ templatePathMode: "customize" },
"mutual-aid-mondays",
),
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
});
it("resolveCreateFlowBackTarget sends customize final-review back to the conflict deck", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
{ templatePathMode: "customize" },
"mutual-aid-mondays",
),
).toEqual({ kind: "step", step: "conflict-management" });
});
it("resolveCreateFlowBackTarget returns template review when a slug is set without a mode", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
@@ -125,26 +162,6 @@ describe("flowSteps", () => {
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
});
it("resolveCreateFlowBackTarget sends identity-only community-name back to template review", () => {
expect(
resolveCreateFlowBackTarget(
"community-name",
{ useWithoutChangesIdentityOnly: true },
"mutual-aid-mondays",
),
).toEqual({ kind: "templateReview", slug: "mutual-aid-mondays" });
});
it("resolveCreateFlowBackTarget uses photo step behind final-review on the identity-only path", () => {
expect(
resolveCreateFlowBackTarget(
"final-review",
{ useWithoutChangesIdentityOnly: true },
"mutual-aid-mondays",
),
).toEqual({ kind: "step", step: "community-upload" });
});
it("resolveCreateFlowBackTarget falls back to linear previous when slug is absent", () => {
expect(
resolveCreateFlowBackTarget("confirm-stakeholders", undefined, undefined),