Let anyone finish a Rule without an account or email.

Continue on final review and Finish without inviting no longer open a login wall. The header stays Exit until Save your progress is done, and Send invitations is the only invite-path login.
This commit is contained in:
adilallo committed 2026-11-23 14:48:01 -07:00
1 parent 077942166c
commit 0535f6f167
14 files changed
+377 -225

No files matched your search

+21 -7
View File
@@ -259,24 +259,38 @@ describe("flowSteps", () => {
expect(parseReviewReturnSearchParam(null)).toBeNull();
});
it("offers Save and exit from community-save through final-review and on edit-rule", () => {
it("offers Save and exit from community-save only after Save your progress", () => {
expect(shouldOfferCreateFlowSaveAndExit("informational")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("community-name")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("community-structure")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("setup-questions")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("community-upload")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("community-save")).toBe(true);
expect(shouldOfferCreateFlowSaveAndExit("review")).toBe(true);
expect(shouldOfferCreateFlowSaveAndExit("final-review")).toBe(true);
expect(shouldOfferCreateFlowSaveAndExit("edit-rule")).toBe(true);
expect(shouldOfferCreateFlowSaveAndExit("community-save")).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("community-save", null)).toBe(
false,
);
expect(shouldOfferCreateFlowSaveAndExit("final-review", null)).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("edit-rule", null)).toBe(false);
expect(
shouldOfferCreateFlowSaveAndExit("community-save", { id: "user-1" }),
).toBe(true);
expect(
shouldOfferCreateFlowSaveAndExit("review", { id: "user-1" }),
).toBe(true);
expect(
shouldOfferCreateFlowSaveAndExit("final-review", { id: "user-1" }),
).toBe(true);
expect(
shouldOfferCreateFlowSaveAndExit("edit-rule", { id: "user-1" }),
).toBe(true);
});
it("offers Save & Exit on completed only for guests", () => {
it("keeps Exit on completed for guests and signed-in users", () => {
expect(shouldOfferCreateFlowSaveAndExit("completed")).toBe(false);
expect(
shouldOfferCreateFlowSaveAndExit("completed", { id: "user-1" }),
).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit("completed", null)).toBe(true);
expect(shouldOfferCreateFlowSaveAndExit("completed", null)).toBe(false);
expect(shouldOfferCreateFlowSaveAndExit(null)).toBe(false);
});
@@ -192,7 +192,7 @@ describe("useCreateFlowFinalize", () => {
});
expect(onGuestPublished).toHaveBeenCalledWith({ skippedInvites: true });
expect(openLogin).not.toHaveBeenCalled();
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBe("1");
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBeNull();
expect(router.push).toHaveBeenCalledWith(
`/create/completed?${CREATE_FLOW_COMPLETED_CELEBRATE_QUERY}=${CREATE_FLOW_COMPLETED_CELEBRATE_VALUE}`,
);
@@ -304,7 +304,7 @@ describe("useCreateFlowFinalize", () => {
});
expect(onGuestPublished).toHaveBeenCalledWith({ skippedInvites: false });
expect(openLogin).not.toHaveBeenCalled();
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBe("1");
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBeNull();
expect(router.push).toHaveBeenCalledWith(
`/create/completed?${CREATE_FLOW_COMPLETED_CELEBRATE_QUERY}=${CREATE_FLOW_COMPLETED_CELEBRATE_VALUE}`,
);
@@ -480,7 +480,7 @@ describe("useCreateFlowFinalize", () => {
summary: "Published summary",
document: {},
});
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBe("1");
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBeNull();
expect(router.push).toHaveBeenCalledWith("/create/completed");
});