mirror of
https://github.com/YuzuZensai/Pien-Studio.git
synced 2026-09-02 14:18:35 +00:00
♻️ refactor!: massive refactor
This commit is contained in:
@@ -15,7 +15,9 @@ test("tools switch modes and action tools add layers", async ({ page }) => {
|
||||
await page.goto("/editor/new");
|
||||
|
||||
await page.locator('button[title="Text"]').click();
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(0);
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(
|
||||
0,
|
||||
);
|
||||
|
||||
await page.locator('button[title="Face"]').click();
|
||||
await expect(page.getByText("Face Tool")).toBeVisible();
|
||||
@@ -28,13 +30,19 @@ test("undo and redo restore layer changes", async ({ page }) => {
|
||||
await page.goto("/editor/new");
|
||||
|
||||
await page.locator('button[title="Text"]').click();
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(0);
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(
|
||||
0,
|
||||
);
|
||||
|
||||
await page.locator('header button[title="Undo"]').click();
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toBeVisible();
|
||||
await expect(
|
||||
page.getByText("No layers yet. Add text or image."),
|
||||
).toBeVisible();
|
||||
|
||||
await page.locator('header button[title="Redo"]').click();
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(0);
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(
|
||||
0,
|
||||
);
|
||||
});
|
||||
|
||||
test("exports and imports project file", async ({ page }) => {
|
||||
@@ -86,10 +94,14 @@ test("exports and imports project file", async ({ page }) => {
|
||||
);
|
||||
|
||||
await page.goto("/");
|
||||
await page.locator('input[type="file"][accept*=".json"]').setInputFiles(filePath);
|
||||
await page
|
||||
.locator('input[type="file"][accept*=".json"]')
|
||||
.setInputFiles(filePath);
|
||||
|
||||
await expect(page).toHaveURL(/\/editor\//);
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(0);
|
||||
await expect(page.getByText("No layers yet. Add text or image.")).toHaveCount(
|
||||
0,
|
||||
);
|
||||
});
|
||||
|
||||
test("persists project list to indexeddb across reload", async ({ page }) => {
|
||||
@@ -99,5 +111,7 @@ test("persists project list to indexeddb across reload", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByRole("button", { name: "Open" }).first()).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Open" }).first(),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user