@Test public void testHoldDraggingElement() { final HTMLElement expectedDragging = mock(HTMLElement.class); final HTMLElement element0 = mock(HTMLElement.class); final HTMLElement element1 = mock(HTMLElement.class); final HTMLElement element2 = mock(HTMLElement.class); final List<HTMLElement> expectedDependentElements = asList(element0, element1, element2); expectedDragging.classList = mock(DOMTokenList.class); element0.classList = mock(DOMTokenList.class); element1.classList = mock(DOMTokenList.class); element2.classList = mock(DOMTokenList.class); doReturn(expectedDependentElements).when(view).getDependentElements(expectedDragging); view.holdDraggingElement(expectedDragging); final HTMLElement actualDragging = view.getDragging(); final List<HTMLElement> actualDependentElements = view.getDependentElements(); expectedDragging.classList.add(DRAGGING); element0.classList.add(DRAGGING); element1.classList.add(DRAGGING); element2.classList.add(DRAGGING); assertEquals(expectedDragging, actualDragging); assertEquals(expectedDependentElements, actualDependentElements); }
void holdDraggingElement(final HTMLElement element) { setDragging(element); setDependentElements(getDependentElements(element)); asDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asDragging); }
DNDListComponentView implements DNDListComponent.View { void holdDraggingElement(final HTMLElement element) { setDragging(element); setDependentElements(getDependentElements(element)); asDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asDragging); } }
DNDListComponentView implements DNDListComponent.View { void holdDraggingElement(final HTMLElement element) { setDragging(element); setDependentElements(getDependentElements(element)); asDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asDragging); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { void holdDraggingElement(final HTMLElement element) { setDragging(element); setDependentElements(getDependentElements(element)); asDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asDragging); } @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 holdDraggingElement(final HTMLElement element) { setDragging(element); setDependentElements(getDependentElements(element)); asDragging(getDragging()); getDependentElements().forEach(DNDListDOMHelper::asDragging); } @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();  }