ci 오류 수정
This commit is contained in:
@@ -3,6 +3,8 @@ import { render, screen, cleanup } from "@testing-library/react";
|
||||
import type { Block, ProjectConfig } from "@/features/editor/state/editorStore";
|
||||
import EditorPage from "@/app/editor/page";
|
||||
import { createHeroTemplateBlocks } from "@/app/editor/templates/heroTemplate";
|
||||
import { getEditorTemplatesMessages } from "@/features/i18n/messages/editorTemplates";
|
||||
import { DEFAULT_LOCALE } from "@/features/i18n/locale";
|
||||
|
||||
let mockState: any;
|
||||
|
||||
@@ -191,7 +193,12 @@ describe("EditorPage - 섹션 레이아웃 속성", () => {
|
||||
return () => `hero_${++i}`;
|
||||
})();
|
||||
|
||||
const { blocks } = createHeroTemplateBlocks({ sectionId, createId });
|
||||
const tpl = getEditorTemplatesMessages(DEFAULT_LOCALE);
|
||||
const { blocks } = createHeroTemplateBlocks({
|
||||
sectionId,
|
||||
createId,
|
||||
messages: tpl.hero,
|
||||
});
|
||||
|
||||
mockState.blocks = blocks as Block[];
|
||||
mockState.selectedBlockId = sectionId;
|
||||
|
||||
@@ -41,7 +41,7 @@ describe("ProjectPropertiesPanel SEO 메타", () => {
|
||||
it("SEO 타이틀 입력을 변경하면 seoTitle 이 updateProjectConfig 로 전달되어야 한다", () => {
|
||||
render(<ProjectPropertiesPanel />);
|
||||
|
||||
const input = screen.getByLabelText("SEO 타이틀") as HTMLInputElement;
|
||||
const input = screen.getByLabelText("SEO title") as HTMLInputElement;
|
||||
|
||||
fireEvent.change(input, { target: { value: "새 SEO 타이틀" } });
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("ProjectPropertiesPanel SEO 메타", () => {
|
||||
it("메타 디스크립션 입력을 변경하면 seoDescription 이 updateProjectConfig 로 전달되어야 한다", () => {
|
||||
render(<ProjectPropertiesPanel />);
|
||||
|
||||
const textarea = screen.getByLabelText("메타 디스크립션") as HTMLTextAreaElement;
|
||||
const textarea = screen.getByLabelText("Meta description") as HTMLTextAreaElement;
|
||||
|
||||
fireEvent.change(textarea, { target: { value: "SEO 설명" } });
|
||||
|
||||
@@ -63,7 +63,7 @@ describe("ProjectPropertiesPanel SEO 메타", () => {
|
||||
it("OG/Twitter 이미지 URL 입력을 변경하면 seoOgImageUrl 이 updateProjectConfig 로 전달되어야 한다", () => {
|
||||
render(<ProjectPropertiesPanel />);
|
||||
|
||||
const input = screen.getByLabelText("OG/Twitter 이미지 URL") as HTMLInputElement;
|
||||
const input = screen.getByLabelText("OG/Twitter image URL") as HTMLInputElement;
|
||||
|
||||
fireEvent.change(input, { target: { value: "https://example.com/og.png" } });
|
||||
|
||||
@@ -88,7 +88,7 @@ describe("ProjectPropertiesPanel SEO 메타", () => {
|
||||
render(<ProjectPropertiesPanel />);
|
||||
|
||||
const checkbox = screen.getByLabelText(
|
||||
"검색 엔진에 노출하지 않기 (noindex)",
|
||||
"Hide from search engines (noindex)",
|
||||
) as HTMLInputElement;
|
||||
|
||||
expect(checkbox.checked).toBe(false);
|
||||
|
||||
@@ -3,6 +3,8 @@ import { render, screen, cleanup } from "@testing-library/react";
|
||||
import { PublicPageRenderer } from "@/features/editor/components/PublicPageRenderer";
|
||||
import { createFooterTemplateBlocks } from "@/app/editor/templates/footerTemplate";
|
||||
import type { Block } from "@/features/editor/state/editorStore";
|
||||
import { getEditorTemplatesMessages } from "@/features/i18n/messages/editorTemplates";
|
||||
import { DEFAULT_LOCALE } from "@/features/i18n/locale";
|
||||
|
||||
// PublicPageRenderer 푸터 템플릿 TDD
|
||||
// - footerTemplate 로 생성한 섹션이 프리뷰에서 섹션/텍스트 구조로 올바르게 렌더되는지 검증한다.
|
||||
@@ -16,8 +18,8 @@ describe("PublicPageRenderer - 푸터 템플릿", () => {
|
||||
const sectionId = "footer_preview_section";
|
||||
let i = 0;
|
||||
const createId = () => `footer_${++i}`;
|
||||
|
||||
const { blocks } = createFooterTemplateBlocks({ sectionId, createId });
|
||||
const tpl = getEditorTemplatesMessages(DEFAULT_LOCALE);
|
||||
const { blocks } = createFooterTemplateBlocks({ sectionId, createId, messages: tpl.footer });
|
||||
|
||||
render(<PublicPageRenderer blocks={blocks as Block[]} />);
|
||||
|
||||
@@ -25,9 +27,9 @@ describe("PublicPageRenderer - 푸터 템플릿", () => {
|
||||
expect(section.getAttribute("data-section-id")).toBe(sectionId);
|
||||
|
||||
expect(screen.getByText("MyLanding")).toBeTruthy();
|
||||
expect(screen.getByText("더 나은 웹사이트를 위한 최고의 선택.")).toBeTruthy();
|
||||
expect(screen.getByText(/서비스 소개/)).toBeTruthy();
|
||||
expect(screen.getByText(/문의하기/)).toBeTruthy();
|
||||
expect(screen.getByText(/© 2025 MyLanding\./)).toBeTruthy();
|
||||
expect(screen.getByText("The best choice for building better websites.")).toBeTruthy();
|
||||
expect(screen.getByText(/Product/)).toBeTruthy();
|
||||
expect(screen.getByText(/Contact/)).toBeTruthy();
|
||||
expect(screen.getByText(/ 2025 MyLanding\./)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,6 +4,8 @@ import { PublicPageRenderer } from "@/features/editor/components/PublicPageRende
|
||||
import { createHeroTemplateBlocks } from "@/app/editor/templates/heroTemplate";
|
||||
import { createFeaturesTemplateBlocks } from "@/app/editor/templates/featuresTemplate";
|
||||
import { createCtaTemplateBlocks } from "@/app/editor/templates/ctaTemplate";
|
||||
import { getEditorTemplatesMessages } from "@/features/i18n/messages/editorTemplates";
|
||||
import { DEFAULT_LOCALE } from "@/features/i18n/locale";
|
||||
import type { Block } from "@/features/editor/state/editorStore";
|
||||
|
||||
// PublicPageRenderer 템플릿 TDD
|
||||
@@ -21,7 +23,12 @@ describe("PublicPageRenderer - 섹션 템플릿", () => {
|
||||
|
||||
it("Hero 템플릿 섹션은 섹션과 헤드라인/서브텍스트/버튼을 렌더해야 한다", () => {
|
||||
const sectionId = "hero_section_1";
|
||||
const { blocks } = createHeroTemplateBlocks({ sectionId, createId: createIdFactory() });
|
||||
const tpl = getEditorTemplatesMessages(DEFAULT_LOCALE);
|
||||
const { blocks } = createHeroTemplateBlocks({
|
||||
sectionId,
|
||||
createId: createIdFactory(),
|
||||
messages: tpl.hero,
|
||||
});
|
||||
|
||||
render(<PublicPageRenderer blocks={blocks as Block[]} />);
|
||||
|
||||
@@ -34,7 +41,12 @@ describe("PublicPageRenderer - 섹션 템플릿", () => {
|
||||
|
||||
it("Features 템플릿 섹션은 3컬럼 Feature 제목/설명 텍스트를 렌더해야 한다", () => {
|
||||
const sectionId = "features_section_1";
|
||||
const { blocks } = createFeaturesTemplateBlocks({ sectionId, createId: createIdFactory() });
|
||||
const tpl = getEditorTemplatesMessages(DEFAULT_LOCALE);
|
||||
const { blocks } = createFeaturesTemplateBlocks({
|
||||
sectionId,
|
||||
createId: createIdFactory(),
|
||||
messages: tpl.features,
|
||||
});
|
||||
|
||||
render(<PublicPageRenderer blocks={blocks as Block[]} />);
|
||||
|
||||
@@ -53,7 +65,12 @@ describe("PublicPageRenderer - 섹션 템플릿", () => {
|
||||
|
||||
it("CTA 템플릿 섹션은 텍스트와 CTA 버튼을 렌더해야 한다", () => {
|
||||
const sectionId = "cta_section_1";
|
||||
const { blocks } = createCtaTemplateBlocks({ sectionId, createId: createIdFactory() });
|
||||
const tpl = getEditorTemplatesMessages(DEFAULT_LOCALE);
|
||||
const { blocks } = createCtaTemplateBlocks({
|
||||
sectionId,
|
||||
createId: createIdFactory(),
|
||||
messages: tpl.cta,
|
||||
});
|
||||
|
||||
render(<PublicPageRenderer blocks={blocks as Block[]} />);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user