Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmotta committed Mar 28, 2024
1 parent efbea6f commit a3d0499
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,9 @@ import {
DMNDI15__DMNShape,
} from "@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Page } from "@playwright/test";
import { STORYBOOK__DMN_EDITOR_MODEL } from "../jsonModel";

type AllDrgElements = NonNullable<DMN15__tDefinitions["drgElement"]>[0];

export enum DataType {
Undefined = "<Undefined>",
Any = "Any",
Boolean = "boolean",
Context = "context",
Date = "date",
DateTime = "date and time",
DateTimeDuration = "days and time duration",
Number = "number",
String = "string",
Time = "time",
YearsMonthsDuration = "years and months duration",
}

export class DrgElements {
constructor(public page: Page) {}

Expand Down
1 change: 1 addition & 0 deletions packages/dmn-editor/tests/e2e/__fixtures__/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class Nodes {
return this.get({ name: args.name }).locator("span", { hasText: args.name }).dblclick();
}

// Used for testing invalid edges. No edge is created using this method.
public async startDraggingEdge(args: { from: string; edgeType: EdgeType }) {
await this.select({ name: args.from, position: NodePosition.TOP });
await this.get({ name: args.from }).getByTitle(this.getAddEdgeTitle(args.edgeType)).hover();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test.describe("Invalid edge - Authority Requirement", () => {
});
});

test("shouldn't add an Authority Requirement edge from Input Data node to Input Data node", async ({
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Input Data node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -77,7 +77,7 @@ test.describe("Invalid edge - Authority Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Authority Requirement edge from Input Data node to Decision Service node", async ({
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Decision Service node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -108,7 +108,7 @@ test.describe("Invalid edge - Authority Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.DECISION_SERVICE })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Authority Requirement edge from Input Data node to Group node", async ({
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Group node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -139,7 +139,7 @@ test.describe("Invalid edge - Authority Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.GROUP })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Authority Requirement edge from Input Data node to Text Annotation node", async ({
test("shouldn't add an Authority Requirement edge from Knowledge Source node to Text Annotation node", async ({
palette,
nodes,
edges,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {
});
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Input Data node", async ({
test("shouldn't add an Knowledge Requirement edge from BKM node to Input Data node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -77,7 +77,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.INPUT_DATA })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Knowledge Source node", async ({
test("shouldn't add an Knowledge Requirement edge from BKM node to Knowledge Source node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -107,7 +107,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.KNOWLEDGE_SOURCE })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Group node", async ({
test("shouldn't add an Knowledge Requirement edge from BKM node to Group node", async ({
palette,
nodes,
edges,
Expand Down Expand Up @@ -138,7 +138,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {
await expect(nodes.get({ name: DefaultNodeName.GROUP })).toHaveClass(/.*dimmed/);
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Text Annotation node", async ({
test("shouldn't add an Knowledge Requirement edge from BKM node to Text Annotation node", async ({
palette,
nodes,
edges,
Expand Down

0 comments on commit a3d0499

Please sign in to comment.