From a40b95cf2fa1964182ce2382df89fbeb5b9996ea Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 18 Apr 2019 17:55:42 +0200 Subject: [PATCH] test(modeling): verify connection layouting on element removal Closes #989 --- .../behavior/RemoveElementBehaviorSpec.js | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js index 624ce4eb..24f002dc 100644 --- a/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js @@ -188,14 +188,14 @@ describe('features/modeling - remove element behavior', function() { }); - describe('connections layout', function() { + describe('connection layouting', function() { var processDiagramXML = require('./RemoveElementBehavior.diagonal.bpmn'); beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules })); - it('should layout connection', inject(function(modeling, elementRegistry) { + it('should execute', inject(function(modeling, elementRegistry) { // given var task = elementRegistry.get('Task1'); @@ -223,6 +223,26 @@ describe('features/modeling - remove element behavior', function() { })); + + it('should redo', inject(function(commandStack, modeling, elementRegistry) { + + // given + var task = elementRegistry.get('Task1'), + connection = elementRegistry.get('SequenceFlow1'), + newWaypoints; + + // when + modeling.removeShape(task); + + newWaypoints = connection.waypoints.slice(); + + commandStack.undo(); + commandStack.redo(); + + // then + expect(connection).to.have.waypoints(newWaypoints); + })); + }); });