Skip to content

Commit

Permalink
incorporate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jomarko committed Mar 19, 2024
1 parent e75b167 commit 93e6987
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions packages/dmn-editor/tests/e2e/__fixtures__/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export enum NodePosition {
export class Nodes {
constructor(public page: Page, public diagram: Diagram, public browserName: string) {}

public async asserrtIsDimmed(args: { name: string }) {
public async assertIsDimmed(args: { name: string }) {
await expect(this.page.locator(".dimmed").locator("span:has-text('" + args.name + "')")).toBeAttached();
}

Expand Down Expand Up @@ -86,7 +86,7 @@ export class Nodes {
? await this.getPositionalNodeHandleCoordinates({ node: to, position: args.position })
: undefined;

return from.getByTitle(this.getAddTitle(args.type)).dragTo(to, { targetPosition });
return from.getByTitle(this.getAddEdgeTitle(args.type)).dragTo(to, { targetPosition });
}

public async dragNewConnectedNode(args: {
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Nodes {

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.getAddTitle(args.edgeType)).hover();
await this.get({ name: args.from }).getByTitle(this.getAddEdgeTitle(args.edgeType)).hover();
await this.page.mouse.down();
}

Expand Down Expand Up @@ -221,7 +221,7 @@ export class Nodes {
}
}

private getAddTitle(edgeType: EdgeType) {
private getAddEdgeTitle(edgeType: EdgeType) {
switch (edgeType) {
case EdgeType.ASSOCIATION:
return "Add Association edge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.beforeEach(async ({ editor }) => {
});

test.describe("Invalid edge - Authority Requirement", () => {
test.describe("Knowledge Source", () => {
test.describe("Invalid edge - Authority Requirement - From Knowledge Source", () => {
test.beforeEach(async ({ palette }) => {
await palette.dragNewNode({
type: NodeType.KNOWLEDGE_SOURCE,
Expand Down Expand Up @@ -62,7 +62,7 @@ test.describe("Invalid edge - Authority Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.INPUT_DATA });
await nodes.assertIsDimmed({ name: DefaultNodeName.INPUT_DATA });
});

test("shouldn't add an Authority Requirement edge from Input Data node to Decision Service node", async ({
Expand Down Expand Up @@ -93,7 +93,7 @@ test.describe("Invalid edge - Authority Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.DECISION_SERVICE });
await nodes.assertIsDimmed({ name: DefaultNodeName.DECISION_SERVICE });
});

test("shouldn't add an Authority Requirement edge from Input Data node to Group node", async ({
Expand Down Expand Up @@ -124,7 +124,7 @@ test.describe("Invalid edge - Authority Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.GROUP });
await nodes.assertIsDimmed({ name: DefaultNodeName.GROUP });
});

test("shouldn't add an Authority Requirement edge from Input Data node to Text Annotation node", async ({
Expand Down Expand Up @@ -154,7 +154,7 @@ test.describe("Invalid edge - Authority Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.AUTHORITY_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.TEXT_ANNOTATION });
await nodes.assertIsDimmed({ name: DefaultNodeName.TEXT_ANNOTATION });
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.beforeEach(async ({ editor }) => {
});

test.describe("Invalid edge - Knowledge Requirement", () => {
test.describe("BKM", () => {
test.describe("Invalid edge - Knowledge Requirement - From BKM", () => {
test.beforeEach(async ({ palette }) => {
await palette.dragNewNode({
type: NodeType.BKM,
Expand Down Expand Up @@ -62,7 +62,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.INPUT_DATA });
await nodes.assertIsDimmed({ name: DefaultNodeName.INPUT_DATA });
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Knowledge Source node", async ({
Expand Down Expand Up @@ -92,7 +92,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.KNOWLEDGE_SOURCE });
await nodes.assertIsDimmed({ name: DefaultNodeName.KNOWLEDGE_SOURCE });
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Group node", async ({
Expand Down Expand Up @@ -123,7 +123,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.GROUP });
await nodes.assertIsDimmed({ name: DefaultNodeName.GROUP });
});

test("shouldn't add an Knowledge Requirement edge from Input Data node to Text Annotation node", async ({
Expand Down Expand Up @@ -153,7 +153,7 @@ test.describe("Invalid edge - Knowledge Requirement", () => {

await nodes.startDraggingEdge({ from: "Source Node", edgeType: EdgeType.KNOWLEDGE_REQUIREMENT });

await nodes.asserrtIsDimmed({ name: DefaultNodeName.TEXT_ANNOTATION });
await nodes.assertIsDimmed({ name: DefaultNodeName.TEXT_ANNOTATION });
});
});
});

0 comments on commit 93e6987

Please sign in to comment.