@Test public void testUpdateDraggingElementX() { final MouseEvent event = mock(MouseEvent.class); final HTMLElement draggingElement = mock(HTMLElement.class); final ClientRect rect = mock(ClientRect.class); event.x = 100; rect.left = 25; draggingElement.style = mock(CSSStyleDeclaration.class); dragArea.offsetWidth = 300; when(presenter.getIndentationSize()).thenReturn(50); when(dragArea.getBoundingClientRect()).thenReturn(rect); doReturn(draggingElement).when(view).getDragging(); view.updateDraggingElementX(event); verify(draggingElement.style).setProperty("width", "calc(100% - 65px)"); }
void updateDraggingElementX(final Event event) { setCSSWidth(getDragging(), getNewDraggingXPosition(event)); }
DNDListComponentView implements DNDListComponent.View { void updateDraggingElementX(final Event event) { setCSSWidth(getDragging(), getNewDraggingXPosition(event)); } }
DNDListComponentView implements DNDListComponent.View { void updateDraggingElementX(final Event event) { setCSSWidth(getDragging(), getNewDraggingXPosition(event)); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { void updateDraggingElementX(final Event event) { setCSSWidth(getDragging(), getNewDraggingXPosition(event)); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); @Override void init(final DNDListComponent presenter); @Override HTMLElement registerItem(final HTMLElement htmlElement); @Override void refreshItemsPosition(); @Override void refreshItemsHTML(); @Override void consolidateHierarchicalLevel(final boolean isElementsDraggedByUser); @Override void consolidateYPosition(); @Override void clear(); @Override Optional<HTMLElement> getPreviousElement(final Element reference); @Override void refreshDragAreaSize(); @Override HTMLDivElement getDragArea(); }
DNDListComponentView implements DNDListComponent.View { void updateDraggingElementX(final Event event) { setCSSWidth(getDragging(), getNewDraggingXPosition(event)); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); @Override void init(final DNDListComponent presenter); @Override HTMLElement registerItem(final HTMLElement htmlElement); @Override void refreshItemsPosition(); @Override void refreshItemsHTML(); @Override void consolidateHierarchicalLevel(final boolean isElementsDraggedByUser); @Override void consolidateYPosition(); @Override void clear(); @Override Optional<HTMLElement> getPreviousElement(final Element reference); @Override void refreshDragAreaSize(); @Override HTMLDivElement getDragArea();  }