use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListItemViewTest method testToggleArrowWhenFalse.
@Test
public void testToggleArrowWhenFalse() {
final DOMTokenList classList = mock(DOMTokenList.class);
doReturn(arrow).when(view).getArrow();
arrow.classList = classList;
view.toggleArrow(false);
verify(classList).add("hidden");
}
use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListItemViewTest method testIsCollapsedWhenItIsRightArrow.
@Test
public void testIsCollapsedWhenItIsRightArrow() {
final HTMLElement arrow = mock(HTMLElement.class);
final DOMTokenList classList = mock(DOMTokenList.class);
arrow.classList = classList;
when(classList.contains(eq(RIGHT_ARROW_CSS_CLASS))).thenReturn(true);
doReturn(arrow).when(view).getArrow();
assertTrue(view.isCollapsed());
}
use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListItemViewTest method testIsCollapsedWhenArrowIsNotARightArrow.
@Test
public void testIsCollapsedWhenArrowIsNotARightArrow() {
final DOMTokenList classList = mock(DOMTokenList.class);
final HTMLElement arrow = mock(HTMLElement.class);
arrow.classList = classList;
when(classList.contains(RIGHT_ARROW_CSS_CLASS)).thenReturn(false);
assertFalse(view.isCollapsed(arrow));
}
use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListItemViewTest method testSetupArrowWhenDataTypeDoesNotHaveSubTypes.
@Test
public void testSetupArrowWhenDataTypeDoesNotHaveSubTypes() {
final DataType dataType = mock(DataType.class);
final DOMTokenList classList = mock(DOMTokenList.class);
doReturn(arrow).when(view).getArrow();
when(dataType.hasSubDataTypes()).thenReturn(false);
arrow.classList = classList;
view.setupArrow(dataType);
verify(view).toggleArrow(false);
}
use of elemental2.dom.DOMTokenList in project kie-wb-common by kiegroup.
the class DataTypeListItemViewTest method testIsCollapsedWhenArrowIsARightArrow.
@Test
public void testIsCollapsedWhenArrowIsARightArrow() {
final DOMTokenList classList = mock(DOMTokenList.class);
final HTMLElement arrow = mock(HTMLElement.class);
arrow.classList = classList;
when(classList.contains(RIGHT_ARROW_CSS_CLASS)).thenReturn(true);
assertTrue(view.isCollapsed(arrow));
}
Aggregations