에디터 정리 및 버그 수정
This commit is contained in:
@@ -259,16 +259,16 @@ describe("/api/export", () => {
|
||||
expect(htmlColors).toContain('style="background-color:#222222;margin:0;padding:0;"');
|
||||
});
|
||||
|
||||
it("projectConfig.headHtml 과 trackingScript 는 index.html 의 head/body 에 그대로 포함되어야 한다", async () => {
|
||||
it("projectConfig.headHtml / trackingScript 가 head 와 body 에 반영되어야 한다", async () => {
|
||||
const blocks: Block[] = [];
|
||||
|
||||
const projectConfig: ProjectConfig = {
|
||||
title: "헤드/트래킹 테스트",
|
||||
title: "헤드/트래킹 스크립트 테스트",
|
||||
slug: "head-tracking-test",
|
||||
canvasPreset: "full",
|
||||
headHtml: '<meta name="robots" content="noindex" />',
|
||||
trackingScript: '<script>window.__TEST_TRACKING__ = true;<\/script>',
|
||||
};
|
||||
trackingScript: '<script>window.__TEST_TRACKING__ = true;<\\/script>',
|
||||
} as ProjectConfig;
|
||||
|
||||
const payload = { blocks, projectConfig };
|
||||
|
||||
@@ -294,7 +294,35 @@ describe("/api/export", () => {
|
||||
// head 커스텀 HTML
|
||||
expect(html).toContain('<meta name="robots" content="noindex" />');
|
||||
// body 하단 추적 스크립트
|
||||
expect(html).toContain('<script>window.__TEST_TRACKING__ = true;<\/script>');
|
||||
expect(html).toContain('<script>window.__TEST_TRACKING__ = true;<\\/script>');
|
||||
});
|
||||
|
||||
it("버튼 블록에 imageSrc 가 있으면 내보내기 HTML 의 버튼 안에 img 요소가 포함되어야 한다", () => {
|
||||
const blocks: Block[] = [
|
||||
{
|
||||
id: "btn_img_export",
|
||||
type: "button",
|
||||
props: {
|
||||
label: "이미지 버튼",
|
||||
href: "#",
|
||||
imageSrc: "https://example.com/button.png",
|
||||
imageAlt: "버튼 이미지",
|
||||
imagePlacement: "left",
|
||||
} as any,
|
||||
},
|
||||
];
|
||||
|
||||
const projectConfig: ProjectConfig = {
|
||||
title: "버튼 이미지 내보내기 테스트",
|
||||
slug: "btn-img-export-test",
|
||||
canvasPreset: "full",
|
||||
} as ProjectConfig;
|
||||
|
||||
const html = buildStaticHtml(blocks, projectConfig);
|
||||
|
||||
expect(html).toContain('<a href="#"');
|
||||
expect(html).toContain('<img src="https://example.com/button.png"');
|
||||
expect(html).toContain('alt="버튼 이미지"');
|
||||
});
|
||||
|
||||
it("index.html head 에는 기본 viewport 메타 태그가 포함되어야 한다", async () => {
|
||||
|
||||
Reference in New Issue
Block a user