폼전송 기능 수정
This commit is contained in:
@@ -2114,7 +2114,7 @@ describe("/api/export", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("스타일 테스트", () => {
|
||||
describe("buildStaticHtml", () => {
|
||||
it("text 블록은 pb 텍스트 스타일 클래스를 포함해야 한다", async () => {
|
||||
const blocks: Block[] = [
|
||||
{
|
||||
@@ -2545,6 +2545,50 @@ describe("/api/export", () => {
|
||||
expect(html).toContain("섹션 레이아웃 텍스트");
|
||||
});
|
||||
|
||||
it("FormBlock.submitButtonId 로 매핑된 버튼은 해당 form 을 submit 하는 button 요소로 Export 되어야 한다", async () => {
|
||||
const blocks: Block[] = [
|
||||
{
|
||||
id: "form_1",
|
||||
type: "form",
|
||||
props: {
|
||||
fieldIds: ["field_email"],
|
||||
requiredFieldIds: [],
|
||||
submitButtonId: "submit_btn",
|
||||
},
|
||||
} as any,
|
||||
{
|
||||
id: "field_email",
|
||||
type: "formInput",
|
||||
props: {
|
||||
label: "이메일",
|
||||
formFieldName: "email",
|
||||
},
|
||||
} as any,
|
||||
{
|
||||
id: "submit_btn",
|
||||
type: "button",
|
||||
props: {
|
||||
label: "폼 제출",
|
||||
href: "#",
|
||||
},
|
||||
} as any,
|
||||
];
|
||||
|
||||
const projectConfig: ProjectConfig = {
|
||||
title: "폼 제출 버튼 매핑 테스트",
|
||||
slug: "form-submit-button-mapping-test",
|
||||
canvasPreset: "full",
|
||||
} as ProjectConfig;
|
||||
|
||||
const { buildStaticHtml } = await import("@/app/api/export/route");
|
||||
|
||||
const html = buildStaticHtml(blocks, projectConfig);
|
||||
|
||||
expect(html).toContain('<form id="form_form_1" class="pb-form-controller" method="post" action="/api/forms/submit"');
|
||||
expect(html).toContain('type="submit" form="form_form_1"');
|
||||
expect(html).toContain("폼 제출");
|
||||
});
|
||||
|
||||
it("formInput 블록의 textColorCustom 은 정적 HTML에서 input 텍스트 색상 스타일로 반영되어야 한다", async () => {
|
||||
const blocks: Block[] = [
|
||||
{
|
||||
@@ -3178,6 +3222,7 @@ describe("/api/export", () => {
|
||||
expect(css).toContain(".pb-root-inner");
|
||||
expect(css).toContain("max-width: 72rem");
|
||||
expect(css).toContain(".pb-section-inner");
|
||||
expect(css).toContain("margin-inline: auto");
|
||||
expect(css).toContain(".pb-section-columns");
|
||||
expect(css).toContain("gap: 2rem");
|
||||
expect(css).toContain(".pb-section-column");
|
||||
|
||||
Reference in New Issue
Block a user