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>
22 lines
916 B
TypeScript
22 lines
916 B
TypeScript
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);
|
|
});
|
|
});
|