use of org.kie.workbench.common.dmn.client.editors.types.listview.constraint.common.DataTypeConstraintComponent in project kie-wb-common by kiegroup.
the class DataTypeConstraintModalTest method testSave.
@Test
public void testSave() {
final DataTypeConstraintComponent constrainComponent = mock(DataTypeConstraintComponent.class);
final String value = "value";
doNothing().when(modal).doSave(Mockito.<String>any());
doReturn(constrainComponent).when(modal).getCurrentComponent();
when(constrainComponent.getValue()).thenReturn(value);
modal.save();
verify(modal).doSave(value);
}
use of org.kie.workbench.common.dmn.client.editors.types.listview.constraint.common.DataTypeConstraintComponent in project kie-wb-common by kiegroup.
the class DataTypeConstraintModalViewTest method testLoadComponent.
@Test
public void testLoadComponent() {
final ConstraintType constraintType = ENUMERATION;
final DataTypeConstraintComponent constrainComponent = mock(DataTypeConstraintComponent.class);
final Element element = mock(Element.class);
final Element previous = mock(Element.class);
componentContainer.firstChild = previous;
when(presenter.getCurrentComponent()).thenReturn(constrainComponent);
when(constrainComponent.getElement()).thenReturn(element);
when(componentContainer.removeChild(previous)).then(a -> {
componentContainer.firstChild = null;
return element;
});
view.loadComponent(constraintType);
verify(componentContainer).removeChild(previous);
verify(presenter).setupComponent(constraintType);
verify(componentContainer).appendChild(element);
}
Aggregations