Skip to content

Commit

Permalink
resize on top of node tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jomarko committed Apr 9, 2024
1 parent a0fc1af commit f0b77da
Show file tree
Hide file tree
Showing 50 changed files with 182 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/dmn-editor/tests/e2e/__fixtures__/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions packages/dmn-editor/tests/e2e/drdArtifacts/resizeGroup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
21 changes: 21 additions & 0 deletions packages/dmn-editor/tests/e2e/drgElements/resizeBkm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
25 changes: 25 additions & 0 deletions packages/dmn-editor/tests/e2e/drgElements/resizeDecision.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
21 changes: 21 additions & 0 deletions packages/dmn-editor/tests/e2e/drgElements/resizeInputData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});

0 comments on commit f0b77da

Please sign in to comment.