Add test for drawing a shape in the workspace

This commit is contained in:
Belén Albeza 2024-05-09 12:57:51 +02:00
parent e28d56e670
commit 00430d63eb
4 changed files with 35 additions and 2 deletions

View file

@ -24,3 +24,17 @@ test("User receives presence notifications updates in the workspace", async ({ p
await expect(page.getByTestId("active-users-list").getByAltText("Princesa Leia")).toHaveCount(2);
});
test("User draws a rect", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC("update-file?id=*", "workspace/update-file-create-rect.json");
await workspacePage.goToWorkspace();
await workspacePage.rectShapeButton.click();
await workspacePage.clickWithDragViewportAt(128, 128, 200, 100);
const shape = await workspacePage.rootShape.locator("rect");
expect(shape).toHaveAttribute("width", "200");
expect(shape).toHaveAttribute("height", "100");
});