use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListViewTest method testShowArrowIconIfDataTypeHasChildrenWhenDataTypeHasChildren.
@Test
public void testShowArrowIconIfDataTypeHasChildrenWhenDataTypeHasChildren() {
final DataType dataType = mock(DataType.class);
final NodeList<Element> elementNodeList = new NodeList<>();
final Element dataTypeRow = mock(Element.class);
final Element dataTypeRowArrow = mock(Element.class);
final DOMTokenList arrowClassList = mock(DOMTokenList.class);
final String uuid = "uuid";
dataTypeRowArrow.classList = arrowClassList;
elementNodeList.length = 1;
when(dataType.getUUID()).thenReturn(uuid);
when(listItems.querySelectorAll("[" + PARENT_UUID_ATTR + "=\"uuid\"]")).thenReturn(elementNodeList);
when(listItems.querySelector("[" + UUID_ATTR + "=\"uuid\"]")).thenReturn(dataTypeRow);
when(dataTypeRow.querySelector(ARROW_BUTTON_SELECTOR)).thenReturn(dataTypeRowArrow);
view.showArrowIconIfDataTypeHasChildren(dataType);
verify(arrowClassList).remove(HIDDEN_CSS_CLASS);
}
use of elemental2.dom.DOMTokenList in project drools-wb by kiegroup.
the class GuidedDecisionTableAccordionItemView method setOpen.
@Override
public void setOpen(final boolean isOpen) {
final DOMTokenList classList = content.classList;
final String opened = "in";
if (isOpen) {
classList.add(opened);
} else {
classList.remove(opened);
}
}
Aggregations