@@ -0,0 +1,18 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("keeps the primary workspace inside a narrow viewport", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/deep/nested/svg/");
|
||||
await expect(page.locator("main").first()).toBeVisible();
|
||||
await expect(
|
||||
page.locator("main .loading, main .workbench-loading"),
|
||||
).toHaveCount(0);
|
||||
|
||||
const widths = await page.evaluate(() => ({
|
||||
content: document.documentElement.scrollWidth,
|
||||
viewport: document.documentElement.clientWidth,
|
||||
}));
|
||||
expect(widths.viewport).toBeLessThanOrEqual(430);
|
||||
expect(widths.content).toBeLessThanOrEqual(widths.viewport + 1);
|
||||
});
|
||||
@@ -67,7 +67,7 @@ test("synchronizes tree selection, source patches, undo and redo", async ({
|
||||
const pathRow = page.getByRole("treeitem").filter({ hasText: "path" }).last();
|
||||
await pathRow.click();
|
||||
await expect(pathRow).toHaveAttribute("aria-selected", "true");
|
||||
await page.getByRole("tab", { name: "Element" }).click();
|
||||
await page.getByRole("button", { name: "Element" }).click();
|
||||
|
||||
const fill = page.getByLabel("Fill", { exact: true });
|
||||
await fill.fill("#123456");
|
||||
@@ -80,6 +80,30 @@ test("synchronizes tree selection, source patches, undo and redo", async ({
|
||||
await expect(page.locator(".cm-content")).toContainText('fill="#123456"');
|
||||
});
|
||||
|
||||
test("duplicates and deletes ID-free nodes while protecting referenced IDs", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/deep/nested/svg/");
|
||||
await page.getByPlaceholder("Filter elements…").fill("stop");
|
||||
await page.getByRole("treeitem").filter({ hasText: "stop" }).first().click();
|
||||
await page.getByRole("button", { name: "Element" }).click();
|
||||
await page.getByRole("button", { name: "Duplicate element" }).click();
|
||||
await expect(page.locator(".cm-content")).toContainText(
|
||||
/stop-color="#725cff"[\s\S]*stop-color="#725cff"/u,
|
||||
);
|
||||
await page.getByRole("button", { name: "Delete element" }).click();
|
||||
await expect(page.locator(".cm-content")).not.toContainText(
|
||||
/stop-color="#725cff"[\s\S]*stop-color="#725cff"/u,
|
||||
);
|
||||
|
||||
await page.getByPlaceholder("Filter elements…").fill("sun");
|
||||
await page.getByRole("treeitem").filter({ hasText: "sun" }).click();
|
||||
await page.getByRole("button", { name: "Duplicate element" }).click();
|
||||
await expect(page.locator(".workbench-footer")).toContainText(
|
||||
/Duplicate is refused/u,
|
||||
);
|
||||
});
|
||||
|
||||
test("connects to a valid same-origin Toolbox catalogue from the nested build", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user