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:
@@ -55,4 +55,30 @@ describe("TextInput (size tests)", () => {
|
||||
const input = container.querySelector("input");
|
||||
expect(input).toHaveAttribute("maxLength", "200");
|
||||
});
|
||||
|
||||
it("keeps a programmatic label when the visible header is off", () => {
|
||||
const { getByRole, container } = render(
|
||||
<TextInput label="Community name" formHeader={false} />,
|
||||
);
|
||||
expect(getByRole("textbox", { name: "Community name" })).toBeInTheDocument();
|
||||
expect(container.querySelector("label")).toHaveClass("sr-only");
|
||||
});
|
||||
|
||||
it("forwards autocomplete, inputMode, required, and form", () => {
|
||||
const { container } = render(
|
||||
<TextInput
|
||||
label="Email address"
|
||||
type="email"
|
||||
autoComplete="email"
|
||||
inputMode="email"
|
||||
required
|
||||
form="create-flow-community-save"
|
||||
/>,
|
||||
);
|
||||
const input = container.querySelector("input");
|
||||
expect(input).toHaveAttribute("autocomplete", "email");
|
||||
expect(input).toHaveAttribute("inputmode", "email");
|
||||
expect(input).toBeRequired();
|
||||
expect(input).toHaveAttribute("form", "create-flow-community-save");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user