From 35d976f74dd6ae3d470d915230976c3e8d46b8af Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Thu, 14 Nov 2019 07:11:18 +0100 Subject: [PATCH] WIP reconnect --- .../modeling/ReconnectConnectionSpec.js | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/test/spec/features/modeling/ReconnectConnectionSpec.js b/test/spec/features/modeling/ReconnectConnectionSpec.js index ef88a0f7f..50a52f8e6 100644 --- a/test/spec/features/modeling/ReconnectConnectionSpec.js +++ b/test/spec/features/modeling/ReconnectConnectionSpec.js @@ -56,6 +56,49 @@ describe('features/modeling - reconnect connection', function() { })); + describe('reconnect', function() { + + it('should execute', inject(function(modeling) { + + // when + modeling.reconnect(connection, childShape, connection.target); + + // then + expect(connection.source).to.equal(childShape); + })); + + + it('should undo', inject(function(modeling, commandStack) { + + // given + var oldSource = connection.source; + + modeling.reconnect(connection, childShape, connection.target); + + // when + commandStack.undo(); + + // then + expect(connection.source).to.equal(oldSource); + })); + + + it('should redo', inject(function(modeling, commandStack) { + + // given + modeling.reconnect(connection, childShape, connection.target); + + // when + commandStack.undo(); + commandStack.redo(); + + // then + expect(connection.source).to.equal(childShape); + })); + + }); + + describe('reconnectStart', function() { describe('passing position', function() { @@ -122,7 +165,6 @@ describe('features/modeling - reconnect connection', function() { }); - describe('passing waypoints', function() { it('should execute', inject(function(modeling) {