This is an automated email from the ASF dual-hosted git repository.

Kusuma04-dev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 753421c17c6 Kie-issues#1450: DMN Editor does not display properties of 
edges (#3716)
753421c17c6 is described below

commit 753421c17c6db818053a235f67c002e454a00a78
Author: Kusuma04-dev <[email protected]>
AuthorDate: Fri Aug 21 15:20:32 2026 +0530

    Kie-issues#1450: DMN Editor does not display properties of edges (#3716)
    
    Co-authored-by: Kusuma <[email protected]>
---
 packages/dmn-editor/src/i18n/DmnEditorI18n.ts      |   6 +
 packages/dmn-editor/src/i18n/locales/en.ts         |   6 +
 .../src/propertiesPanel/DiagramPropertiesPanel.tsx |   9 +-
 .../src/propertiesPanel/SingleEdgeProperties.tsx   | 266 +++++++++++++++++++++
 packages/dmn-editor/tests-e2e/__fixtures__/base.ts |   5 +
 .../propertiesPanel/edgePropertiesPanel.ts         |  62 +++++
 .../drgRequirements/edgeProperties.spec.ts         | 202 ++++++++++++++++
 7 files changed, 555 insertions(+), 1 deletion(-)

diff --git a/packages/dmn-editor/src/i18n/DmnEditorI18n.ts 
b/packages/dmn-editor/src/i18n/DmnEditorI18n.ts
index a838239ba2c..b7987299a54 100644
--- a/packages/dmn-editor/src/i18n/DmnEditorI18n.ts
+++ b/packages/dmn-editor/src/i18n/DmnEditorI18n.ts
@@ -227,6 +227,12 @@ interface DmnEditorDictionary extends ReferenceDictionary<{
     enableHighlightingDecisionTable: string;
   };
   propertiesPanel: {
+    informationRequirement: string;
+    knowledgeRequirement: string;
+    authorityRequirement: string;
+    association: string;
+    edge: string;
+    edgeNotFound: (edgeId: string) => string;
     nothingToShow: string;
     inputExpression: string;
     constraint: string;
diff --git a/packages/dmn-editor/src/i18n/locales/en.ts 
b/packages/dmn-editor/src/i18n/locales/en.ts
index 40e5f84be56..1c05b0d1100 100644
--- a/packages/dmn-editor/src/i18n/locales/en.ts
+++ b/packages/dmn-editor/src/i18n/locales/en.ts
@@ -245,6 +245,12 @@ export const en: DmnEditorI18n = {
       "Enable highlighting Decision Table rules and Boxed Conditional 
Expression branches based on evaluation results, also showing success/error 
status badges on Decision nodes.",
   },
   propertiesPanel: {
+    informationRequirement: "Information Requirement",
+    knowledgeRequirement: "Knowledge Requirement",
+    authorityRequirement: "Authority Requirement",
+    association: "Association",
+    edge: "Edge",
+    edgeNotFound: (edgeId: string) => `Edge not found: ${edgeId}`,
     nothingToShow: "Nothing to show",
     inputExpression: "Input Expression",
     constraint: "Constraint",
diff --git a/packages/dmn-editor/src/propertiesPanel/DiagramPropertiesPanel.tsx 
b/packages/dmn-editor/src/propertiesPanel/DiagramPropertiesPanel.tsx
index 06c1a5f079c..6d7e10321d1 100644
--- a/packages/dmn-editor/src/propertiesPanel/DiagramPropertiesPanel.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/DiagramPropertiesPanel.tsx
@@ -23,6 +23,7 @@ import { DrawerHead, DrawerPanelContent } from 
"@patternfly/react-core/dist/js/c
 import { GlobalDiagramProperties } from "./GlobalDiagramProperties";
 import { SingleNodeProperties } from "./SingleNodeProperties";
 import { MultipleNodeProperties } from "./MultipleNodeProperties";
+import { SingleEdgeProperties } from "./SingleEdgeProperties";
 import { useDmnEditorStore } from "../store/StoreContext";
 import { useExternalModels } from 
"../includedModels/DmnEditorDependenciesContext";
 import "./DiagramPropertiesPanel.css";
@@ -33,6 +34,9 @@ export function DiagramPropertiesPanel() {
   const selectedNodesById = useDmnEditorStore(
     (s) => 
s.computed(s).getDiagramData(externalModelsByNamespace).selectedNodesById
   );
+  const selectedEdgesById = useDmnEditorStore(
+    (s) => 
s.computed(s).getDiagramData(externalModelsByNamespace).selectedEdgesById
+  );
 
   return (
     <DrawerPanelContent
@@ -50,9 +54,12 @@ export function DiagramPropertiesPanel() {
       }}
     >
       <DrawerHead>
-        {selectedNodesById.size <= 0 && <GlobalDiagramProperties />}
+        {selectedNodesById.size <= 0 && selectedEdgesById.size <= 0 && 
<GlobalDiagramProperties />}
         {selectedNodesById.size === 1 && <SingleNodeProperties 
nodeId={[...selectedNodesById.keys()][0]} />}
         {selectedNodesById.size > 1 && <MultipleNodeProperties 
nodeIds={[...selectedNodesById.keys()]} />}
+        {selectedNodesById.size <= 0 && selectedEdgesById.size === 1 && (
+          <SingleEdgeProperties edgeId={[...selectedEdgesById.keys()][0]} />
+        )}
       </DrawerHead>
     </DrawerPanelContent>
   );
diff --git a/packages/dmn-editor/src/propertiesPanel/SingleEdgeProperties.tsx 
b/packages/dmn-editor/src/propertiesPanel/SingleEdgeProperties.tsx
new file mode 100644
index 00000000000..9451e80c87f
--- /dev/null
+++ b/packages/dmn-editor/src/propertiesPanel/SingleEdgeProperties.tsx
@@ -0,0 +1,266 @@
+/*
+ * 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 * as React from "react";
+import { useMemo, useState } from "react";
+import { Button, ButtonVariant } from 
"@patternfly/react-core/dist/js/components/Button";
+import { Form, FormSection, FormGroup } from 
"@patternfly/react-core/dist/js/components/Form";
+import { ClipboardCopy } from 
"@patternfly/react-core/dist/js/components/ClipboardCopy";
+import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea";
+import { TimesIcon } from "@patternfly/react-icons/dist/js/icons/times-icon";
+import {
+  DMN_LATEST__tAssociation,
+  DMN_LATEST__tAuthorityRequirement,
+  DMN_LATEST__tInformationRequirement,
+  DMN_LATEST__tKnowledgeRequirement,
+} from "@kie-tools/dmn-marshaller";
+import { Normalized } from 
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
+import { useDmnEditorStore, useDmnEditorStoreApi } from 
"../store/StoreContext";
+import { useExternalModels } from 
"../includedModels/DmnEditorDependenciesContext";
+import { useSettings } from "../settings/DmnEditorSettingsContext";
+import { useDmnEditorI18n } from "../i18n";
+import { PropertiesPanelHeader } from "./PropertiesPanelHeader";
+import { EDGE_TYPES } from "../diagram/edges/EdgeTypes";
+import {
+  InformationRequirementPath,
+  KnowledgeRequirementPath,
+  AuthorityRequirementPath,
+  AssociationPath,
+} from "../diagram/edges/Edges";
+
+const handleButtonSize = 34;
+const svgViewboxPadding = Math.sqrt(Math.pow(handleButtonSize, 2) / 2) - 
handleButtonSize / 2;
+const edgeSvgViewboxSize = 25;
+
+export function SingleEdgeProperties({ edgeId }: { edgeId: string }) {
+  const { i18n } = useDmnEditorI18n();
+  const dmnEditorStoreApi = useDmnEditorStoreApi();
+  const { externalModelsByNamespace } = useExternalModels();
+  const settings = useSettings();
+
+  const edge = useDmnEditorStore((s) =>
+    
s.computed(s).getDiagramData(externalModelsByNamespace).selectedEdgesById.get(edgeId)
+  );
+
+  const description = useDmnEditorStore((s) => {
+    if (!edge?.data) {
+      return undefined;
+    }
+    const { requirementType, index, id: parentId } = edge.data.dmnObject;
+    const defs = s.dmn.model.definitions;
+
+    if (requirementType === "association") {
+      return (defs.artifact![index] as 
Normalized<DMN_LATEST__tAssociation>).description?.__$$text ?? "";
+    }
+
+    const parentIndex = (defs.drgElement ?? []).findIndex((e) => e["@_id"] === 
parentId);
+    if (parentIndex < 0) {
+      return "";
+    }
+    const parent = defs.drgElement![parentIndex];
+
+    if (requirementType === "informationRequirement") {
+      return (
+        (parent as { informationRequirement?: 
Normalized<DMN_LATEST__tInformationRequirement>[] })
+          .informationRequirement?.[index]?.description?.__$$text ?? ""
+      );
+    }
+    if (requirementType === "knowledgeRequirement") {
+      return (
+        (parent as { knowledgeRequirement?: 
Normalized<DMN_LATEST__tKnowledgeRequirement>[] }).knowledgeRequirement?.[
+          index
+        ]?.description?.__$$text ?? ""
+      );
+    }
+    if (requirementType === "authorityRequirement") {
+      return (
+        (parent as { authorityRequirement?: 
Normalized<DMN_LATEST__tAuthorityRequirement>[] }).authorityRequirement?.[
+          index
+        ]?.description?.__$$text ?? ""
+      );
+    }
+    return "";
+  });
+
+  const [isSectionExpanded, setSectionExpanded] = useState<boolean>(true);
+
+  const Icon = useMemo(() => {
+    if (!edge) {
+      return () => null;
+    }
+    switch (edge.type) {
+      case EDGE_TYPES.informationRequirement:
+        return () => (
+          <svg
+            viewBox={`0 0 ${edgeSvgViewboxSize} ${edgeSvgViewboxSize}`}
+            className={"kie-dmn-editor--round-svg-container"}
+            style={{ padding: `${svgViewboxPadding}px` }}
+          >
+            <InformationRequirementPath d={`M2,${edgeSvgViewboxSize - 2} 
L${edgeSvgViewboxSize - 2},0`} />
+          </svg>
+        );
+      case EDGE_TYPES.knowledgeRequirement:
+        return () => (
+          <svg
+            viewBox={`0 0 ${edgeSvgViewboxSize} ${edgeSvgViewboxSize}`}
+            className={"kie-dmn-editor--round-svg-container"}
+            style={{ padding: `${svgViewboxPadding}px` }}
+          >
+            <KnowledgeRequirementPath d={`M2,${edgeSvgViewboxSize - 2} 
L${edgeSvgViewboxSize - 2},0`} />
+          </svg>
+        );
+      case EDGE_TYPES.authorityRequirement:
+        return () => (
+          <svg
+            viewBox={`0 0 ${edgeSvgViewboxSize} ${edgeSvgViewboxSize}`}
+            className={"kie-dmn-editor--round-svg-container"}
+            style={{ padding: `${svgViewboxPadding}px` }}
+          >
+            <AuthorityRequirementPath
+              d={`M2,${edgeSvgViewboxSize - 2} L${edgeSvgViewboxSize - 2},2`}
+              centerToConnectionPoint={false}
+            />
+          </svg>
+        );
+      case EDGE_TYPES.association:
+        return () => (
+          <svg
+            viewBox={`0 0 ${edgeSvgViewboxSize} ${edgeSvgViewboxSize}`}
+            className={"kie-dmn-editor--round-svg-container"}
+            style={{ padding: `${svgViewboxPadding}px` }}
+          >
+            <AssociationPath d={`M2,${edgeSvgViewboxSize - 2} 
L${edgeSvgViewboxSize},0`} strokeWidth={2} />
+          </svg>
+        );
+      default:
+        return () => null;
+    }
+  }, [edge]);
+
+  const title = useMemo(() => {
+    if (!edge) {
+      return i18n.propertiesPanel.edge;
+    }
+    switch (edge.type) {
+      case EDGE_TYPES.informationRequirement:
+        return i18n.propertiesPanel.informationRequirement;
+      case EDGE_TYPES.knowledgeRequirement:
+        return i18n.propertiesPanel.knowledgeRequirement;
+      case EDGE_TYPES.authorityRequirement:
+        return i18n.propertiesPanel.authorityRequirement;
+      case EDGE_TYPES.association:
+        return i18n.propertiesPanel.association;
+      default:
+        return i18n.propertiesPanel.edge;
+    }
+  }, [edge, i18n]);
+
+  if (!edge) {
+    return <>{i18n.propertiesPanel.edgeNotFound(edgeId)}</>;
+  }
+
+  return (
+    <Form>
+      <FormSection
+        className={!isSectionExpanded ? 
"kie-dmn-editor--single-node-properties-title-colapsed" : ""}
+        title={
+          <PropertiesPanelHeader
+            expands={true}
+            fixed={true}
+            isSectionExpanded={isSectionExpanded}
+            toogleSectionExpanded={() => setSectionExpanded((prev) => !prev)}
+            icon={<Icon />}
+            title={title}
+            action={
+              <Button
+                title={i18n.close}
+                variant={ButtonVariant.plain}
+                onClick={() => {
+                  dmnEditorStoreApi.setState((state) => {
+                    state.boxedExpressionEditor.propertiesPanel.isOpen = false;
+                    state.diagram.propertiesPanel.isOpen = false;
+                  });
+                }}
+              >
+                <TimesIcon />
+              </Button>
+            }
+          />
+        }
+      >
+        {isSectionExpanded && (
+          <FormSection style={{ paddingLeft: "20px" }}>
+            <FormGroup label={i18n.propertiesPanel.description}>
+              <TextArea
+                aria-label={"Description"}
+                isDisabled={settings.isReadOnly}
+                value={description ?? ""}
+                onChange={(_event, newDescription) => {
+                  dmnEditorStoreApi.setState((state) => {
+                    const { requirementType, index, id: parentId } = 
edge.data!.dmnObject;
+                    const defs = state.dmn.model.definitions;
+
+                    if (requirementType === "association") {
+                      (defs.artifact![index] as 
Normalized<DMN_LATEST__tAssociation>).description = {
+                        __$$text: newDescription,
+                      };
+                      return;
+                    }
+
+                    const parentIndex = (defs.drgElement ?? []).findIndex((e) 
=> e["@_id"] === parentId);
+                    if (parentIndex < 0) {
+                      return;
+                    }
+                    const parent = defs.drgElement![parentIndex];
+
+                    if (requirementType === "informationRequirement") {
+                      (
+                        parent as { informationRequirement?: 
Normalized<DMN_LATEST__tInformationRequirement>[] }
+                      ).informationRequirement![index].description = { 
__$$text: newDescription };
+                    } else if (requirementType === "knowledgeRequirement") {
+                      (
+                        parent as { knowledgeRequirement?: 
Normalized<DMN_LATEST__tKnowledgeRequirement>[] }
+                      ).knowledgeRequirement![index].description = { __$$text: 
newDescription };
+                    } else if (requirementType === "authorityRequirement") {
+                      (
+                        parent as { authorityRequirement?: 
Normalized<DMN_LATEST__tAuthorityRequirement>[] }
+                      ).authorityRequirement![index].description = { __$$text: 
newDescription };
+                    }
+                  });
+                }}
+                placeholder={i18n.propertiesPanel.descriptionPlaceholder}
+                style={{ resize: "vertical", minHeight: "40px" }}
+                rows={6}
+              />
+            </FormGroup>
+            <FormGroup label={i18n.propertiesPanel.id}>
+              <ClipboardCopy
+                isReadOnly={true}
+                hoverTip={i18n.propertiesPanel.copy}
+                clickTip={i18n.propertiesPanel.copied}
+              >
+                {edgeId}
+              </ClipboardCopy>
+            </FormGroup>
+          </FormSection>
+        )}
+      </FormSection>
+    </Form>
+  );
+}
diff --git a/packages/dmn-editor/tests-e2e/__fixtures__/base.ts 
b/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
index 012ed1a5a60..b5032c32232 100644
--- a/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
+++ b/packages/dmn-editor/tests-e2e/__fixtures__/base.ts
@@ -33,6 +33,7 @@ import { InputDataPropertiesPanel } from 
"./propertiesPanel/inputDataPropertiesP
 import { GroupPropertiesPanel } from "./propertiesPanel/groupPropertiesPanel";
 import { DiagramPropertiesPanel } from 
"./propertiesPanel/diagramPropertiesPanel";
 import { MultipleNodesPropertiesPanel } from 
"./propertiesPanel/multipleNodesPropertiesPanel";
+import { EdgePropertiesPanel } from "./propertiesPanel/edgePropertiesPanel";
 import { Overlays } from "./overlays";
 import { Drds } from "./drds";
 import { DrgNodes } from "./drgNodes";
@@ -62,6 +63,7 @@ type DmnEditorFixtures = {
   decisionPropertiesPanel: DecisionPropertiesPanel;
   decisionServicePropertiesPanel: DecisionServicePropertiesPanel;
   diagramPropertiesPanel: DiagramPropertiesPanel;
+  edgePropertiesPanel: EdgePropertiesPanel;
   groupPropertiesPanel: GroupPropertiesPanel;
   inputDataPropertiesPanel: InputDataPropertiesPanel;
   knowledgeSourcePropertiesPanel: KnowledgeSourcePropertiesPanel;
@@ -123,6 +125,9 @@ export const test = base.extend<DmnEditorFixtures>({
   diagramPropertiesPanel: async ({ diagram, page }, use) => {
     await use(new DiagramPropertiesPanel(diagram, page));
   },
+  edgePropertiesPanel: async ({ diagram, page }, use) => {
+    await use(new EdgePropertiesPanel(diagram, page));
+  },
   groupPropertiesPanel: async ({ diagram, page }, use) => {
     await use(new GroupPropertiesPanel(diagram, page));
   },
diff --git 
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/edgePropertiesPanel.ts
 
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/edgePropertiesPanel.ts
new file mode 100644
index 00000000000..0c03911498d
--- /dev/null
+++ 
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/edgePropertiesPanel.ts
@@ -0,0 +1,62 @@
+/*
+ * 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 { Page } from "@playwright/test";
+import { Diagram } from "../diagram";
+import { EdgeType } from "../edges";
+import { PropertiesPanelBase } from "./propertiesPanelBase";
+
+export const EDGE_TITLE: Record<EdgeType, string> = {
+  [EdgeType.INFORMATION_REQUIREMENT]: "Information Requirement",
+  [EdgeType.KNOWLEDGE_REQUIREMENT]: "Knowledge Requirement",
+  [EdgeType.AUTHORITY_REQUIREMENT]: "Authority Requirement",
+  [EdgeType.ASSOCIATION]: "Association",
+};
+
+export const uuidRegExp = 
/^_[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/;
+
+export class EdgePropertiesPanel extends PropertiesPanelBase {
+  constructor(
+    public diagram: Diagram,
+    public page: Page
+  ) {
+    super(diagram, page);
+  }
+
+  /** Returns the text content of the panel header title (e.g. "Information 
Requirement"). */
+  public async getTitle() {
+    return await 
this.panel().locator(".kie-dmn-editor--properties-panel-header-title").first().textContent();
+  }
+
+  /** Returns the current value of the Description textarea. */
+  public async getDescription() {
+    return await this.panel().getByLabel("Description").inputValue();
+  }
+
+  /** Sets the Description textarea to the given value. */
+  public async setDescription(args: { newDescription: string }) {
+    await this.panel().getByLabel("Description").fill(args.newDescription);
+    await this.panel().getByLabel("Description").press("Tab");
+  }
+
+  /** Returns the read-only edge ID shown in the ClipboardCopy field. */
+  public async getId() {
+    return await this.panel().locator("input[readonly]").first().inputValue();
+  }
+}
diff --git 
a/packages/dmn-editor/tests-e2e/drgRequirements/edgeProperties.spec.ts 
b/packages/dmn-editor/tests-e2e/drgRequirements/edgeProperties.spec.ts
new file mode 100644
index 00000000000..478a46d393d
--- /dev/null
+++ b/packages/dmn-editor/tests-e2e/drgRequirements/edgeProperties.spec.ts
@@ -0,0 +1,202 @@
+/*
+ * 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 { test, expect } from "../__fixtures__/base";
+import { DefaultNodeName, NodeType } from "../__fixtures__/nodes";
+import { EdgeType } from "../__fixtures__/edges";
+import { EDGE_TITLE, uuidRegExp } from 
"../__fixtures__/propertiesPanel/edgePropertiesPanel";
+
+test.beforeEach(async ({ editor }) => {
+  await editor.open();
+});
+
+test.describe("Edge Properties Panel", () => {
+  test.describe("Information Requirement edge", () => {
+    test.beforeEach(async ({ palette, nodes }) => {
+      await palette.dragNewNode({ type: NodeType.INPUT_DATA, targetPosition: { 
x: 100, y: 100 } });
+      await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { 
x: 100, y: 300 } });
+      await nodes.dragNewConnectedEdge({
+        type: EdgeType.INFORMATION_REQUIREMENT,
+        from: DefaultNodeName.INPUT_DATA,
+        to: DefaultNodeName.DECISION,
+      });
+    });
+
+    test("should show 'Information Requirement' as the panel title when the 
edge is selected", async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: DefaultNodeName.INPUT_DATA, to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const title = await edgePropertiesPanel.getTitle();
+      expect(title?.trim()).toBe(EDGE_TITLE[EdgeType.INFORMATION_REQUIREMENT]);
+    });
+
+    test("should show the edge ID in the properties panel", async ({ edges, 
edgePropertiesPanel }) => {
+      await edges.select({ from: DefaultNodeName.INPUT_DATA, to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const id = await edgePropertiesPanel.getId();
+      expect(id).toBeTruthy();
+      expect(id).toMatch(uuidRegExp);
+    });
+
+    test("should set and get the edge description for Information 
Requirement", async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: DefaultNodeName.INPUT_DATA, to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+      await edgePropertiesPanel.setDescription({ newDescription: "Edge 
description" });
+
+      expect(await edgePropertiesPanel.getDescription()).toBe("Edge 
description");
+    });
+  });
+
+  test.describe("Knowledge Requirement edge", () => {
+    test.beforeEach(async ({ palette, nodes }) => {
+      await palette.dragNewNode({ type: NodeType.BKM, targetPosition: { x: 
100, y: 100 }, thenRenameTo: "BKM - A" });
+      await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { 
x: 100, y: 300 } });
+      await nodes.dragNewConnectedEdge({
+        type: EdgeType.KNOWLEDGE_REQUIREMENT,
+        from: "BKM - A",
+        to: DefaultNodeName.DECISION,
+      });
+    });
+
+    test("should show 'Knowledge Requirement' as the panel title when the edge 
is selected", async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: "BKM - A", to: DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const title = await edgePropertiesPanel.getTitle();
+      expect(title?.trim()).toBe(EDGE_TITLE[EdgeType.KNOWLEDGE_REQUIREMENT]);
+    });
+
+    test("should show the edge ID in the properties panel", async ({ edges, 
edgePropertiesPanel }) => {
+      await edges.select({ from: "BKM - A", to: DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const id = await edgePropertiesPanel.getId();
+      expect(id).toBeTruthy();
+      expect(id).toMatch(uuidRegExp);
+    });
+
+    test("should set and get the edge description for Knowledge Requirement", 
async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: "BKM - A", to: DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+      await edgePropertiesPanel.setDescription({ newDescription: "Edge 
description" });
+
+      expect(await edgePropertiesPanel.getDescription()).toBe("Edge 
description");
+    });
+  });
+
+  test.describe("Authority Requirement edge", () => {
+    test.beforeEach(async ({ palette, nodes }) => {
+      await palette.dragNewNode({
+        type: NodeType.KNOWLEDGE_SOURCE,
+        targetPosition: { x: 100, y: 100 },
+        thenRenameTo: "Knowledge Source - A",
+      });
+      await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { 
x: 100, y: 300 } });
+      await nodes.dragNewConnectedEdge({
+        type: EdgeType.AUTHORITY_REQUIREMENT,
+        from: "Knowledge Source - A",
+        to: DefaultNodeName.DECISION,
+      });
+    });
+
+    test("should show 'Authority Requirement' as the panel title when the edge 
is selected", async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: "Knowledge Source - A", to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const title = await edgePropertiesPanel.getTitle();
+      expect(title?.trim()).toBe(EDGE_TITLE[EdgeType.AUTHORITY_REQUIREMENT]);
+    });
+
+    test("should show the edge ID in the properties panel", async ({ edges, 
edgePropertiesPanel }) => {
+      await edges.select({ from: "Knowledge Source - A", to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+
+      const id = await edgePropertiesPanel.getId();
+      expect(id).toBeTruthy();
+      expect(id).toMatch(uuidRegExp);
+    });
+
+    test("should set and get the edge description for Authority Requirement", 
async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: "Knowledge Source - A", to: 
DefaultNodeName.DECISION });
+      await edgePropertiesPanel.open();
+      await edgePropertiesPanel.setDescription({ newDescription: "Edge 
description" });
+
+      expect(await edgePropertiesPanel.getDescription()).toBe("Edge 
description");
+    });
+  });
+
+  test.describe("Association edge", () => {
+    test.beforeEach(async ({ palette, nodes }) => {
+      await palette.dragNewNode({ type: NodeType.TEXT_ANNOTATION, 
targetPosition: { x: 400, y: 100 } });
+      await palette.dragNewNode({ type: NodeType.DECISION, targetPosition: { 
x: 100, y: 100 } });
+      await nodes.dragNewConnectedEdge({
+        type: EdgeType.ASSOCIATION,
+        from: DefaultNodeName.DECISION,
+        to: DefaultNodeName.TEXT_ANNOTATION,
+      });
+    });
+
+    test("should show 'Association' as the panel title when the edge is 
selected", async ({
+      edges,
+      edgePropertiesPanel,
+    }) => {
+      await edges.select({ from: DefaultNodeName.DECISION, to: 
DefaultNodeName.TEXT_ANNOTATION });
+      await edgePropertiesPanel.open();
+
+      const title = await edgePropertiesPanel.getTitle();
+      expect(title?.trim()).toBe(EDGE_TITLE[EdgeType.ASSOCIATION]);
+    });
+
+    test("should show the edge ID in the properties panel", async ({ edges, 
edgePropertiesPanel }) => {
+      await edges.select({ from: DefaultNodeName.DECISION, to: 
DefaultNodeName.TEXT_ANNOTATION });
+      await edgePropertiesPanel.open();
+
+      const id = await edgePropertiesPanel.getId();
+      expect(id).toBeTruthy();
+      expect(id).toMatch(uuidRegExp);
+    });
+
+    test("should set and get the edge description for Association", async ({ 
edges, edgePropertiesPanel }) => {
+      await edges.select({ from: DefaultNodeName.DECISION, to: 
DefaultNodeName.TEXT_ANNOTATION });
+      await edgePropertiesPanel.open();
+      await edgePropertiesPanel.setDescription({ newDescription: "Edge 
description" });
+
+      expect(await edgePropertiesPanel.getDescription()).toBe("Edge 
description");
+    });
+  });
+});


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

Reply via email to