From 7ad344cfc526a7adcf79241497c6a745ea6ba31e Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Mon, 8 Aug 2016 09:30:40 +0200 Subject: [PATCH] fix(auto-resize): validate diagram-js auto resize fix related to #593 --- .../auto-resize/AutoResize.space-tool.bpmn | 38 +++++++++++++++++++ .../features/auto-resize/AutoResizeSpec.js | 37 ++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 test/spec/features/auto-resize/AutoResize.space-tool.bpmn diff --git a/test/spec/features/auto-resize/AutoResize.space-tool.bpmn b/test/spec/features/auto-resize/AutoResize.space-tool.bpmn new file mode 100644 index 00000000..843602d6 --- /dev/null +++ b/test/spec/features/auto-resize/AutoResize.space-tool.bpmn @@ -0,0 +1,38 @@ + + + + + + + + SequenceFlow_1 + + + + SequenceFlow_1 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/features/auto-resize/AutoResizeSpec.js b/test/spec/features/auto-resize/AutoResizeSpec.js index 5c0587d5..dddbaf72 100644 --- a/test/spec/features/auto-resize/AutoResizeSpec.js +++ b/test/spec/features/auto-resize/AutoResizeSpec.js @@ -567,4 +567,41 @@ describe('features/auto-resize', function() { }); + describe('space-tool', function() { + + var diagramXML = require('./AutoResize.space-tool.bpmn'); + + var taskShape, + participantShape, + originalBounds; + + beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); + + beforeEach(inject(function(elementRegistry) { + + taskShape = elementRegistry.get('Task_1'); + participantShape = elementRegistry.get('Participant_1'); + + originalBounds = getBounds(participantShape); + + })); + + + it('should not expand after space-tool', inject(function(modeling) { + + // given + var delta = { x: 50, y: 0 }, + direction = 'e'; + + // when + modeling.createSpace([ taskShape ], [], delta, direction); + + // then + var newBounds = getBounds(participantShape); + + expect(originalBounds).to.eql(newBounds); + })); + + }); + });