Let guests keep a published rule via Save & Exit and a post-finalize sign-in prompt.
Email is optional so they can continue without saving; skip from Save & Exit leaves the flow instead of returning to completed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { describe, it, expect, beforeEach } from "vitest";
|
||||
import {
|
||||
CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY,
|
||||
clearPendingKeepRuleLogin,
|
||||
hasPendingKeepRuleLogin,
|
||||
writePendingKeepRuleLogin,
|
||||
} from "../../lib/create/pendingKeepRuleLogin";
|
||||
|
||||
describe("pendingKeepRuleLogin", () => {
|
||||
beforeEach(() => {
|
||||
sessionStorage.clear();
|
||||
});
|
||||
|
||||
it("writes, reads, and clears the session flag", () => {
|
||||
expect(hasPendingKeepRuleLogin()).toBe(false);
|
||||
writePendingKeepRuleLogin();
|
||||
expect(sessionStorage.getItem(CREATE_FLOW_PENDING_KEEP_RULE_LOGIN_KEY)).toBe(
|
||||
"1",
|
||||
);
|
||||
expect(hasPendingKeepRuleLogin()).toBe(true);
|
||||
clearPendingKeepRuleLogin();
|
||||
expect(hasPendingKeepRuleLogin()).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user