Search in sources :

Example 21 with DOMTokenList

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");
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) Test(org.junit.Test)

Example 22 with DOMTokenList

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());
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) HTMLElement(elemental2.dom.HTMLElement) Test(org.junit.Test)

Example 23 with DOMTokenList

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));
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) HTMLElement(elemental2.dom.HTMLElement) Test(org.junit.Test)

Example 24 with DOMTokenList

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);
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) DataType(org.kie.workbench.common.dmn.client.editors.types.common.DataType) Test(org.junit.Test)

Example 25 with DOMTokenList

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));
}
Also used : DOMTokenList(elemental2.dom.DOMTokenList) HTMLElement(elemental2.dom.HTMLElement) Test(org.junit.Test)

Aggregations

DOMTokenList (elemental2.dom.DOMTokenList)37 Test (org.junit.Test)36 Element (elemental2.dom.Element)21 HTMLElement (elemental2.dom.HTMLElement)12 HTMLDivElement (elemental2.dom.HTMLDivElement)9 DataType (org.kie.workbench.common.dmn.client.editors.types.common.DataType)8 HTMLButtonElement (elemental2.dom.HTMLButtonElement)7 HTMLAnchorElement (elemental2.dom.HTMLAnchorElement)5 HTMLInputElement (elemental2.dom.HTMLInputElement)4 HTMLUListElement (elemental2.dom.HTMLUListElement)2 NodeList (elemental2.dom.NodeList)2 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)2 HTMLBodyElement (elemental2.dom.HTMLBodyElement)1 HTMLDocument (elemental2.dom.HTMLDocument)1