🐛 Fix group automatically selected after creation

This commit is contained in:
Alejandro Alonso 2024-06-11 09:59:35 +02:00 committed by Andrey Antukh
parent 38fa5be862
commit c5bf2a775e
6 changed files with 246 additions and 2 deletions

View file

@ -111,7 +111,11 @@ export class WorkspacePage extends BaseWebSocketPage {
const layer = this.layers.getByTestId("layer-item").filter({ has: this.page.getByText(name) });
await layer.getByRole("button").click(clickOptions);
}
async expectSelectedLayer(name) {
await expect(this.layers.getByTestId("layer-row").filter({ has: this.page.getByText(name) })).toHaveClass(/selected/);
}
async clickAssets(clickOptions = {}) {
await this.assets.click(clickOptions);
}

View file

@ -66,3 +66,19 @@ test("User adds a library and its automatically selected in the color palette",
await expect(workspacePage.palette.getByText('There are no color styles in your library yet')).toBeVisible();
});
test("User makes a group", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-not-empty.json");
await workspacePage.mockRPC("update-file?id=*", "workspace/update-file-create-rect.json");
await workspacePage.goToWorkspace({
fileId: "6191cd35-bb1f-81f7-8004-7cc63d087374",
pageId: "6191cd35-bb1f-81f7-8004-7cc63d087375"
});
await workspacePage.clickLeafLayer("Rectangle");
await workspacePage.page.keyboard.press("ControlOrMeta+g");
await workspacePage.expectSelectedLayer("Group");
});