@Test public void testReleaseDraggingElement() { final HTMLElement dragging = mock(HTMLElement.class); final HTMLElement element0 = mock(HTMLElement.class); final HTMLElement element1 = mock(HTMLElement.class); final HTMLElement element2 = mock(HTMLElement.class); final List<HTMLElement> dependentElements = asList(element0, element1, element2); dragging.classList = mock(DOMTokenList.class); element0.classList = mock(DOMTokenList.class); element1.classList = mock(DOMTokenList.class); element2.classList = mock(DOMTokenList.class); doReturn(dependentElements).when(view).getDependentElements(dragging); view.holdDraggingElement(dragging); view.releaseDraggingElement(); final HTMLElement actualDragging = view.getDragging(); final List<HTMLElement> actualDependentElements = view.getDependentElements(); dragging.classList.remove(DRAGGING); element0.classList.remove(DRAGGING); element1.classList.remove(DRAGGING); element2.classList.remove(DRAGGING); assertNull(actualDragging); assertEquals(emptyList(), actualDependentElements); }
void releaseDraggingElement() { asNonDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asNonDragging); setDependentElements(emptyList()); setDragging(null); }
DNDListComponentView implements DNDListComponent.View { void releaseDraggingElement() { asNonDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asNonDragging); setDependentElements(emptyList()); setDragging(null); } }
DNDListComponentView implements DNDListComponent.View { void releaseDraggingElement() { asNonDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asNonDragging); setDependentElements(emptyList()); setDragging(null); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { void releaseDraggingElement() { asNonDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asNonDragging); setDependentElements(emptyList()); setDragging(null); } @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 releaseDraggingElement() { asNonDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asNonDragging); setDependentElements(emptyList()); setDragging(null); } @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();  }