Fix save progress bug
This commit is contained in:
@@ -104,7 +104,11 @@ describe("LoginForm", () => {
|
||||
screen.getByRole("button", { name: /send me a magic link/i }),
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(requestMagicLink).toHaveBeenCalledWith("pat@example.com", "/");
|
||||
expect(requestMagicLink).toHaveBeenCalledWith(
|
||||
"pat@example.com",
|
||||
"/",
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
expect(
|
||||
await screen.findByRole("heading", { name: /check your email/i }),
|
||||
@@ -134,6 +138,7 @@ describe("LoginForm", () => {
|
||||
expect(requestMagicLink).toHaveBeenCalledWith(
|
||||
"save@example.com",
|
||||
"/create/community-structure?syncDraft=1",
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
expect(setTransferPendingFlag).toHaveBeenCalled();
|
||||
@@ -152,7 +157,11 @@ describe("LoginForm", () => {
|
||||
screen.getByRole("button", { name: /send me a magic link/i }),
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(requestMagicLink).toHaveBeenCalledWith("a@b.co", "/learn");
|
||||
expect(requestMagicLink).toHaveBeenCalledWith(
|
||||
"a@b.co",
|
||||
"/learn",
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildCreateFlowDraftPayload } from "../../lib/create/buildCreateFlowDraftPayload";
|
||||
|
||||
describe("buildCreateFlowDraftPayload", () => {
|
||||
it("merges state with currentStep when provided", () => {
|
||||
expect(
|
||||
buildCreateFlowDraftPayload(
|
||||
{ title: "Oak Street Collective" },
|
||||
"community-save",
|
||||
),
|
||||
).toEqual({
|
||||
title: "Oak Street Collective",
|
||||
currentStep: "community-save",
|
||||
});
|
||||
});
|
||||
|
||||
it("returns state unchanged when currentStep is omitted", () => {
|
||||
expect(
|
||||
buildCreateFlowDraftPayload({ title: "Oak Street Collective" }),
|
||||
).toEqual({ title: "Oak Street Collective" });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user