Search in sources :

Example 1 with DataTypeConstraint

use of org.kie.workbench.common.dmn.client.editors.types.listview.constraint.DataTypeConstraint in project kie-wb-common by kiegroup.

the class DataTypeListItemViewTest method testSetupConstraintComponent.

@Test
public void testSetupConstraintComponent() {
    final DataTypeConstraint constraintComponent = mock(DataTypeConstraint.class);
    final HTMLElement htmlElement = mock(HTMLElement.class);
    final Element element = mock(Element.class);
    constraint.firstChild = element;
    doReturn(constraint).when(view).getConstraintContainer();
    when(constraintComponent.getElement()).thenReturn(htmlElement);
    when(constraint.removeChild(element)).then(a -> {
        constraint.firstChild = null;
        return element;
    });
    view.setupConstraintComponent(constraintComponent);
    verify(constraint).removeChild(element);
    verify(constraint).appendChild(htmlElement);
}
Also used : HTMLElement(elemental2.dom.HTMLElement) Element(elemental2.dom.Element) HTMLInputElement(elemental2.dom.HTMLInputElement) HTMLElement(elemental2.dom.HTMLElement) HTMLDivElement(elemental2.dom.HTMLDivElement) HTMLButtonElement(elemental2.dom.HTMLButtonElement) DataTypeConstraint(org.kie.workbench.common.dmn.client.editors.types.listview.constraint.DataTypeConstraint) Test(org.junit.Test)

Aggregations

Element (elemental2.dom.Element)1 HTMLButtonElement (elemental2.dom.HTMLButtonElement)1 HTMLDivElement (elemental2.dom.HTMLDivElement)1 HTMLElement (elemental2.dom.HTMLElement)1 HTMLInputElement (elemental2.dom.HTMLInputElement)1 Test (org.junit.Test)1 DataTypeConstraint (org.kie.workbench.common.dmn.client.editors.types.listview.constraint.DataTypeConstraint)1