diff --git a/packages/dmn-editor/tests/e2e/__fixtures__/palette.ts b/packages/dmn-editor/tests/e2e/__fixtures__/palette.ts index 9926a976e2c..5c3c244319e 100644 --- a/packages/dmn-editor/tests/e2e/__fixtures__/palette.ts +++ b/packages/dmn-editor/tests/e2e/__fixtures__/palette.ts @@ -34,6 +34,7 @@ export class Palette { if (args.thenRenameTo) { await this.nodes.rename({ current: nodeName, new: args.thenRenameTo }); } + await this.diagram.resetFocus(); } private getNewNodeProperties(type: NodeType) { diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-group-on-top-of-decision.png new file mode 100644 index 00000000000..f097a62e317 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..d6c81ab2abc Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-group-on-top-of-decision.png new file mode 100644 index 00000000000..135d8bd9c35 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..9402844c7fa Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drdArtifacts/resize-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..75eab963a7b Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-on-top-of-decision.png new file mode 100644 index 00000000000..ca44dd92ade Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..079294bf0c0 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..14416983457 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..516def6034d Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-back-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..ecf8359e7a5 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-on-top-of-decision.png new file mode 100644 index 00000000000..e2413a5d4ef Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..ea5daaa5f5b Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..b7b984c573a Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..39321279eb6 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/Google-Chrome/drgElements/resize-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-group-on-top-of-decision.png new file mode 100644 index 00000000000..7c51ad088ba Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..f2043f6cf0a Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-group-on-top-of-decision.png new file mode 100644 index 00000000000..2cff4300dcc Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..4dd96a6e5e8 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drdArtifacts/resize-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..8c977f9c695 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-on-top-of-decision.png new file mode 100644 index 00000000000..b00e8f0317a Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..023208b0524 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..16d6f93ea85 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..04baddb2390 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-back-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..fe7737d54b7 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-on-top-of-decision.png new file mode 100644 index 00000000000..3a267d6bc34 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..963a0ddef69 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..e737de9f968 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..6f54f6e72c9 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/chromium/drgElements/resize-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-group-on-top-of-decision.png new file mode 100644 index 00000000000..5bf837c3c6a Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..01ecfa5cfb1 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-back-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-group-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-group-on-top-of-decision.png new file mode 100644 index 00000000000..9e8fafdbc4c Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-group-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-text-annotation-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-text-annotation-on-top-of-decision.png new file mode 100644 index 00000000000..ceb352355ca Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drdArtifacts/resize-text-annotation-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..2693c2d7bb6 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-on-top-of-decision.png new file mode 100644 index 00000000000..03ca6c80772 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..d53add951c4 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..cc65ebd4c44 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..9cfa445826a Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-back-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-bkm-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-bkm-on-top-of-decision.png new file mode 100644 index 00000000000..bde1f79fb8c Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-bkm-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-on-top-of-decision.png new file mode 100644 index 00000000000..6f086586392 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-service-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-service-on-top-of-decision.png new file mode 100644 index 00000000000..c1cbae89b87 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-decision-service-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-input-data-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-input-data-on-top-of-decision.png new file mode 100644 index 00000000000..786683457c5 Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-input-data-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-knowledge-source-on-top-of-decision.png b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-knowledge-source-on-top-of-decision.png new file mode 100644 index 00000000000..7dde773746c Binary files /dev/null and b/packages/dmn-editor/tests/e2e/__screenshots__/webkit/drgElements/resize-knowledge-source-on-top-of-decision.png differ diff --git a/packages/dmn-editor/tests/e2e/drdArtifacts/resizeGroup.spec.ts b/packages/dmn-editor/tests/e2e/drdArtifacts/resizeGroup.spec.ts index b725722e939..fd78f78331c 100644 --- a/packages/dmn-editor/tests/e2e/drdArtifacts/resizeGroup.spec.ts +++ b/packages/dmn-editor/tests/e2e/drdArtifacts/resizeGroup.spec.ts @@ -137,4 +137,25 @@ test.describe("Resize node - Group", () => { expect(width).toEqual("300"); }); }); + + test.describe("Resize on top of other node - Group", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.GROUP, targetPosition: { x: 100, y: 100 } }); + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 450, y: 150 } }); + }); + + test("should resize Group on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.GROUP, position: NodePosition.TOP, xOffset: 200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-group-on-top-of-decision.png"); + }); + + test("should resize back Group that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.GROUP, position: NodePosition.TOP, xOffset: 200, yOffset: 0 }); + await diagram.resetFocus(); + await nodes.resize({ nodeName: DefaultNodeName.GROUP, position: NodePosition.TOP, xOffset: -200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-group-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drdArtifacts/resizeTextAnnotation.spec.ts b/packages/dmn-editor/tests/e2e/drdArtifacts/resizeTextAnnotation.spec.ts index e1f5bdb9a8e..d74f4e19a18 100644 --- a/packages/dmn-editor/tests/e2e/drdArtifacts/resizeTextAnnotation.spec.ts +++ b/packages/dmn-editor/tests/e2e/drdArtifacts/resizeTextAnnotation.spec.ts @@ -206,4 +206,40 @@ test.describe("Resize node - Text Annotation", () => { expect(width).toEqual("200"); }); }); + + test.describe("Resize on top of other node - Text Annotation", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.TEXT_ANNOTATION, targetPosition: { x: 100, y: 100 } }); + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 450, y: 150 } }); + }); + + test("should resize Text Annotation on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ + nodeName: DefaultNodeName.TEXT_ANNOTATION, + position: NodePosition.TOP, + xOffset: 200, + yOffset: 0, + }); + + await expect(diagram.get()).toHaveScreenshot("resize-text-annotation-on-top-of-decision.png"); + }); + + test("should resize back Text Annotation that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ + nodeName: DefaultNodeName.TEXT_ANNOTATION, + position: NodePosition.TOP, + xOffset: 200, + yOffset: 0, + }); + await diagram.resetFocus(); + await nodes.resize({ + nodeName: DefaultNodeName.TEXT_ANNOTATION, + position: NodePosition.TOP, + xOffset: -200, + yOffset: 0, + }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-text-annotation-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drgElements/resizeBkm.spec.ts b/packages/dmn-editor/tests/e2e/drgElements/resizeBkm.spec.ts index e2eea469021..a1c1bb3c235 100644 --- a/packages/dmn-editor/tests/e2e/drgElements/resizeBkm.spec.ts +++ b/packages/dmn-editor/tests/e2e/drgElements/resizeBkm.spec.ts @@ -137,4 +137,25 @@ test.describe("Resize node - BKM", () => { expect(height).toEqual("100"); }); }); + + test.describe("Resize on top of other node - BKM", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 250, y: 150 } }); + await palette.dragNewNode({ type: NodeType.BKM, targetPosition: { x: 100, y: 100 } }); + }); + + test("should resize BKM on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.BKM, xOffset: 200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-bkm-on-top-of-decision.png"); + }); + + test("should resize back BKM that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.BKM, xOffset: 200, yOffset: 0 }); + await diagram.resetFocus(); + await nodes.resize({ nodeName: DefaultNodeName.BKM, xOffset: -200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-bkm-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drgElements/resizeDecision.spec.ts b/packages/dmn-editor/tests/e2e/drgElements/resizeDecision.spec.ts index e9a0dd8041d..5ba34667347 100644 --- a/packages/dmn-editor/tests/e2e/drgElements/resizeDecision.spec.ts +++ b/packages/dmn-editor/tests/e2e/drgElements/resizeDecision.spec.ts @@ -135,4 +135,29 @@ test.describe("Resize node - Decision", () => { expect(height).toEqual("100"); }); }); + + test.describe("Resize on top of other node - Decision", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ + type: NodeType.DECISION, + targetPosition: { x: 250, y: 150 }, + thenRenameTo: "Decision2", + }); + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 100, y: 100 } }); + }); + + test("should resize Decision on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.DECISION, xOffset: 200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-decision-on-top-of-decision.png"); + }); + + test("should resize back Decision that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.DECISION, xOffset: 200, yOffset: 0 }); + await diagram.resetFocus(); + await nodes.resize({ nodeName: DefaultNodeName.DECISION, xOffset: -200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-decision-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drgElements/resizeDecisionService.spec.ts b/packages/dmn-editor/tests/e2e/drgElements/resizeDecisionService.spec.ts index df1d6552095..c4ff02f0408 100644 --- a/packages/dmn-editor/tests/e2e/drgElements/resizeDecisionService.spec.ts +++ b/packages/dmn-editor/tests/e2e/drgElements/resizeDecisionService.spec.ts @@ -206,4 +206,40 @@ test.describe("Resize node - Decision Service", () => { expect(height).toEqual("300"); }); }); + + test.describe("Resize on top of other node - Decision Service", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.DECISION_SERVICE, targetPosition: { x: 100, y: 100 } }); + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 450, y: 150 } }); + }); + + test("should resize Decision Service on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ + nodeName: DefaultNodeName.DECISION_SERVICE, + position: NodePosition.TOP, + xOffset: 200, + yOffset: 0, + }); + + await expect(diagram.get()).toHaveScreenshot("resize-decision-service-on-top-of-decision.png"); + }); + + test("should resize back Decision Service that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ + nodeName: DefaultNodeName.DECISION_SERVICE, + position: NodePosition.TOP, + xOffset: 200, + yOffset: 0, + }); + await diagram.resetFocus(); + await nodes.resize({ + nodeName: DefaultNodeName.DECISION_SERVICE, + position: NodePosition.TOP, + xOffset: -200, + yOffset: 0, + }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-decision-service-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drgElements/resizeInputData.spec.ts b/packages/dmn-editor/tests/e2e/drgElements/resizeInputData.spec.ts index 9ea6952aed1..403c1b50cab 100644 --- a/packages/dmn-editor/tests/e2e/drgElements/resizeInputData.spec.ts +++ b/packages/dmn-editor/tests/e2e/drgElements/resizeInputData.spec.ts @@ -137,4 +137,25 @@ test.describe("Resize node - Input Data", () => { expect(height).toEqual("100"); }); }); + + test.describe("Resize on top of other node - Input Data", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 250, y: 150 } }); + await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition: { x: 100, y: 100 } }); + }); + + test("should resize Input Data on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.INPUT_DATA, xOffset: 200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-input-data-on-top-of-decision.png"); + }); + + test("should resize back Input Data that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.INPUT_DATA, xOffset: 200, yOffset: 0 }); + await diagram.resetFocus(); + await nodes.resize({ nodeName: DefaultNodeName.INPUT_DATA, xOffset: -200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-input-data-on-top-of-decision.png"); + }); + }); }); diff --git a/packages/dmn-editor/tests/e2e/drgElements/resizeKnowledgeSource.spec.ts b/packages/dmn-editor/tests/e2e/drgElements/resizeKnowledgeSource.spec.ts index 25a9d01cac9..3c34c765214 100644 --- a/packages/dmn-editor/tests/e2e/drgElements/resizeKnowledgeSource.spec.ts +++ b/packages/dmn-editor/tests/e2e/drgElements/resizeKnowledgeSource.spec.ts @@ -146,4 +146,25 @@ test.describe("Resize node - Knowledge Source", () => { expect(height).toEqual("100"); }); }); + + test.describe("Resize on top of other node - Knowledge Source", () => { + test.beforeEach(async ({ palette }) => { + await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { x: 250, y: 150 } }); + await palette.dragNewNode({ type: NodeType.KNOWLEDGE_SOURCE, targetPosition: { x: 100, y: 100 } }); + }); + + test("should resize Knowledge Source on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.KNOWLEDGE_SOURCE, xOffset: 200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-knowledge-source-on-top-of-decision.png"); + }); + + test("should resize back Knowledge Source that is on top of Decision node", async ({ nodes, diagram }) => { + await nodes.resize({ nodeName: DefaultNodeName.KNOWLEDGE_SOURCE, xOffset: 200, yOffset: 0 }); + await diagram.resetFocus(); + await nodes.resize({ nodeName: DefaultNodeName.KNOWLEDGE_SOURCE, xOffset: -200, yOffset: 0 }); + + await expect(diagram.get()).toHaveScreenshot("resize-back-knowledge-source-on-top-of-decision.png"); + }); + }); });