fix(ai-character): 폼 도메인 검증 복구

This commit is contained in:
Yu Sung
2026-08-05 00:34:04 +09:00
parent fb9b550040
commit ca5aa990d3
9 changed files with 290 additions and 14 deletions

View File

@@ -31,13 +31,13 @@ test.each([
"-1",
"1.5",
"100000",
])("Community price preserves and rejects invalid raw input %s", async (rawValue) => {
])("Community price preserves and rejects invalid raw input %s through the submit button", async (rawValue) => {
const requests: CapturedRequest[] = [];
const onCreated = renderForm(requests);
fireEvent.change(screen.getByLabelText("내용"), { target: { value: "가격 검증 게시글" } });
fireEvent.change(screen.getByLabelText("가격"), { target: { value: rawValue } });
fireEvent.submit(screen.getByRole("form", { name: "커뮤니티 게시글 생성 입력 화면" }));
fireEvent.click(screen.getByRole("button", { name: "생성" }));
expect(screen.getByLabelText("가격")).toHaveValue(Number(rawValue));
expect(await screen.findByText("가격은 0 이상 99,999 이하 정수 캔으로 입력하세요.")).toBeInTheDocument();