유닛테스트 수정
CI / test (push) Successful in 4m35s
CI / pr_and_merge (push) Successful in 1m44s

This commit is contained in:
2025-12-02 11:27:08 +09:00
parent 3e223a45d4
commit c331d5e14a
16 changed files with 76 additions and 22 deletions
@@ -88,7 +88,7 @@ describe("PublicPageRenderer - 블록 배경색", () => {
expect(listNoBg!.style.backgroundColor === "" || listNoBg!.style.backgroundColor === "transparent").toBe(true);
});
it("form 컨트롤러 블록은 프리뷰에서 별도 폼 래퍼를 렌더하지 않아야 한다", () => {
it("form 컨트롤러 블록은 backgroundColorCustom 이 설정된 경우에만 폼 요소에 배경색을 적용해야 한다", () => {
const blocksWithBg: Block[] = [
{
id: "form_with_bg",
@@ -107,8 +107,10 @@ describe("PublicPageRenderer - 블록 배경색", () => {
const { queryByTestId, rerender } = render(<PublicPageRenderer blocks={blocksWithBg} />);
const formWithBg = queryByTestId("preview-form-controller");
expect(formWithBg).toBeNull();
const formWithBg = queryByTestId("preview-form-controller") as HTMLElement | null;
expect(formWithBg).not.toBeNull();
// JSDOM 은 #111111 을 rgb(17, 17, 17) 형태로 노출한다.
expect(formWithBg!.style.backgroundColor).toBe("rgb(17, 17, 17)");
const blocksWithoutBg: Block[] = [
{
@@ -126,8 +128,11 @@ describe("PublicPageRenderer - 블록 배경색", () => {
rerender(<PublicPageRenderer blocks={blocksWithoutBg} />);
const formNoBg = queryByTestId("preview-form-controller");
expect(formNoBg).toBeNull();
const formNoBg = queryByTestId("preview-form-controller") as HTMLElement | null;
expect(formNoBg).not.toBeNull();
expect(
formNoBg!.style.backgroundColor === "" || formNoBg!.style.backgroundColor === "transparent",
).toBe(true);
});
it("section 블록은 backgroundColorCustom 이 설정된 경우에만 섹션 요소에 배경색이 적용되어야 한다", () => {