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:
@@ -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