Create custom flow UI

This commit is contained in:
adilallo
2026-04-17 22:25:24 -06:00
parent eedb70f9f3
commit 36dcb79870
38 changed files with 1227 additions and 250 deletions
+12 -18
View File
@@ -2,27 +2,12 @@ import { describe, it, expect } from "vitest";
import { migrateLegacyCreateFlowState } from "../../lib/create/migrateLegacyCreateFlowState";
describe("migrateLegacyCreateFlowState", () => {
it("maps communityReflection to communitySaveEmail when save email empty", () => {
it("passes through object payloads", () => {
const out = migrateLegacyCreateFlowState({
title: "T",
communityReflection: "old@example.com",
});
expect(out.communitySaveEmail).toBe("old@example.com");
expect("communityReflection" in out).toBe(false);
});
it("does not overwrite existing communitySaveEmail", () => {
const out = migrateLegacyCreateFlowState({
communityReflection: "old@example.com",
communitySaveEmail: "kept@example.com",
});
expect(out.communitySaveEmail).toBe("kept@example.com");
});
it("rewrites currentStep slug", () => {
const out = migrateLegacyCreateFlowState({
currentStep: "community-reflection",
currentStep: "community-save",
});
expect(out.title).toBe("T");
expect(out.currentStep).toBe("community-save");
});
@@ -30,4 +15,13 @@ describe("migrateLegacyCreateFlowState", () => {
expect(migrateLegacyCreateFlowState(null)).toEqual({});
expect(migrateLegacyCreateFlowState(undefined)).toEqual({});
});
it("renames legacy right-rail step to decision-approaches", () => {
const out = migrateLegacyCreateFlowState({
currentStep: "right-rail",
title: "T",
});
expect(out.currentStep).toBe("decision-approaches");
expect(out.title).toBe("T");
});
});