use of org.uberfire.client.views.pfly.selectpicker.JQuery.CallbackFunction in project kie-wb-common by kiegroup.
the class DataTypeConstraintModalViewTest method testSetupOnHideHandler.
@Test
public void testSetupOnHideHandler() {
final HTMLElement body = mock(HTMLElement.class);
final Node modalBody = mock(Node.class);
final Node modalContent = mock(Node.class);
final Node modalDialog = mock(Node.class);
final Node modalComponent = mock(Node.class);
final Command command = mock(Command.class);
final JQuery jQuery = mock(JQuery.class);
final ArgumentCaptor<CallbackFunction> captor = ArgumentCaptor.forClass(CallbackFunction.class);
body.parentNode = modalBody;
modalBody.parentNode = modalContent;
modalContent.parentNode = modalDialog;
modalDialog.parentNode = modalComponent;
doReturn(body).when(view).getBody();
when(view.constraintModalJQuery()).thenReturn(jQuery);
view.setupOnHideHandler(command);
verify(jQuery).on(eq("hidden.bs.modal"), captor.capture());
captor.getValue().call(mock(JQueryEvent.class));
verify(command).execute();
}
Aggregations