테스트 오류 수정
This commit is contained in:
@@ -268,11 +268,23 @@ test("에디터 상태를 JSON으로 내보내고 다시 불러오면 동일한
|
||||
const exportArea = page.getByRole("textbox", { name: "Editor state JSON" });
|
||||
const exportedJson = await exportArea.inputValue();
|
||||
|
||||
// 캔버스를 초기화한다.
|
||||
// JSON 모달을 닫고 상단 메뉴에서 캔버스 초기화를 수행한다.
|
||||
await page.getByRole("button", { name: "✕" }).click();
|
||||
await page.getByRole("button", { name: "Menu" }).click();
|
||||
|
||||
// 테스트 환경에서는 window.confirm 을 항상 true 로 반환하도록 스텁한다.
|
||||
await page.evaluate(() => {
|
||||
window.confirm = () => true;
|
||||
});
|
||||
|
||||
await page.getByRole("button", { name: "Clear canvas" }).click();
|
||||
|
||||
await expect(canvas.getByTestId("editor-block")).toHaveCount(0);
|
||||
|
||||
// JSON을 다시 입력하고 불러온다.
|
||||
// JSON 내보내기/불러오기 모달을 다시 열어 JSON을 적용한다.
|
||||
await page.getByRole("button", { name: "Menu" }).click();
|
||||
await page.getByRole("button", { name: "JSON export / import" }).click();
|
||||
|
||||
const importArea = page.getByRole("textbox", { name: "Import from JSON" });
|
||||
await importArea.fill(exportedJson);
|
||||
await page.getByRole("button", { name: "Apply JSON" }).click();
|
||||
|
||||
Reference in New Issue
Block a user