diff --git a/test/spec/features/modeling/behavior/ReplaceElementBehaviourSpec.js b/test/spec/features/modeling/behavior/ReplaceElementBehaviourSpec.js index 06a49ab617..1480b45c0b 100644 --- a/test/spec/features/modeling/behavior/ReplaceElementBehaviourSpec.js +++ b/test/spec/features/modeling/behavior/ReplaceElementBehaviourSpec.js @@ -246,7 +246,7 @@ describe('features/modeling - replace element behavior', function() { // then expect(transaction.children).to.have.length(1); - expect(endEventAfter.businessObject.eventDefinitions).to.exist; + expect(endEventAfter.businessObject.get('eventDefinitions')).not.to.be.empty; }) ); @@ -273,7 +273,7 @@ describe('features/modeling - replace element behavior', function() { // then expect(transaction.children).to.have.length(0); - expect(endEventAfter.businessObject.eventDefinitions).not.to.exist; + expect(endEventAfter.businessObject.get('eventDefinitions')).to.be.empty; }) ); @@ -302,7 +302,7 @@ describe('features/modeling - replace element behavior', function() { // then expect(transaction.children).to.have.length(1); - expect(endEventAfter.businessObject.eventDefinitions).to.exist; + expect(endEventAfter.businessObject.get('eventDefinitions')).not.to.be.empty; }) ); @@ -358,7 +358,7 @@ describe('features/modeling - replace element behavior', function() { })[0]; // then - expect(afterBoundaryEvent.businessObject.eventDefinitions).exist; + expect(afterBoundaryEvent.businessObject.get('eventDefinitions')).not.to.be.empty; expect(afterBoundaryEvent.businessObject.attachedToRef).to.equal(transaction.businessObject); expect(transaction.attachers).to.have.length(1); }) @@ -387,7 +387,7 @@ describe('features/modeling - replace element behavior', function() { })[0]; // then - expect(movedBoundaryEvent.businessObject.eventDefinitions).not.to.exist; + expect(movedBoundaryEvent.businessObject.get('eventDefinitions')).to.be.empty; expect(movedBoundaryEvent.businessObject.attachedToRef).to.equal(subProcess.businessObject); expect(movedBoundaryEvent.parent).to.equal(process); @@ -421,7 +421,7 @@ describe('features/modeling - replace element behavior', function() { })[0]; // then - expect(movedBoundaryEvent.businessObject.eventDefinitions).to.exist; + expect(movedBoundaryEvent.businessObject.get('eventDefinitions')).not.to.be.empty; expect(movedBoundaryEvent.businessObject.attachedToRef).to.equal(transaction.businessObject); expect(movedBoundaryEvent.host).to.equal(transaction); @@ -524,7 +524,7 @@ describe('features/modeling - replace element behavior', function() { var createdEvent = elementRegistry.get(id); expect(createdEvent).to.exist; - expect(createdEvent.businessObject.eventDefinitions).to.not.exist; + expect(createdEvent.businessObject.get('eventDefinitions')).to.be.empty; }) ); @@ -546,9 +546,9 @@ describe('features/modeling - replace element behavior', function() { var createdEvent = elementRegistry.get(id); expect(createdEvent).to.eql(startEvent); - expect(createdEvent.businessObject.eventDefinitions).to.have.lengthOf(1); + expect(createdEvent.businessObject.get('eventDefinitions')).to.have.lengthOf(1); expect( - is(createdEvent.businessObject.eventDefinitions[0], 'bpmn:TimerEventDefinition') + is(createdEvent.businessObject.get('eventDefinitions')[0], 'bpmn:TimerEventDefinition') ).to.be.true; }) ); @@ -573,7 +573,7 @@ describe('features/modeling - replace element behavior', function() { var createdEvent = elementRegistry.get(id); expect(createdEvent).to.exist; - expect(createdEvent.businessObject.eventDefinitions).not.to.exist; + expect(createdEvent.businessObject.get('eventDefinitions')).to.be.empty; expect(createdEvent.businessObject.get('isInterrupting')).to.be.true; }) ); diff --git a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js index 7528fa1cd7..523892feb0 100644 --- a/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js +++ b/test/spec/features/popup-menu/ReplaceMenuProviderSpec.js @@ -304,7 +304,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('active attribute', function() { - it('should be true for parallel marker', inject(function(bpmnReplace, elementRegistry) { + it('should be true for parallel marker', inject(function(elementRegistry) { // given var task = elementRegistry.get('ParallelTask'), @@ -324,7 +324,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should be true for sequential marker', inject(function(bpmnReplace, elementRegistry) { + it('should be true for sequential marker', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'), @@ -342,7 +342,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should be true for loop marker', inject(function(bpmnReplace, elementRegistry) { + it('should be true for loop marker', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'), @@ -360,7 +360,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should be true for ad hoc marker', inject(function(bpmnReplace, elementRegistry) { + it('should be true for ad hoc marker', inject(function(elementRegistry) { // given var AdHocSubProcess = elementRegistry.get('AdHocSubProcess'); @@ -377,7 +377,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('exclusive toggle buttons', function() { - it('should not toggle non exclusive buttons off', inject(function(bpmnReplace, elementRegistry) { + it('should not toggle non exclusive buttons off', inject(function(elementRegistry) { var subProcess = elementRegistry.get('AdHocSubProcess'); openPopup(subProcess); @@ -397,7 +397,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('non exclusive toggle buttons', function() { it('should not toggle exclusive buttons off', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var subProcess = elementRegistry.get('SubProcess'); @@ -431,7 +431,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('parallel toggle button', function() { it('should toggle parallel marker off', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var task = elementRegistry.get('ParallelTask'); @@ -452,7 +452,7 @@ describe('features/popup-menu - replace menu provider', function() { ); - it('should toggle parallel marker on', inject(function(bpmnReplace, elementRegistry) { + it('should toggle parallel marker on', inject(function(elementRegistry) { // given var task = elementRegistry.get('Task'); @@ -473,7 +473,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set sequential button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set sequential button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'); @@ -492,7 +492,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set loop button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set loop button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'); @@ -511,7 +511,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set loop characteristics type', inject(function(bpmnReplace, elementRegistry) { + it('should set loop characteristics type', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'), @@ -557,7 +557,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('sequential toggle button', function() { - it('should toggle sequential marker off', inject(function(bpmnReplace, elementRegistry) { + it('should toggle sequential marker off', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'); @@ -577,7 +577,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should toggle sequential marker on', inject(function(bpmnReplace, elementRegistry) { + it('should toggle sequential marker on', inject(function(elementRegistry) { // given var task = elementRegistry.get('Task'); @@ -598,7 +598,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set loop button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set loop button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'); @@ -617,7 +617,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set parallel button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set parallel button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('ParallelTask'); @@ -636,7 +636,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set loop characteristics type', inject(function(bpmnReplace, elementRegistry) { + it('should set loop characteristics type', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'), @@ -682,7 +682,7 @@ describe('features/popup-menu - replace menu provider', function() { describe('loop toggle button', function() { - it('should toggle loop marker off', inject(function(bpmnReplace, elementRegistry) { + it('should toggle loop marker off', inject(function(elementRegistry) { // given var task = elementRegistry.get('LoopTask'); @@ -702,7 +702,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should toggle loop marker on', inject(function(bpmnReplace, elementRegistry) { + it('should toggle loop marker on', inject(function(elementRegistry) { // given var task = elementRegistry.get('Task'); @@ -722,7 +722,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set sequential button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set sequential button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'); @@ -741,7 +741,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set parallel button inactive', inject(function(bpmnReplace, elementRegistry) { + it('should set parallel button inactive', inject(function(elementRegistry) { // given var task = elementRegistry.get('ParallelTask'); @@ -760,7 +760,7 @@ describe('features/popup-menu - replace menu provider', function() { })); - it('should set loop characteristics type', inject(function(bpmnReplace, elementRegistry) { + it('should set loop characteristics type', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'), @@ -852,7 +852,7 @@ describe('features/popup-menu - replace menu provider', function() { beforeEach(bootstrapModeler(diagramXMLMarkers, { modules: testModules })); - it('should retain the loop characteristics', inject(function(bpmnReplace, elementRegistry) { + it('should retain the loop characteristics', inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'); @@ -871,7 +871,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should retain the loop characteristics for call activites', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var task = elementRegistry.get('SequentialTask'); @@ -891,7 +891,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should retain expanded status for sub processes', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var subProcess = elementRegistry.get('SubProcess'); @@ -909,7 +909,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should replace sub processes -> event sub process', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var subProcess = elementRegistry.get('SubProcess'); @@ -927,7 +927,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should replace event sub processes -> sub process', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var eventSubProcess = elementRegistry.get('EventSubProcess'); @@ -945,7 +945,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should retain the loop characteristics and the expanded status for transactions', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var transaction = elementRegistry.get('Transaction'); @@ -963,12 +963,16 @@ describe('features/popup-menu - replace menu provider', function() { it('should not retain the loop characteristics morphing to an event sub process', - inject(function(bpmnReplace, elementRegistry, modeling) { + inject(function(bpmnFactory, elementRegistry, modeling) { // given var transaction = elementRegistry.get('Transaction'); - modeling.updateProperties(transaction, { loopCharacteristics: { isparallel: true } }); + modeling.updateProperties(transaction, { + loopCharacteristics: bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics', { + isParallel: true + }) + }); openPopup(transaction); @@ -983,7 +987,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should retain the expanded property morphing to an event sub processes', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var transaction = elementRegistry.get('Transaction'); @@ -1009,7 +1013,7 @@ describe('features/popup-menu - replace menu provider', function() { beforeEach(bootstrapModeler(diagramXMLReplace, { modules: testModules })); it('should contain all except the current one', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var startEvent = elementRegistry.get('StartEvent_1'); @@ -1025,7 +1029,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should contain all start events inside event sub process except the current one', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var startEvent = elementRegistry.get('StartEvent_3'); @@ -1066,7 +1070,7 @@ describe('features/popup-menu - replace menu provider', function() { ); it('should contain only start event, end event and intermediate throw event inside sub process except the current one', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var startEvent = elementRegistry.get('StartEvent_2'); @@ -1085,7 +1089,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should contain all intermediate events except the current one', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var intermediateEvent = elementRegistry.get('IntermediateThrowEvent_1'); @@ -1102,7 +1106,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should contain all end events except the current one', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var endEvent = elementRegistry.get('EndEvent_1'); @@ -1259,7 +1263,7 @@ describe('features/popup-menu - replace menu provider', function() { beforeEach(bootstrapModeler(diagramXMLReplace, { modules: testModules })); it('should contain all boundary events (except for cancel and currently active) for an interrupting boundary event', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var boundaryEvent = elementRegistry.get('BoundaryEvent_1'); @@ -1276,7 +1280,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should contain all boundary events (except for cancel and currently active) for a non interrupting boundary event', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var boundaryEvent = elementRegistry.get('BoundaryEvent_2'); @@ -1293,7 +1297,7 @@ describe('features/popup-menu - replace menu provider', function() { it('should contain compensation boundary event', - inject(function(bpmnReplace, elementRegistry) { + inject(function(elementRegistry) { // given var boundaryEvent = elementRegistry.get('BoundaryEvent_1'); diff --git a/test/spec/features/replace/BpmnReplaceSpec.js b/test/spec/features/replace/BpmnReplaceSpec.js index 6bf4246dd1..a180911380 100644 --- a/test/spec/features/replace/BpmnReplaceSpec.js +++ b/test/spec/features/replace/BpmnReplaceSpec.js @@ -181,7 +181,7 @@ describe('features/replace - bpmn replace', function() { eventDefinitionType: 'bpmn:TimerEventDefinition' }; - var eventDefinitions = boundaryBo.eventDefinitions.slice(); + var eventDefinitions = boundaryBo.get('eventDefinitions').slice(); // when var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData); @@ -192,7 +192,7 @@ describe('features/replace - bpmn replace', function() { expect(is(newBo, 'bpmn:BoundaryEvent')).to.be.true; - expect(newBo.eventDefinitions).to.jsonEqual(eventDefinitions, skipId); + expect(newBo.get('eventDefinitions')).to.jsonEqual(eventDefinitions, skipId); expect(newBo.cancelActivity).to.be.true; }) @@ -211,7 +211,7 @@ describe('features/replace - bpmn replace', function() { cancelActivity: false }; - var eventDefinitions = boundaryBo.eventDefinitions.slice(); + var eventDefinitions = boundaryBo.get('eventDefinitions').slice(); // when var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData); @@ -222,7 +222,7 @@ describe('features/replace - bpmn replace', function() { expect(is(newBo, 'bpmn:BoundaryEvent')).to.be.true; - expect(newBo.eventDefinitions).to.jsonEqual(eventDefinitions, skipId); + expect(newBo.get('eventDefinitions')).to.jsonEqual(eventDefinitions, skipId); expect(newBo.cancelActivity).to.be.false; }) @@ -244,7 +244,7 @@ describe('features/replace - bpmn replace', function() { var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData); var newBo = newElement.businessObject; - var newEventDefinitions = newBo.eventDefinitions; + var newEventDefinitions = newBo.get('eventDefinitions'); var newEventDefinition = newEventDefinitions[0]; // then @@ -273,7 +273,7 @@ describe('features/replace - bpmn replace', function() { var newElement = bpmnReplace.replaceElement(boundaryEvent, newElementData); var newBo = newElement.businessObject; - var newEventDefinitions = newBo.eventDefinitions; + var newEventDefinitions = newBo.get('eventDefinitions'); var newEventDefinition = newEventDefinitions[0]; // then @@ -1220,7 +1220,7 @@ describe('features/replace - bpmn replace', function() { })[0]; // then - expect(startEventAfter.businessObject.eventDefinitions).not.to.exist; + expect(startEventAfter.businessObject.get('eventDefinitions')).is.empty; }) ); @@ -1240,7 +1240,7 @@ describe('features/replace - bpmn replace', function() { })[0]; // then - expect(startEventAfter.businessObject.eventDefinitions[0].$type).to.equal('bpmn:MessageEventDefinition'); + expect(startEventAfter.businessObject.get('eventDefinitions')[0].$type).to.equal('bpmn:MessageEventDefinition'); }) ); @@ -1642,7 +1642,7 @@ describe('features/replace - bpmn replace', function() { eventDefinitionType: 'bpmn:MessageEventDefinition' }); - var parent = messageEvent.businessObject.eventDefinitions[0].$parent; + var parent = messageEvent.businessObject.get('eventDefinitions')[0].$parent; expect(parent).to.exist; expect(parent).to.equal(messageEvent.businessObject); @@ -1662,7 +1662,7 @@ describe('features/replace - bpmn replace', function() { eventDefinitionType: 'bpmn:ConditionalEventDefinition' }); - var definition = messageEvent.businessObject.eventDefinitions[0]; + var definition = messageEvent.businessObject.get('eventDefinitions')[0]; // then expect(definition.condition).to.exist;