jomarko commented on code in PR #2508:
URL:
https://github.com/apache/incubator-kie-tools/pull/2508#discussion_r1710839128
##########
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-popover")
+
.getByTestId(`kie-tools--dmn-editor--external-node-${args.includedModelName}-${args.nodeName}`)
Review Comment:
Do we want somehow reflect the logic we have in the implementation?
```
data-testid={`kie-tools--dmn-editor--external-node-${_import["@_name"] ===
"" ? _import["@_id"] : _import["@_name"]}-${drgElement["@_name"]}`}
```
I mean sometime included mdoel may be empty
##########
packages/dmn-editor/tests-e2e/drgElements/moveExternalNode.spec.ts:
##########
@@ -0,0 +1,228 @@
+/*
+ * 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("Move external node - Decision", () => {
+ test("move an external node from Decision Service to out", 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:
sharing my opinion here, but will not block PR if you decide to not apply it.
My understanding is we will always call these methods as a pair, that needs
to be executed to include a model. As both are related to the same application
logic and we invoke both with the same parameter value, to me it would make
sense to simplify the `includedModels` fixture API to have a single method
`selectModel` that would internally also `fillModelToInclude`.
##########
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-popover")
+
.getByTestId(`kie-tools--dmn-editor--external-node-${args.includedModelName}-${args.nodeName}`)
Review Comment:
Also a reminder about my previous question, if this is the code placement
for similar methods that I should use in my PR
https://github.com/apache/incubator-kie-tools/pull/2508#discussion_r1704999440
--
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]