e2e 수정
This commit is contained in:
@@ -5,6 +5,13 @@ import { test, expect } from "@playwright/test";
|
||||
// 에디터 E2E에서는 인증된 사용자 시나리오를 기본으로 가정한다.
|
||||
// /api/auth/me 를 항상 200 으로 목 처리해, auth 가드가 /login 으로 리다이렉트하지 않도록 한다.
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
try {
|
||||
window.localStorage.clear();
|
||||
} catch {
|
||||
}
|
||||
});
|
||||
|
||||
await page.route("**/api/auth/me", async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
@@ -70,14 +77,10 @@ test("프로젝트 설정 패널에서 캔버스 프리셋을 변경하면 에
|
||||
const presetSelect = page.getByRole("combobox", { name: "Canvas width 프리셋" });
|
||||
|
||||
await presetSelect.selectOption("mobile");
|
||||
const mobileMaxWidth = await inner.evaluate((el) => (el as HTMLElement).style.maxWidth);
|
||||
await expect(inner).toHaveCSS("max-width", "390px");
|
||||
|
||||
await presetSelect.selectOption("desktop");
|
||||
const desktopMaxWidth = await inner.evaluate((el) => (el as HTMLElement).style.maxWidth);
|
||||
|
||||
expect(mobileMaxWidth).toBe("390px");
|
||||
expect(desktopMaxWidth).toBe("1200px");
|
||||
expect(mobileMaxWidth).not.toBe(desktopMaxWidth);
|
||||
await expect(inner).toHaveCSS("max-width", "1200px");
|
||||
});
|
||||
|
||||
test("텍스트 블록을 더블클릭해서 내용을 수정할 수 있어야 한다", async ({ page }) => {
|
||||
|
||||
@@ -6,6 +6,13 @@ function parsePx(value: string): number {
|
||||
}
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
try {
|
||||
window.localStorage.clear();
|
||||
} catch {
|
||||
}
|
||||
});
|
||||
|
||||
await page.route("**/api/auth/me", async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
|
||||
Reference in New Issue
Block a user