jomarko commented on code in PR #2508:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2508#discussion_r1704979081


##########
packages/dmn-editor/src/externalNodes/ExternalNodesPanel.tsx:
##########
@@ -159,6 +159,7 @@ export function ExternalNodesPanel() {
                           externalDrgElementId: drgElement["@_id"]!,
                         })
                       }
+                      
data-testid={`kie-tools--dmn-editor--external-node-${_import["@_name"]}-${drgElement["@_name"]}`}

Review Comment:
   Is ${_import["@_name"]} always non empty? I mean containing some non white 
characters?



##########
packages/dmn-editor/tests-e2e/__fixtures__/palette.ts:
##########
@@ -40,6 +40,21 @@ export class Palette {
     }
   }
 
+  public async dragExternalNode(args: {
+    includedModelName: string;
+    nodeName: string;
+    targetPosition: { x: number; y: number };
+  }) {
+    await this.page
+      .getByTestId("kie-tools--dmn-editor--external-nodes-container")
+      
.getByTestId(`kie-tools--dmn-editor--external-node-${args.includedModelName}-${args.nodeName}`)
+      .dragTo(this.diagram.get(), { targetPosition: args.targetPosition });
+  }
+
+  public async toggleExternalNodesPanel() {
+    await this.page.getByRole("button", { name: "External nodes" }).click();
+  }

Review Comment:
   In my PR https://github.com/apache/incubator-kie-tools/pull/2462, I added 
similar as separate fixture `drgNodes.ts`. Should I also add add it into 
`palette.ts` instead of a separate fixture file?



##########
packages/dmn-editor/tests-e2e/drgElements/addExternalNode.spec.ts:
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { expect, test } from "../__fixtures__/base";
+import { TabName } from "../__fixtures__/editor";
+import { DefaultNodeName, NodeType } from "../__fixtures__/nodes";
+
+test.beforeEach(async ({ stories }) => {
+  await stories.openEmptyWithAvailableExternalModels();
+});
+
+test.describe("Add external node - Decision", () => {
+  test("add to a Decision Service", async ({ editor, page, palette, diagram, 
nodes, includedModels }) => {
+    await editor.changeTab({ tab: TabName.INCLUDED_MODELS });
+
+    await includedModels.getIncludeModelButton().click();
+    await includedModels.fillModelToInclude({ modelName: "sumDiffDs.dmn" });
+    await includedModels.selectModel({ modelName: "sumDiffDs.dmn" });

Review Comment:
   Why both `fillModelToInclude` and `selectModel` are needed please?



##########
packages/dmn-editor/tests-e2e/__fixtures__/nodes.ts:
##########
@@ -140,9 +140,19 @@ export class Nodes {
   }
 
   public async move(args: { name: string; targetPosition: { x: number; y: 
number } }) {
-    await this.get({ name: args.name }).dragTo(this.diagram.get(), {
-      targetPosition: args.targetPosition,
-    });
+    if (DefaultNodeName.DECISION_SERVICE === args.name) {
+      // Decision Services only have some draggable areas near the borders.
+      // If you drag it to the center, you'll drag the divide line.
+      // Also, neither the entire upper area nor the entire downer area is 
draggable.
+      await this.get({ name: args.name }).dragTo(this.diagram.get(), {
+        targetPosition: args.targetPosition,
+        sourcePosition: { x: 20, y: 20 },
+      });

Review Comment:
   Unfortunately, we have one more problem, that `node.move()` can be invoked 
also for a decision service node, that is already renamed and is completely 
different from `DefaultNodeName.DECISION_SERVICE`
   
   I think we should also document that the decision service move will work 
only for 'default name' decision service nodes.



##########
packages/dmn-editor/tests-e2e/__screenshots__/Google-Chrome/drgElements/move-external-decision-out-from-decision-service-after.png:
##########


Review Comment:
   Maybe it is not so clear , if the `MY_MODEL_Diff` is really out of the 
decision service node. Could we maybe move it a little bit more to make it 
clear? Or is this something like corner case test? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to