use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class FlashMessagesViewTest method testOnCancelWarningButtonClick.
@Test
public void testOnCancelWarningButtonClick() {
final ClickEvent event = mock(ClickEvent.class);
doNothing().when(view).disableWarningHighlight();
warningContainer.classList = mock(DOMTokenList.class);
view.onCancelWarningButtonClick(event);
verify(presenter).executeErrorWarningCallback();
verify(warningContainer.classList).remove(OPENED_CONTAINER_CSS_CLASS);
verify(view).disableWarningHighlight();
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class FlashMessagesViewTest method testSetupDisableErrorHighlightCallbacks.
@Test
public void testSetupDisableErrorHighlightCallbacks() {
final Event event = mock(Event.class);
final Element errorElement = mock(Element.class);
doNothing().when(view).disableErrorHighlight(any());
view.setupDisableErrorHighlightCallbacks(errorElement);
errorElement.onkeypress.onInvoke(event);
errorElement.onblur.onInvoke(event);
verify(view, times(2)).disableErrorHighlight(errorElement);
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class ValueAndDataTypePopoverViewImpl method manageButtonKeyDownEventListener.
void manageButtonKeyDownEventListener(final Object event) {
if (event instanceof KeyboardEvent) {
final KeyboardEvent keyEvent = (KeyboardEvent) event;
if (isEscapeKeyPressed(keyEvent)) {
reset();
hide(false);
onClosedByKeyboard();
}
}
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DataTypeSelectView method onTypeTextClick.
@EventHandler("type-text")
public void onTypeTextClick(final ClickEvent event) {
final String type = presenter.getDataType().getType();
final HTMLElement element = getElement();
if (!isBuiltInType(type)) {
structureTypesTooltip.show(element, type);
}
skipClickListeners(event);
}
use of elemental2.dom.Event in project kie-wb-common by kiegroup.
the class DataTypeSelectViewTest method testOnTypeTextClickWhenItsNotBuiltInType.
@Test
public void testOnTypeTextClickWhenItsNotBuiltInType() {
final ClickEvent event = mock(ClickEvent.class);
final String type = "tPerson";
final DataType dataType = makeDataType(type);
final HTMLElement element = mock(HTMLElement.class);
when(presenter.getDataType()).thenReturn(dataType);
doReturn(element).when(view).getElement();
view.onTypeTextClick(event);
verify(structureTypesTooltip).show(element, type);
verify(event).preventDefault();
verify(event).stopPropagation();
}
Aggregations