♻️ refactor!: massive refactor

This commit is contained in:
2026-05-31 03:04:30 +07:00
parent c1f12c7201
commit df3c944547
86 changed files with 3691 additions and 1129 deletions
+21 -7
View File
@@ -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();
});