Give builder fields persistent labels, treat description as optional, and validate save-progress email with a real form.
Name stays required; description is a labelled optional textarea. Email uses native validity and form submit. Drop the dead workshop link and fix a few copy errors. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
CREATE_FLOW_COMMUNITY_SAVE_FORM_ID,
|
||||
CREATE_FLOW_SYNC_DRAFT_QUERY,
|
||||
CREATE_FLOW_SYNC_DRAFT_VALUE,
|
||||
CREATE_ROUTES,
|
||||
@@ -42,4 +43,10 @@ describe("createFlowPaths (CR-92 §2)", () => {
|
||||
expect(CREATE_ROUTES.review).toBe("/create/review");
|
||||
expect(CREATE_ROUTES.completed).toBe("/create/completed");
|
||||
});
|
||||
|
||||
it("exposes a stable form id for the save-progress email step", () => {
|
||||
expect(CREATE_FLOW_COMMUNITY_SAVE_FORM_ID).toBe(
|
||||
"create-flow-community-save",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { isValidCreateFlowSaveEmail } from "../../lib/create/isValidCreateFlowSaveEmail";
|
||||
|
||||
describe("isValidCreateFlowSaveEmail", () => {
|
||||
it("rejects empty, whitespace, and non-string values", () => {
|
||||
expect(isValidCreateFlowSaveEmail("")).toBe(false);
|
||||
expect(isValidCreateFlowSaveEmail(" ")).toBe(false);
|
||||
expect(isValidCreateFlowSaveEmail(null)).toBe(false);
|
||||
expect(isValidCreateFlowSaveEmail(undefined)).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects values the native email control would reject", () => {
|
||||
expect(isValidCreateFlowSaveEmail("not-an-email")).toBe(false);
|
||||
expect(isValidCreateFlowSaveEmail("user@example.com ")).toBe(false);
|
||||
expect(isValidCreateFlowSaveEmail(" user@example.com")).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts a required type=email value", () => {
|
||||
expect(isValidCreateFlowSaveEmail("user@example.com")).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user