TDD,E2E 개선, 미적용 스타일 개선
This commit is contained in:
@@ -400,6 +400,7 @@ describe("formHelpers.computeFormControllerPublicTokens", () => {
|
||||
kind: "contact",
|
||||
submitTarget: "internal",
|
||||
fieldIds: ["input-1", "checkbox-1"],
|
||||
requiredFieldIds: ["input-1", "checkbox-1"],
|
||||
submitButtonId: "btn-1",
|
||||
formWidthMode: "fixed",
|
||||
formWidthPx: 320,
|
||||
@@ -473,7 +474,7 @@ describe("formHelpers.computeFormControllerPublicTokens", () => {
|
||||
expect(tokens.submitLabel).toBe("컨트롤러 버튼");
|
||||
});
|
||||
|
||||
it("fields 가 있을 때는 fields 를 사용하고, 없으면 빈 배열을 반환해야 한다", () => {
|
||||
it("fieldIds 가 없으면 fields 설정과 관계없이 빈 배열을 반환해야 한다", () => {
|
||||
const formWithFields: Block = {
|
||||
id: "form-2",
|
||||
type: "form",
|
||||
@@ -494,12 +495,9 @@ describe("formHelpers.computeFormControllerPublicTokens", () => {
|
||||
|
||||
const tokensWithFields = computeFormControllerPublicTokens(formWithFields, [formWithFields]);
|
||||
|
||||
expect(tokensWithFields.fields).toHaveLength(1);
|
||||
expect(tokensWithFields.fields[0].id).toBe("f1");
|
||||
expect(tokensWithFields.fields[0].name).toBe("email");
|
||||
expect(tokensWithFields.fields[0].label).toBe("이메일");
|
||||
expect(tokensWithFields.fields[0].type).toBe("email");
|
||||
expect(tokensWithFields.fields[0].required).toBe(true);
|
||||
// 프리뷰/퍼블릭 렌더러에서는 fieldIds 로 연결된 필드 블록만 사용하고,
|
||||
// props.fields(v1 설정)는 무시해야 한다.
|
||||
expect(tokensWithFields.fields).toHaveLength(0);
|
||||
|
||||
const formFallback: Block = {
|
||||
id: "form-3",
|
||||
|
||||
Reference in New Issue
Block a user