fix(features/bpmn-modeling): correctly remove flow from outgoing/incoming
Related to #6
This commit is contained in:
parent
f1b023f419
commit
1947a9c4de
|
@ -89,8 +89,8 @@ BpmnFactory.prototype.createDiEdge = function(sequenceFlow, points, attrs) {
|
||||||
|
|
||||||
|
|
||||||
BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) {
|
BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) {
|
||||||
Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow.sourceRef);
|
Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow);
|
||||||
Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow.targetRef);
|
Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow);
|
||||||
|
|
||||||
_.extend(sequenceFlow, {
|
_.extend(sequenceFlow, {
|
||||||
sourceRef: null,
|
sourceRef: null,
|
||||||
|
|
|
@ -179,6 +179,10 @@ describe('features - bpmn-modeling', function() {
|
||||||
// then
|
// then
|
||||||
expect(connection.sourceRef).toBe(null);
|
expect(connection.sourceRef).toBe(null);
|
||||||
expect(connection.targetRef).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(connection.$parent).toBe(null);
|
||||||
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);
|
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue