diff --git a/test/spec/features/modeling/behavior/ResizeBehaviorSpec.js b/test/spec/features/modeling/behavior/ResizeBehaviorSpec.js index aa9f63ec2..859c4a1bb 100644 --- a/test/spec/features/modeling/behavior/ResizeBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/ResizeBehaviorSpec.js @@ -326,6 +326,66 @@ describe('features/modeling - resize behavior', function() { }) ); + + it('should snap to nested child lanes from ', inject( + function(dragging, elementRegistry, resize) { + + // given + var lane = elementRegistry.get('Lane_A'); + + // when + resize.activate(canvasEvent({ x: 0, y: 0 }), lane, 'ne'); + + dragging.move(canvasEvent({ x: -500, y: 500 })); + + dragging.end(); + + // then + expect(lane.width).to.equal(330); + expect(lane.height).to.equal(105); + }) + ); + + + it('should snap to nested child lanes from ', inject( + function(dragging, elementRegistry, resize) { + + // given + var lane = elementRegistry.get('Lane_A'); + + // when + resize.activate(canvasEvent({ x: 0, y: 0 }), lane, 'sw'); + + dragging.move(canvasEvent({ x: 500, y: -500 })); + + dragging.end(); + + // then + expect(lane.width).to.equal(563); + expect(lane.height).to.equal(60); + }) + ); + + + it('should snap to other sibling lanes child participants from ', inject( + function(dragging, elementRegistry, resize) { + + // given + var lane = elementRegistry.get('Lane_B_0'); + + // when + resize.activate(canvasEvent({ x: 0, y: 0 }), lane, 'nw'); + + dragging.move(canvasEvent({ x: 500, y: 500 })); + + dragging.end(); + + // then + expect(lane.width).to.equal(563); + expect(lane.height).to.equal(60); + }) + ); + }); @@ -893,6 +953,43 @@ describe('modeling/behavior - resize behavior - utilities', function() { })); + it('left lane (E)', inject(function(elementRegistry) { + + // given + var resizeShape = elementRegistry.get('Vertical_Lane_A'), + nestedLaneShape = elementRegistry.get('Nested_Vertical_Lane_B'); + + // when + var sizeConstraints = getParticipantResizeConstraints(resizeShape, 'e'); + + // then + expect(sizeConstraints).to.eql({ + min: { + right: nestedLaneShape.x + VERTICAL_LANE_MIN_WIDTH + }, + max: {} + }); + + })); + + it('nested left lane (E)', inject(function(elementRegistry) { + + // given + var resizeShape = elementRegistry.get('Nested_Vertical_Lane_A'); + + // when + var sizeConstraints = getParticipantResizeConstraints(resizeShape, 'e'); + + // then + expect(sizeConstraints).to.eql({ + min: { + right: resizeShape.x + VERTICAL_LANE_MIN_WIDTH + }, + max: {} + }); + + })); + it('resize participant (W)', inject(function(elementRegistry) {