From 257a96059b6588fcf001aa438378f242af0576ef Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Mon, 28 Oct 2024 15:43:19 +0100 Subject: [PATCH] test: verify zeebe:LoopCharacteristics fix --- test/camunda-cloud/CopyPasteBehaviorSpec.js | 86 ++------------------- 1 file changed, 6 insertions(+), 80 deletions(-) diff --git a/test/camunda-cloud/CopyPasteBehaviorSpec.js b/test/camunda-cloud/CopyPasteBehaviorSpec.js index fb4b6d2..dbc269f 100644 --- a/test/camunda-cloud/CopyPasteBehaviorSpec.js +++ b/test/camunda-cloud/CopyPasteBehaviorSpec.js @@ -59,85 +59,14 @@ describe('CopyPasteBehavior', function() { describe('zeebe:LoopCharacteristics', function() { - it('should allow on ServiceTask', function() { - - // given - const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), - serviceTask = moddle.create('bpmn:ServiceTask'), - extensionElements = moddle.create('bpmn:ExtensionElements'); - - extensionElements.$parent = serviceTask; - - // when - const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements); - - // then - expect(canCopyProperty).not.to.be.false; - }); - - - it('should allow on ReceiveTask', function() { - - // given - const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), - receiveTask = moddle.create('bpmn:ReceiveTask'), - extensionElements = moddle.create('bpmn:ExtensionElements'); - - extensionElements.$parent = receiveTask; - - // when - const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements); - - // then - expect(canCopyProperty).not.to.be.false; - }); - - - it('should allow on SubProcess', function() { - - // given - const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), - subProcess = moddle.create('bpmn:SubProcess'), - extensionElements = moddle.create('bpmn:ExtensionElements'); - - extensionElements.$parent = subProcess; - - // when - const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements); - - // then - expect(canCopyProperty).not.to.be.false; - }); - - - it('should not allow on CallActivity', function() { - - // given - const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), - callActivity = moddle.create('bpmn:CallActivity'), - extensionElements = moddle.create('bpmn:ExtensionElements'); - - extensionElements.$parent = callActivity; - - // when - const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements); - - // then - expect(canCopyProperty).to.be.false; - }); - - - it('should allow on intermediateThrowEvent with messageDefinition', function() { + it('should allow on bpmn:MultiInstanceLoopCharacteristics', function() { // given const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), extensionElements = moddle.create('bpmn:ExtensionElements'), - messageEventDefinition = moddle.create('bpmn:MessageEventDefinition'), - messageIntermediateThrowEvent = moddle.create('bpmn:IntermediateThrowEvent'); + multiInstanceLoopCharacteristics = moddle.create('bpmn:MultiInstanceLoopCharacteristics'); - extensionElements.$parent = messageIntermediateThrowEvent; - messageEventDefinition.$parent = messageIntermediateThrowEvent; - messageIntermediateThrowEvent.eventDefinitions = [ messageEventDefinition ]; + extensionElements.$parent = multiInstanceLoopCharacteristics; // when const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements); @@ -147,17 +76,14 @@ describe('CopyPasteBehavior', function() { }); - it('should not allow on errorEndEvent', function() { + it('should not allow on bpmn:StandardLoopCharacteristics', function() { // given const loopCharacteristics = moddle.create('zeebe:LoopCharacteristics'), extensionElements = moddle.create('bpmn:ExtensionElements'), - errorEventDefinition = moddle.create('bpmn:ErrorEventDefinition'), - endEvent = moddle.create('bpmn:EndEvent'); + standardLoopCharacteristics = moddle.create('bpmn:StandardLoopCharacteristics'); - extensionElements.$parent = endEvent; - errorEventDefinition.$parent = endEvent; - endEvent.eventDefinitions = [ errorEventDefinition ]; + extensionElements.$parent = standardLoopCharacteristics; // when const canCopyProperty = copyPasteBehavior.canCopyProperty(loopCharacteristics, extensionElements);