@Test public void testTreeItemUpdateCSSClassWhenItemHasChildren() { final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class); final DecisionNavigatorItem child = mock(DecisionNavigatorItem.class); final TreeSet<DecisionNavigatorItem> children = new TreeSet<DecisionNavigatorItem>() {{ add(child); }}; final org.jboss.errai.common.client.dom.DOMTokenList classList = mock(org.jboss.errai.common.client.dom.DOMTokenList.class); final HTMLElement element = mock(HTMLElement.class); final String cssClass = "css-class"; doReturn(item).when(treeItem).getItem(); doReturn(element).when(treeItem).getElement(); doReturn(cssClass).when(treeItem).getCSSClass(item); when(element.getClassList()).thenReturn(classList); when(item.getChildren()).thenReturn(children); when(item.isEditable()).thenReturn(true); treeItem.updateCSSClass(); verify(classList).add(cssClass); verify(classList).add("parent-node"); verify(classList).add("editable"); }
@Override public HTMLElement getElement() { return view; }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { @Override public HTMLElement getElement() { return view; } }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { @Override public HTMLElement getElement() { return view; } @Inject  DecisionNavigatorTreeView(final HTMLDivElement view,
                                     final HTMLDivElement items,
                                     final ManagedInstance<TreeItem> managedInstance,
                                     final Elemental2DomUtil util); }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { @Override public HTMLElement getElement() { return view; } @Inject  DecisionNavigatorTreeView(final HTMLDivElement view,
                                     final HTMLDivElement items,
                                     final ManagedInstance<TreeItem> managedInstance,
                                     final Elemental2DomUtil util); @Override void init(final DecisionNavigatorTreePresenter presenter); @Override HTMLElement getElement(); @Override void clean(); @Override void setup(final List<DecisionNavigatorItem> items); @Override void select(final String uuid); @Override void deselect(); }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { @Override public HTMLElement getElement() { return view; } @Inject  DecisionNavigatorTreeView(final HTMLDivElement view,
                                     final HTMLDivElement items,
                                     final ManagedInstance<TreeItem> managedInstance,
                                     final Elemental2DomUtil util); @Override void init(final DecisionNavigatorTreePresenter presenter); @Override HTMLElement getElement(); @Override void clean(); @Override void setup(final List<DecisionNavigatorItem> items); @Override void select(final String uuid); @Override void deselect();  }