Create custom flow UI
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user