From 1947a9c4de3d8b6fa901ad8bbd9904db640c56e1 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Fri, 18 Jul 2014 15:10:33 +0200 Subject: [PATCH] fix(features/bpmn-modeling): correctly remove flow from outgoing/incoming Related to #6 --- lib/features/bpmn-modeling/BpmnFactory.js | 4 ++-- test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/features/bpmn-modeling/BpmnFactory.js b/lib/features/bpmn-modeling/BpmnFactory.js index 01957a5c..b97b3099 100644 --- a/lib/features/bpmn-modeling/BpmnFactory.js +++ b/lib/features/bpmn-modeling/BpmnFactory.js @@ -89,8 +89,8 @@ BpmnFactory.prototype.createDiEdge = function(sequenceFlow, points, attrs) { BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) { - Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow.sourceRef); - Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow.targetRef); + Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow); + Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow); _.extend(sequenceFlow, { sourceRef: null, diff --git a/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js b/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js index b9c28b0e..95e89509 100644 --- a/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js +++ b/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js @@ -179,6 +179,10 @@ describe('features - bpmn-modeling', function() { // then expect(connection.sourceRef).toBe(null); expect(connection.targetRef).toBe(null); + + expect(startEvent.get('outgoing')).not.toContain(connection); + expect(target.get('incoming')).not.toContain(connection); + expect(connection.$parent).toBe(null); expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);