@Test public void testGetMaxPositionY() { final HTMLElement element0 = mock(HTMLElement.class); final HTMLElement element1 = mock(HTMLElement.class); final HTMLElement element2 = mock(HTMLElement.class); when(element0.getAttribute(DATA_Y_POSITION)).thenReturn("2"); when(element1.getAttribute(DATA_Y_POSITION)).thenReturn("4"); when(element2.getAttribute(DATA_Y_POSITION)).thenReturn("8"); mockDragAreaWithChildren(element0, element1, element2); final int expectedMaxPosition = 8; final int actualMaxPosition = view.getMaxPositionY(); assertEquals(expectedMaxPosition, actualMaxPosition); }
int getMaxPositionY() { return querySelector(getDragArea()) .getDraggableElements() .stream() .mapToInt(Position::getY) .max() .orElse(HIDDEN_Y_POSITION); }
DNDListComponentView implements DNDListComponent.View { int getMaxPositionY() { return querySelector(getDragArea()) .getDraggableElements() .stream() .mapToInt(Position::getY) .max() .orElse(HIDDEN_Y_POSITION); } }
DNDListComponentView implements DNDListComponent.View { int getMaxPositionY() { return querySelector(getDragArea()) .getDraggableElements() .stream() .mapToInt(Position::getY) .max() .orElse(HIDDEN_Y_POSITION); } @Inject  DNDListComponentView(final HTMLDivElement dragArea); }
DNDListComponentView implements DNDListComponent.View { int getMaxPositionY() { return querySelector(getDragArea()) .getDraggableElements() .stream() .mapToInt(Position::getY) .max() .orElse(HIDDEN_Y_POSITION); } @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 { int getMaxPositionY() { return querySelector(getDragArea()) .getDraggableElements() .stream() .mapToInt(Position::getY) .max() .orElse(HIDDEN_Y_POSITION); } @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();  }