Search in sources :

Example 6 with HTMLInputElement

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

the class NotificationsEditorWidgetTest method testOneNotification.

@Test
public void testOneNotification() {
    values.setValues(new ArrayList<>());
    values.addValue(new NotificationValue());
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertFalse(values.isEmpty());
    notificationsEditorWidget.setValue(values);
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertEquals(1, notificationsEditorWidget.getValue().getValues().size());
    HTMLInputElement input = getFieldValue(NotificationsEditorWidget.class, notificationsEditorWidget, "notificationTextBox");
    Assert.assertEquals("1 notifications", input.value);
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Example 7 with HTMLInputElement

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

the class NotificationsEditorWidgetTest method testZeroNotifications.

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

Example 8 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 9 with HTMLInputElement

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

the class DataTypeShortcutsTest method testIsSearchBarTargetWhenItReturnsTrue.

@Test
public void testIsSearchBarTargetWhenItReturnsTrue() {
    final HTMLInputElement element = mock(HTMLInputElement.class);
    event.target = element;
    when(element.getAttribute("data-field")).thenReturn("search-bar");
    assertTrue(shortcuts.isTargetElementAnInput(event));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) Test(org.junit.Test)

Example 10 with HTMLInputElement

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

the class DataTypeListItemViewTest method testGetNameInput.

@Test
public void testGetNameInput() {
    final HTMLInputElement element = mock(HTMLInputElement.class);
    doReturn(element).when(view).querySelector(NAME_DATA_FIELD);
    assertEquals(element, view.getNameInput());
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) Test(org.junit.Test)

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