use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.
the class NavigatorTest method push_rejectIfNotContainedInStack.
@Test
public void push_rejectIfNotContainedInStack() {
CommandListener listener = Mockito.mock(CommandListener.class);
uut.push("someId", child1, listener);
verify(listener).onError(any());
}
use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.
the class ModalStackTest method showModal_canShowModalBeforeRootIsSet.
@Test
public void showModal_canShowModalBeforeRootIsSet() {
CommandListener listener = spy(new CommandListenerAdapter());
uut.showModal(modal1, null, listener);
verify(listener).onSuccess(modal1.getId());
}
use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.
the class ModalStackTest method showModal.
@Test
public void showModal() {
CommandListener listener = spy(new CommandListenerAdapter());
uut.showModal(modal1, root, listener);
idleMainLooper();
verify(listener).onSuccess(modal1.getId());
verify(modal1).onViewDidAppear();
assertThat(uut.size()).isOne();
verify(presenter).showModal(eq(modal1), eq(root), any());
assertThat(findModal(MODAL_ID_1)).isNotNull();
}
use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.
the class ModalStackTest method modalRefIsSaved.
@Test
public void modalRefIsSaved() {
disableShowModalAnimation(modal1);
CommandListener listener = spy(new CommandListenerAdapter());
uut.showModal(modal1, root, listener);
verify(listener, times(1)).onSuccess(modal1.getId());
assertThat(findModal(MODAL_ID_1)).isNotNull();
}
use of com.reactnativenavigation.react.CommandListener in project react-native-navigation by wix.
the class ModalStackTest method dismissModal_listenerAndEmitterAreInvokedWithRootViewControllerId.
@Test
public void dismissModal_listenerAndEmitterAreInvokedWithRootViewControllerId() {
uut.showModal(stack, root, new CommandListenerAdapter());
CommandListener listener = spy(new CommandListenerAdapter());
uut.dismissModal(modal4.getId(), root, listener);
verify(listener).onSuccess(stack.getId());
verify(emitter).emitModalDismissed(stack.getId(), modal4.getCurrentComponentName(), 1);
}
Aggregations