use of org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler in project kie-wb-common by kiegroup.
the class DecisionServiceSVGShapeViewTest method testDragConstraintHandler.
@Test
@SuppressWarnings("unchecked")
public void testDragConstraintHandler() {
final MoveDividerControlHandle moveDividerControlHandle = getMoveDividerControlHandle();
final IPrimitive control = moveDividerControlHandle.getControl();
when(dragContext.getNode()).thenReturn(control);
final MoveDividerDragHandler dragConstraints = (MoveDividerDragHandler) getMoveDividerControlHandle().getControl().getDragConstraints();
dragConstraints.startDrag(dragContext);
final DragBounds dragBounds = control.getDragBounds();
assertThat(dragBounds.getX1()).isEqualTo(0.0);
assertThat(dragBounds.getY1()).isEqualTo(GeneralRectangleDimensionsSet.DEFAULT_HEIGHT);
assertThat(dragBounds.getX2()).isEqualTo(WIDTH);
assertThat(dragBounds.getY2()).isEqualTo(HEIGHT - GeneralRectangleDimensionsSet.DEFAULT_HEIGHT);
}
Aggregations