use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testOnEditClick.
@Test
public void testOnEditClick() {
final HTMLElement element = mock(HTMLElement.class);
final ClickEvent event = mock(ClickEvent.class);
final org.jboss.errai.common.client.dom.DOMTokenList tokenList = mock(org.jboss.errai.common.client.dom.DOMTokenList.class);
doReturn(element).when(treeItem).getElement();
when(element.getClassList()).thenReturn(tokenList);
treeItem.onEditClick(event);
verify(tokenList).add("editing");
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemToggle.
@Test
public void testTreeItemToggle() {
final HTMLElement element = mock(HTMLElement.class);
final org.jboss.errai.common.client.dom.DOMTokenList classList = mock(org.jboss.errai.common.client.dom.DOMTokenList.class);
doReturn(element).when(treeItem).getElement();
doReturn(classList).when(element).getClassList();
treeItem.toggle();
verify(classList).toggle("closed");
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateCSSClassWhenItemDoesNotHaveChildrenAndIsReadOnly.
@Test
public void testTreeItemUpdateCSSClassWhenItemDoesNotHaveChildrenAndIsReadOnly() {
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
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.isEditable()).thenReturn(false);
when(readOnlyProvider.isReadOnlyDiagram()).thenReturn(true);
treeItem.updateCSSClass();
verify(classList).add(cssClass);
verify(classList, never()).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 DecisionNavigatorTreeViewTest method testTreeItemUpdateDataUUID.
@Test
public void testTreeItemUpdateDataUUID() {
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
final HTMLElement element = mock(HTMLElement.class);
final String uuid = "uuid";
doReturn(item).when(treeItem).getItem();
doReturn(element).when(treeItem).getElement();
when(item.getUUID()).thenReturn(uuid);
treeItem.updateDataUUID();
verify(element).setAttribute("data-uuid", uuid);
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class DecisionNavigatorTreeViewTest method testTreeItemUpdateTitle.
@Test
public void testTreeItemUpdateTitle() {
final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class);
final HTMLElement element = mock(HTMLElement.class);
final String label = "label";
doReturn(item).when(treeItem).getItem();
doReturn(element).when(treeItem).getElement();
when(item.getLabel()).thenReturn(label);
treeItem.updateTitle();
verify(element).setAttribute("title", label);
}
Aggregations