오류 수정
CI / test (push) Failing after 5m41s
CI / e2e (push) Has been skipped
CI / pr_and_merge (push) Has been skipped

This commit is contained in:
2025-12-12 18:04:31 +09:00
parent 6804665b95
commit 4840a530b6
205 changed files with 1802 additions and 9887 deletions
+63
View File
@@ -2,6 +2,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { render, screen, cleanup } from "@testing-library/react";
import type { Block, ProjectConfig } from "@/features/editor/state/editorStore";
import EditorPage from "@/app/editor/page";
import { LocaleProvider } from "@/features/i18n/LocaleProvider";
let mockState: any;
@@ -114,4 +115,66 @@ describe("EditorPage - 이미지 블록 스타일", () => {
expect(img.style.width).toBe("320px");
expect(img.style.borderRadius).toBe("24px");
});
it("이미지 블록이 비어 있을 때 en 로케일에서는 영어 플레이스홀더가 표시되어야 한다", () => {
const blocks: Block[] = [
{
id: "image_placeholder_en",
type: "image",
props: {
src: "",
alt: "",
align: "center",
widthMode: "auto",
borderRadius: "none",
borderRadiusPx: 0,
},
} as any,
];
mockState.blocks = blocks;
mockState.selectedBlockId = "image_placeholder_en";
render(
<LocaleProvider initialLocale="en">
<EditorPage />
</LocaleProvider>,
);
expect(
screen.getByText("Enter an image URL or upload a file to see the preview here."),
).toBeTruthy();
});
it("이미지 블록이 비어 있을 때 ko 로케일에서는 한국어 플레이스홀더가 표시되어야 한다", () => {
const blocks: Block[] = [
{
id: "image_placeholder_ko",
type: "image",
props: {
src: "",
alt: "",
align: "center",
widthMode: "auto",
borderRadius: "none",
borderRadiusPx: 0,
},
} as any,
];
mockState.blocks = blocks;
mockState.selectedBlockId = "image_placeholder_ko";
render(
<LocaleProvider initialLocale="ko">
<EditorPage />
</LocaleProvider>,
);
expect(
screen.getByText(
"이미지 URL 을 입력하거나 파일을 업로드하면 여기에서 미리보기가 표시됩니다.",
),
).toBeTruthy();
});
});