rajalakshmys-27 commented on code in PR #3556: URL: https://github.com/apache/incubator-kie-tools/pull/3556#discussion_r3187409680
########## packages/bpmn-editor/tests-e2e/flowElements/boundaryEventCompensation.spec.ts: ########## @@ -0,0 +1,165 @@ +/* + * 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 { NodeType } from "../__fixtures__/nodes"; + +test.beforeEach(async ({ editor }) => { + await editor.open(); +}); + +test.describe("Compensation Boundary Events", () => { + test("should create compensation boundary event on task", async ({ + palette, + jsonModel, + page, + intermediateEventPropertiesPanel, + }) => { + await palette.dragNewNode({ type: NodeType.TASK, targetPosition: { x: 300, y: 300 } }); + await palette.dragNewNode({ type: NodeType.INTERMEDIATE_CATCH_EVENT, targetPosition: { x: 450, y: 300 } }); + + const boundaryEvent = await jsonModel.getFlowElement({ elementIndex: 1 }); + expect(boundaryEvent.__$$element).toBe("boundaryEvent"); + expect(boundaryEvent["@_attachedToRef"]).toBeDefined(); + + const eventNode = page.locator(".kie-bpmn-editor--intermediate-catch-event-node").first(); + await eventNode.click(); + + await intermediateEventPropertiesPanel.setCompensationDefinition({}); + await intermediateEventPropertiesPanel.setCancelActivity({ cancelActivity: false }); + + await expect + .poll( + async () => { + return await jsonModel.getFlowElement({ elementIndex: 1 }); + }, + { timeout: 10000 } + ) + .toMatchObject({ + __$$element: "boundaryEvent", + "@_attachedToRef": expect.stringMatching(/.+/), + "@_cancelActivity": false, + eventDefinition: [{ __$$element: "compensateEventDefinition" }], + }); + + const cancelActivity = await intermediateEventPropertiesPanel.getCancelActivity(); + expect(cancelActivity).toBe(false); + }); + + test.skip("should not allow incoming sequence flows to compensation boundary event", async ({ + // TODO: Enable when compensation boundary event validation is implemented Review Comment: I’ve already raised this issue and I’ll take action soon. -- 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]
