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,4 +1,9 @@
|
||||
import { describe, vi } from "vitest";
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import {
|
||||
renderWithProviders as render,
|
||||
screen,
|
||||
} from "../utils/test-utils";
|
||||
import "@testing-library/jest-dom/vitest";
|
||||
import {
|
||||
componentTestSuite,
|
||||
type ComponentTestSuiteConfig,
|
||||
@@ -28,4 +33,19 @@ const config: ComponentTestSuiteConfig<Props> = {
|
||||
|
||||
describe("InputWithCounter", () => {
|
||||
componentTestSuite<Props>(config);
|
||||
|
||||
it("associates the visible label with the input", () => {
|
||||
render(
|
||||
<InputWithCounter
|
||||
label="Community name"
|
||||
placeholder="Enter a name"
|
||||
value=""
|
||||
onChange={vi.fn()}
|
||||
maxLength={50}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("textbox", { name: "Community name" }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user