From 729ddce8211c21778adb43d37b404a1e90cf7f9c Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 18 Jan 2018 11:22:01 +0100 Subject: [PATCH] fix(copy-paste): don't override descriptor property This is redundant anyway, as we take the type + additional information from the to-be-copied business object. Closes #751 --- lib/features/copy-paste/BpmnCopyPaste.js | 1 - .../features/copy-paste/BpmnCopyPasteSpec.js | 24 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/features/copy-paste/BpmnCopyPaste.js b/lib/features/copy-paste/BpmnCopyPaste.js index fc2f8522..4b98505d 100644 --- a/lib/features/copy-paste/BpmnCopyPaste.js +++ b/lib/features/copy-paste/BpmnCopyPaste.js @@ -54,7 +54,6 @@ function BpmnCopyPaste( } setProperties(descriptor, businessObject, [ - 'type', 'processRef', 'triggeredByEvent' ]); diff --git a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js index 6ed23d78..398c4c2e 100644 --- a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js +++ b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js @@ -33,7 +33,9 @@ describe('features/copy-paste', function() { describe('basic diagram', function() { - beforeEach(bootstrapModeler(basicXML, { modules: testModules })); + beforeEach(bootstrapModeler(basicXML, { + modules: testModules + })); describe('copy', function() { @@ -55,6 +57,26 @@ describe('features/copy-paste', function() { expect(subProcess.isExpanded).to.be.true; })); + + it('selected elements 2', inject(function(elementRegistry, copyPaste) { + + // given + var event = elementRegistry.get('StartEvent_1'); + + // add business object type property + event.businessObject.type = 'Foo'; + + // when + var tree = copy([ event ]); + + var eventDescriptor = tree.getElement('StartEvent_1'); + + // then + expect(tree.getLength()).to.equal(1); + + expect(eventDescriptor.type).to.eql('bpmn:StartEvent'); + })); + });