유닛테스트 수정
This commit is contained in:
@@ -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 이 설정된 경우에만 섹션 요소에 배경색이 적용되어야 한다", () => {
|
||||
|
||||
Reference in New Issue
Block a user