WorkbenchMenuStandardNavBarView extends WorkbenchMenuNavBarView { void positionMenuItem(final AbstractListItem menuItem, final MenuPosition position) { if (MenuPosition.RIGHT.equals(position)) { menuItem.setPull(Pull.RIGHT); } }  @Override void addMenuItem(final String id,
                            final String label,
                            final String parentId,
                            final Command command,
                            final MenuPosition position); @Override void addCustomMenuItem(final Widget menu,
                                  final MenuPosition position); @Override void addGroupMenuItem(final String id,
                                 final String label,
                                 final MenuPosition position); @Override void addContextMenuItem(
            final String menuItemId,
            final String id,
            final String label,
            final String parentId,
            final Command command,
            final MenuPosition position); @Override void addContextGroupMenuItem(final String menuItemId,
                                        final String id,
                                        final String label,
                                        final MenuPosition position); @Override void clearContextMenu(); @Override void selectMenuItem(final String id);  }
@Test public void testPositionAbstractListItemOnLeft() { final AbstractListItem menuItem = mock(AbstractListItem.class); final MenuPosition position = MenuPosition.LEFT; workbenchMenuStandardNavBarView.positionMenuItem(menuItem, position); verify(menuItem, never()).setPull(Pull.RIGHT); }
@Test public void testPositionAbstractListItemOnRight() { final AbstractListItem menuItem = mock(AbstractListItem.class); final MenuPosition position = MenuPosition.RIGHT; workbenchMenuStandardNavBarView.positionMenuItem(menuItem, position); verify(menuItem).setPull(Pull.RIGHT); }
@Test public void testPositionWidgetOnLeft() { final Widget menuItem = spy(Widget.class); final MenuPosition position = MenuPosition.LEFT; workbenchMenuStandardNavBarView.positionMenuItem(menuItem, position); verify(menuItem.getElement().getStyle(), never()).setFloat(Style.Float.RIGHT); }
@Test public void testPositionWidgetOnRight() { final Widget menuItem = spy(Widget.class); final MenuPosition position = MenuPosition.RIGHT; when(menuItem.getElement()).thenReturn(spy(Element.class)); when(menuItem.getElement().getStyle()).thenReturn(spy(Style.class)); workbenchMenuStandardNavBarView.positionMenuItem(menuItem, position); verify(menuItem.getElement().getStyle()).setFloat(Style.Float.RIGHT); }