Search in sources :

Example 11 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project kie-wb-common by kiegroup.

the class ReassignmentsEditorWidgetTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    GwtMockito.initMocks(this);
    doCallRealMethod().when(reassignmentsEditorWidget).setValue(any(ReassignmentTypeListValue.class));
    doCallRealMethod().when(reassignmentsEditorWidget).setValue(any(ReassignmentTypeListValue.class), any(boolean.class));
    doCallRealMethod().when(reassignmentsEditorWidget).getValue();
    doCallRealMethod().when(reassignmentsEditorWidget).init();
    doCallRealMethod().when(reassignmentsEditorWidget).addValueChangeHandler(any(ValueChangeHandler.class));
    doCallRealMethod().when(reassignmentsEditorWidget).setReadOnly(any(boolean.class));
    doCallRealMethod().when(reassignmentsEditorWidget).showReassignmentsDialog();
    doCallRealMethod().when(reassignmentWidget).setReadOnly(any(boolean.class));
    doCallRealMethod().when(reassignmentWidget).show();
    doCallRealMethod().when(reassignmentWidgetViewImpl).setReadOnly(any(boolean.class));
    doCallRealMethod().when(values).setValues(any(List.class));
    doCallRealMethod().when(values).getValues();
    doCallRealMethod().when(values).addValue(any(ReassignmentValue.class));
    doCallRealMethod().when(values).isEmpty();
    setFieldValue(reassignmentsEditorWidget, "reassignmentsTextBox", new HTMLInputElement());
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) ReassignmentTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) ArrayList(java.util.ArrayList) List(java.util.List) Before(org.junit.Before)

Example 12 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project kie-wb-common by kiegroup.

the class ReassignmentsEditorWidgetTest method testZeroReassignments.

@Test
public void testZeroReassignments() {
    values.setValues(new ArrayList<>());
    reassignmentsEditorWidget.setValue(values);
    Assert.assertEquals(0, values.getValues().size());
    Assert.assertTrue(values.isEmpty());
    Assert.assertEquals(0, reassignmentsEditorWidget.getValue().getValues().size());
    HTMLInputElement input = getFieldValue(ReassignmentsEditorWidget.class, reassignmentsEditorWidget, "reassignmentsTextBox");
    Assert.assertEquals("0 reassignments", input.value);
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Example 13 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project kie-wb-common by kiegroup.

the class NotificationsEditorWidgetTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    GwtMockito.initMocks(this);
    doCallRealMethod().when(notificationsEditorWidget).setValue(any(NotificationTypeListValue.class));
    doCallRealMethod().when(notificationsEditorWidget).setValue(any(NotificationTypeListValue.class), any(boolean.class));
    doCallRealMethod().when(notificationsEditorWidget).getValue();
    doCallRealMethod().when(notificationsEditorWidget).init();
    doCallRealMethod().when(notificationsEditorWidget).addValueChangeHandler(any(ValueChangeHandler.class));
    doCallRealMethod().when(notificationsEditorWidget).setReadOnly(any(boolean.class));
    doCallRealMethod().when(notificationsEditorWidget).showNotificationsDialog();
    doCallRealMethod().when(notificationWidget).setReadOnly(any(boolean.class));
    doCallRealMethod().when(notificationWidget).show();
    doCallRealMethod().when(notificationWidgetViewImpl).setReadOnly(any(boolean.class));
    doCallRealMethod().when(values).setValues(any(List.class));
    doCallRealMethod().when(values).getValues();
    doCallRealMethod().when(values).addValue(any(NotificationValue.class));
    doCallRealMethod().when(values).isEmpty();
    setFieldValue(notificationsEditorWidget, "notificationTextBox", new HTMLInputElement());
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ArrayList(java.util.ArrayList) List(java.util.List) NotificationTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Before(org.junit.Before)

Aggregations

HTMLInputElement (elemental2.dom.HTMLInputElement)12 Test (org.junit.Test)6 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)4 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Before (org.junit.Before)2 NotificationValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)2 ReassignmentValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue)2 HTMLElement (elemental2.dom.HTMLElement)1 NotificationTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue)1 ReassignmentTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue)1