feat: FormBlock 컨트롤러 정리 및 15.1 SEO/head 메타 관리 추가
This commit is contained in:
@@ -2,7 +2,6 @@ import { describe, it, expect, vi } from "vitest";
|
||||
import { render, screen, fireEvent } from "@testing-library/react";
|
||||
import { TextPropertiesPanel } from "@/app/editor/panels/TextPropertiesPanel";
|
||||
import { ListPropertiesPanel } from "@/app/editor/panels/ListPropertiesPanel";
|
||||
import { FormControllerPanel } from "@/app/editor/forms/FormControllerPanel";
|
||||
import type { Block } from "@/features/editor/state/editorStore";
|
||||
|
||||
// Text/List/Form 패널에 추가되는 블록 배경색(backgroundColorCustom) 컨트롤에 대한 최소 TDD
|
||||
@@ -58,34 +57,4 @@ describe("Text/List/Form 패널 - 블록 배경색 컨트롤", () => {
|
||||
expect.objectContaining({ backgroundColorCustom: "#445566" }),
|
||||
);
|
||||
});
|
||||
|
||||
it("FormControllerPanel 에서 배경색 HEX 인풋 변경 시 updateBlock 이 backgroundColorCustom 으로 호출되어야 한다", () => {
|
||||
const updateBlock = vi.fn();
|
||||
|
||||
const formBlock: Block = {
|
||||
id: "form-1",
|
||||
type: "form",
|
||||
props: {
|
||||
kind: "contact",
|
||||
submitTarget: "internal",
|
||||
} as any,
|
||||
};
|
||||
|
||||
render(
|
||||
<FormControllerPanel
|
||||
block={formBlock}
|
||||
blocks={[]}
|
||||
selectedBlockId="form-1"
|
||||
updateBlock={updateBlock}
|
||||
/>,
|
||||
);
|
||||
|
||||
const hexInput = screen.getByLabelText("폼 배경색 HEX");
|
||||
fireEvent.change(hexInput, { target: { value: "#778899" } });
|
||||
|
||||
expect(updateBlock).toHaveBeenCalledWith(
|
||||
"form-1",
|
||||
expect.objectContaining({ backgroundColorCustom: "#778899" }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user