use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalStackTest method showModalWithoutAnimation.
private void showModalWithoutAnimation(ViewController<?> modal) {
disableShowModalAnimation(modal);
uut.showModal(modal, root, new CommandListenerAdapter());
}
use of com.reactnativenavigation.react.CommandListenerAdapter 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.CommandListenerAdapter 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);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OverlayManagerTest method dismiss_onViewReturnedToFront.
@Test
public void dismiss_onViewReturnedToFront() {
uut.show(overlayContainer, overlay1, new CommandListenerAdapter());
uut.show(overlayContainer, overlay2, new CommandListenerAdapter());
idleMainLooper();
verify(overlay1, never()).onViewBroughtToFront();
uut.dismiss(overlayContainer, OVERLAY_ID_2, new CommandListenerAdapter());
idleMainLooper();
verify(overlay1).onViewBroughtToFront();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OverlayManagerTest method dismiss_overlayContainerIsHiddenIfAllOverlaysAreDismissed.
@Test
public void dismiss_overlayContainerIsHiddenIfAllOverlaysAreDismissed() {
uut.show(overlayContainer, overlay1, new CommandListenerAdapter());
uut.show(overlayContainer, overlay2, new CommandListenerAdapter());
uut.dismiss(overlayContainer, OVERLAY_ID_2, new CommandListenerAdapter());
assertThat(overlayContainer.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(overlayContainer.getParent()).isEqualTo(contentLayout);
uut.dismiss(overlayContainer, OVERLAY_ID_1, new CommandListenerAdapter());
assertThat(overlayContainer.getVisibility()).isEqualTo(View.GONE);
}
Aggregations