use of com.reactnativenavigation.react.CommandListenerAdapter 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.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalStackTest method dismissAllModal_resolvesPromiseSuccessfullyWhenCalledBeforeRootIsSet.
@Test
public void dismissAllModal_resolvesPromiseSuccessfullyWhenCalledBeforeRootIsSet() {
CommandListenerAdapter spy = spy(new CommandListenerAdapter());
uut.dismissAllModals(null, Options.EMPTY, spy);
verify(spy).onSuccess("");
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalStackTest method handleBack_dismissModal.
@Test
public void handleBack_dismissModal() {
disableDismissModalAnimation(modal1);
uut.showModal(modal1, root, new CommandListenerAdapter());
idleMainLooper();
assertThat(uut.handleBack(new CommandListenerAdapter(), root)).isTrue();
verify(modal1).onViewDisappear();
}
use of com.reactnativenavigation.react.CommandListenerAdapter 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.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalStackTest method dismissAllModals_optionsAreMergedOnTopModal.
@Test
public void dismissAllModals_optionsAreMergedOnTopModal() {
uut.showModal(modal1, root, new CommandListenerAdapter());
uut.showModal(modal2, root, new CommandListenerAdapter());
uut.showModal(modal3, root, new CommandListenerAdapter());
Options mergeOptions = new Options();
uut.dismissAllModals(root, mergeOptions, new CommandListenerAdapter());
verify(modal3).mergeOptions(mergeOptions);
verify(modal1, times(0)).mergeOptions(mergeOptions);
verify(modal2, times(0)).mergeOptions(mergeOptions);
}
Aggregations