use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateCSSClassWhenItemHasChildrenAndIsReadOnly.
@Test
public void testTreeItemUpdateCSSClassWhenItemHasChildrenAndIsReadOnly() {
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);
when(readOnlyProvider.isReadOnlyDiagram()).thenReturn(true);
treeItem.updateCSSClass();
verify(classList).add(cssClass);
verify(classList).add("parent-node");
verify(classList, never()).add("editable");
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DefinitionPaletteCategoryWidgetTest method testGetElement.
@Test
public void testGetElement() {
HTMLElement element = mock(HTMLElement.class);
when(view.getElement()).thenReturn(element);
assertEquals(element, widget.getElement());
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class LibraryScreenTest method showProjectsTest.
@Test
public void showProjectsTest() {
doReturn(true).when(view).isProjectsTabActive();
doReturn(true).when(libraryService).hasProjects(any());
final HTMLElement populatedLibraryScreenElement = mock(HTMLElement.class);
when(populatedLibraryScreen.getView().getElement()).thenReturn(populatedLibraryScreenElement);
doReturn(3).when(populatedLibraryScreen).getProjectsCount();
libraryScreen.showProjects();
verify(view).updateContent(populatedLibraryScreenElement);
verify(view).setProjectsCount(3);
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class FormGeneratorDriver method createContainer.
@Override
public HTMLElement createContainer() {
HTMLElement container = document.createElement(CONTAINER_TAG);
container.setClassName(ColumnSize.MD_12.getCssName());
return container;
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class FormGeneratorDriver method createColumn.
@Override
public HTMLElement createColumn(LayoutColumn layoutColumn) {
HTMLElement column = document.createElement(CONTAINER_TAG);
String colSize = ColumnSizeBuilder.buildColumnSize(new Integer(layoutColumn.getSpan()));
column.setClassName(colSize);
return column;
}
Aggregations