test(snapping): verify participant snapping on create

This commit is contained in:
Nico Rehwaldt 2016-06-22 17:04:42 +02:00
parent c4735ffe9b
commit 9c236b0d9e
1 changed files with 23 additions and 1 deletions

View File

@ -213,7 +213,7 @@ describe('features/snapping - BpmnSnapping', function() {
})); }));
it('should not snap', inject(function(canvas, create, dragging, elementFactory) { it('should not snap to diagram contents', inject(function(canvas, create, dragging, elementFactory) {
// given // given
var participantShape = elementFactory.createParticipantShape(false), var participantShape = elementFactory.createParticipantShape(false),
@ -234,6 +234,28 @@ describe('features/snapping - BpmnSnapping', function() {
}); });
})); }));
it('should snap to participant border', inject(function(canvas, create, dragging, elementFactory) {
// given
var participantShape = elementFactory.createParticipantShape(false),
rootElement = canvas.getRootElement(),
rootGfx = canvas.getGraphics(rootElement);
// when
create.start(canvasEvent({ x: 50, y: 50 }), participantShape);
dragging.hover({ element: rootElement, gfx: rootGfx });
dragging.move(canvasEvent({ x: 390, y: 400 }));
dragging.end(canvasEvent({ x: 390, y: 400 }));
// then
expect(participantShape).to.have.bounds({
x: 84, y: 275, width: 600, height: 250
});
}));
}); });
}); });