@Test public void testGetPreviousElementWhenElementIsNotFound() { final HTMLElement current = mock(HTMLElement.class); when(current.getAttribute(DATA_Y_POSITION)).thenReturn("1"); when(dragArea.querySelector(".kie-dnd-draggable[data-y-position=\"0\"]")).thenReturn(null); final Optional<HTMLElement> actualPrevious = view.getPreviousElement(current); assertFalse(actualPrevious.isPresent()); }
@Override public Optional<HTMLElement> getPreviousElement(final Element reference) { final int positionY = Position.getY(reference); return querySelector(getDragArea()).getDraggableElement(positionY - 1); }
DNDListComponentView implements DNDListComponent.View { @Override public Optional<HTMLElement> getPreviousElement(final Element reference) { final int positionY = Position.getY(reference); return querySelector(getDragArea()).getDraggableElement(positionY - 1); } }
DNDListComponentView implements DNDListComponent.View { @Override public Optional<HTMLElement> getPreviousElement(final Element reference) { final int positionY = Position.getY(reference); return querySelector(getDragArea()).getDraggableElement(positionY - 1); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { @Override public Optional<HTMLElement> getPreviousElement(final Element reference) { final int positionY = Position.getY(reference); return querySelector(getDragArea()).getDraggableElement(positionY - 1); } @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 { @Override public Optional<HTMLElement> getPreviousElement(final Element reference) { final int positionY = Position.getY(reference); return querySelector(getDragArea()).getDraggableElement(positionY - 1); } @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();  }