Search in sources :

Example 16 with CommandListener

use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.

the class ModalStackTest method dismissModal_rejectIfModalNotFound.

@SuppressWarnings("Convert2Lambda")
@Test
public void dismissModal_rejectIfModalNotFound() {
    CommandListener listener = spy(new CommandListenerAdapter());
    Runnable onModalWillDismiss = spy(new Runnable() {

        @Override
        public void run() {
        }
    });
    uut.dismissModal(MODAL_ID_1, root, listener);
    verify(onModalWillDismiss, times(0)).run();
    verify(listener, times(1)).onError(anyString());
    verifyNoMoreInteractions(listener);
}
Also used : CommandListener(com.reactnativenavigation.react.CommandListener) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

CommandListener (com.reactnativenavigation.react.CommandListener)16 BaseTest (com.reactnativenavigation.BaseTest)15 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)15 Test (org.junit.Test)15 Options (com.reactnativenavigation.options.Options)3 TransitionAnimationOptions (com.reactnativenavigation.options.TransitionAnimationOptions)2 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)1 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)1 StackAnimationOptions (com.reactnativenavigation.options.StackAnimationOptions)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1