test(modeling): verify connection layouting on element removal

Closes #989
This commit is contained in:
Nico Rehwaldt 2019-04-18 17:55:42 +02:00
parent 55ca4c8f3d
commit a40b95cf2f
1 changed files with 22 additions and 2 deletions

View File

@ -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);
}));
});
});