use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.
the class DefaultImportListItemWidgetViewTest method init.
@Test
public void init() {
tested.init();
verify(customClassName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf('1')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, times(0)).preventDefault();
doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, times(1)).preventDefault();
}
use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.
the class VariableListItemWidgetViewImplTest method testTagTypeHandlerSpace.
@Test
public void testTagTypeHandlerSpace() {
view.init();
verify(customTagName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, times(1)).preventDefault();
}
use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.
the class VariableListItemWidgetViewImplTest method testTagTypeHandlerAlphabetical.
@Test
public void testTagTypeHandlerAlphabetical() {
view.init();
verify(customTagName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf('a')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, never()).preventDefault();
}
use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.
the class VariableListItemWidgetViewImplTest method testDataTypeHandlerAlphabetical.
@Test
public void testDataTypeHandlerAlphabetical() {
view.init();
verify(customDataType, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf('a')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, never()).preventDefault();
}
use of com.google.gwt.event.dom.client.KeyDownHandler in project kie-wb-common by kiegroup.
the class VariableListItemWidgetViewImplTest method testDataTypeHandlerSpace.
@Test
public void testDataTypeHandlerSpace() {
view.init();
verify(customDataType, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture());
KeyDownHandler handler = keyDownHandlerCaptor.getValue();
doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode();
handler.onKeyDown(keyDownEvent);
verify(keyDownEvent, times(1)).preventDefault();
}
Aggregations