@Test public void testMakeTreeItemElement() { final DecisionNavigatorItem item = makeItem("uuid"); final DecisionNavigatorTreeView.TreeItem newTreeItem = mock(DecisionNavigatorTreeView.TreeItem.class); final DecisionNavigatorTreeView.TreeItem treeItem = mock(DecisionNavigatorTreeView.TreeItem.class); final Element childrenTree = mock(Element.class); final HTMLElement htmlElement = mock(HTMLElement.class); final elemental2.dom.HTMLElement expectedHtmlElement = mock(elemental2.dom.HTMLElement.class); doReturn(childrenTree).when(treeView).makeTree(item.getChildren()); when(managedInstance.get()).thenReturn(newTreeItem); when(newTreeItem.setup(item, childrenTree)).thenReturn(treeItem); when(treeItem.getElement()).thenReturn(htmlElement); when(util.asHTMLElement(htmlElement)).thenReturn(expectedHtmlElement); final Element actualHtmlElement = treeView.makeTreeItemElement(item); assertEquals(expectedHtmlElement, actualHtmlElement); }
Element makeTreeItemElement(final DecisionNavigatorItem item) { final Element childrenTree = makeTree(item.getChildren()); final TreeItem treeItem = managedInstance.get().setup(item, childrenTree); return util.asHTMLElement(treeItem.getElement()); }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { Element makeTreeItemElement(final DecisionNavigatorItem item) { final Element childrenTree = makeTree(item.getChildren()); final TreeItem treeItem = managedInstance.get().setup(item, childrenTree); return util.asHTMLElement(treeItem.getElement()); } }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { Element makeTreeItemElement(final DecisionNavigatorItem item) { final Element childrenTree = makeTree(item.getChildren()); final TreeItem treeItem = managedInstance.get().setup(item, childrenTree); return util.asHTMLElement(treeItem.getElement()); } @Inject  DecisionNavigatorTreeView(final HTMLDivElement view,
                                     final HTMLDivElement items,
                                     final ManagedInstance<TreeItem> managedInstance,
                                     final Elemental2DomUtil util); }
DecisionNavigatorTreeView implements DecisionNavigatorTreePresenter.View { Element makeTreeItemElement(final DecisionNavigatorItem item) { final Element childrenTree = makeTree(item.getChildren()); final TreeItem treeItem = managedInstance.get().setup(item, childrenTree); return util.asHTMLElement(treeItem.getElement()); } @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 { Element makeTreeItemElement(final DecisionNavigatorItem item) { final Element childrenTree = makeTree(item.getChildren()); final TreeItem treeItem = managedInstance.get().setup(item, childrenTree); return util.asHTMLElement(treeItem.getElement()); } @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();  }