diff --git a/lib/features/copy-paste/BpmnCopyPaste.js b/lib/features/copy-paste/BpmnCopyPaste.js index 194c8ec3..f4c036f3 100644 --- a/lib/features/copy-paste/BpmnCopyPaste.js +++ b/lib/features/copy-paste/BpmnCopyPaste.js @@ -108,7 +108,7 @@ export default function BpmnCopyPaste(bpmnFactory, eventBus, moddleCopy) { property = reference.property; if (key === descriptor.id) { - element[ property ] = businessObject; + element.set(property, businessObject); array.push(descriptor.id); } diff --git a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js index 3923348c..13ab5f2a 100644 --- a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js +++ b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js @@ -227,7 +227,7 @@ describe('features/copy-paste', function() { describe('integration', function() { - it('should copy conditional and default flow properties', + it('should copy conditionExpression and default flow properties', inject(function(canvas, copyPaste, elementRegistry, modeling) { // given @@ -264,11 +264,12 @@ describe('features/copy-paste', function() { expect(conditionalFlow).to.exist; expect(defaultFlow).to.exist; + expect(Object.prototype.propertyIsEnumerable.call(taskBo, 'default')).to.be.false; }) ); - it('should copy attacher properties', inject(function(canvas, copyPaste, elementRegistry) { + it('should copy attachedToRef properties', inject(function(canvas, copyPaste, elementRegistry) { // given var task = elementRegistry.get('Task_1'), @@ -296,11 +297,13 @@ describe('features/copy-paste', function() { }); // then - expect(getBusinessObject(boundaryEvent).attachedToRef).to.equal(getBusinessObject(task)); + var boundaryEventBo = getBusinessObject(boundaryEvent); + + expect(boundaryEventBo.attachedToRef).to.equal(getBusinessObject(task)); })); - it('should copy loop characteristics porperties', + it('should copy loopCharacteristics properties', inject(function(canvas, copyPaste, elementRegistry, modeling) { // given @@ -375,7 +378,7 @@ describe('features/copy-paste', function() { it('should copy label', inject( - function(canvas, copyPaste, elementRegistry, modeling) { + function(canvas, copyPaste, elementRegistry) { // given var startEvent = elementRegistry.get('StartEvent_1'),