.
This commit is contained in:
@@ -75,29 +75,22 @@ test("프로젝트 설정 패널에서 캔버스 배경색을 변경하면 에
|
||||
test("프로젝트 설정 패널에서 캔버스 프리셋을 변경하면 에디터 캔버스 너비가 달라져야 한다", async ({ page }) => {
|
||||
await page.goto("/editor");
|
||||
|
||||
const inner = page.getByTestId("editor-canvas-inner");
|
||||
const presetSelect = page.getByRole("combobox", { name: "Canvas width 프리셋" });
|
||||
|
||||
const getMaxWidth = async () => {
|
||||
return inner.evaluate((el) => {
|
||||
const s = window.getComputedStyle(el as HTMLElement);
|
||||
return s.maxWidth;
|
||||
});
|
||||
};
|
||||
const widthInput = page.getByLabel("Canvas width 커스텀");
|
||||
|
||||
await presetSelect.selectOption("mobile");
|
||||
await expect
|
||||
.poll(async () => parseFloat(await getMaxWidth()), { timeout: 5000 })
|
||||
.toBeLessThan(400);
|
||||
const mobileMaxWidth = parseFloat(await getMaxWidth());
|
||||
expect(mobileMaxWidth).toBeGreaterThan(380);
|
||||
.poll(async () => parseFloat(await widthInput.inputValue()), { timeout: 5000 })
|
||||
.toBeGreaterThan(380);
|
||||
const mobileWidth = parseFloat(await widthInput.inputValue());
|
||||
expect(mobileWidth).toBeLessThan(400);
|
||||
|
||||
await presetSelect.selectOption("desktop");
|
||||
await expect
|
||||
.poll(async () => parseFloat(await getMaxWidth()), { timeout: 5000 })
|
||||
.poll(async () => parseFloat(await widthInput.inputValue()), { timeout: 5000 })
|
||||
.toBeGreaterThan(1180);
|
||||
const desktopMaxWidth = parseFloat(await getMaxWidth());
|
||||
expect(desktopMaxWidth).toBeLessThan(1220);
|
||||
const desktopWidth = parseFloat(await widthInput.inputValue());
|
||||
expect(desktopWidth).toBeLessThan(1220);
|
||||
});
|
||||
|
||||
test("텍스트 블록을 더블클릭해서 내용을 수정할 수 있어야 한다", async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user