Skip to content

Commit

Permalink
test(modeling): verify connection layouting on element removal
Browse files Browse the repository at this point in the history
Closes #989
  • Loading branch information
nikku committed Apr 18, 2019
1 parent 55ca4c8 commit a40b95c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions test/spec/features/modeling/behavior/RemoveElementBehaviorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}));

});

});
Expand Down

0 comments on commit a40b95c

Please sign in to comment.