mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix problem moving layout to frame
This commit is contained in:
committed by
Alejandro Alonso
parent
c15c3b14ee
commit
d48e486668
@@ -117,6 +117,13 @@ export class WorkspacePage extends BaseWebSocketPage {
|
||||
await pagesToggle.click();
|
||||
}
|
||||
|
||||
async moveSelectionToShape(name) {
|
||||
await this.page.locator('rect.viewport-selrect').hover();
|
||||
await this.page.mouse.down();
|
||||
await this.viewport.getByTestId(name).first().hover({ force: true });
|
||||
await this.page.mouse.up();
|
||||
}
|
||||
|
||||
async clickLeafLayer(name, clickOptions = {}) {
|
||||
const layer = this.layers.getByText(name);
|
||||
await layer.click(clickOptions);
|
||||
|
||||
@@ -92,3 +92,35 @@ test.describe("Multiple shapes attributes", () => {
|
||||
await expect(workspace.page.getByTestId("add-blur")).toBeHidden();
|
||||
});
|
||||
});
|
||||
|
||||
test("BUG 7760 - Layout losing properties when changing parents", async ({ page }) => {
|
||||
const workspacePage = new WorkspacePage(page);
|
||||
await workspacePage.setupEmptyFile();
|
||||
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-7760.json");
|
||||
await workspacePage.mockRPC(
|
||||
"get-file-fragment?file-id=*&fragment-id=*",
|
||||
"workspace/get-file-fragment-7760.json",
|
||||
);
|
||||
await workspacePage.mockRPC("update-file?id=*", "workspace/update-file-create-rect.json");
|
||||
|
||||
await workspacePage.goToWorkspace({
|
||||
fileId: "cd90e028-326a-80b4-8004-7cdec16ffad5",
|
||||
pageId: "cd90e028-326a-80b4-8004-7cdec16ffad6",
|
||||
});
|
||||
|
||||
// Select the flex board and drag it into the other container board
|
||||
await workspacePage.clickLeafLayer("Flex Board");
|
||||
|
||||
// Move the first board into the second
|
||||
const hAuto = await workspacePage.page.getByTitle("Fit content (Horizontal)");
|
||||
const vAuto = await workspacePage.page.getByTitle("Fit content (Vertical)");
|
||||
|
||||
await expect(vAuto.locator("input")).toBeChecked();
|
||||
await expect(hAuto.locator("input")).toBeChecked();
|
||||
|
||||
await workspacePage.moveSelectionToShape("Container Board");
|
||||
|
||||
// The first board properties should still be auto width/height
|
||||
await expect(vAuto.locator("input")).toBeChecked();
|
||||
await expect(hAuto.locator("input")).toBeChecked();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user