use of com.reactnativenavigation.options.ModalOptions in project react-native-navigation by wix.
the class NavigatorTest method shouldCallModalOnViewDisappearWhenModalDisplayedOverContextUnderneath.
@Test
public void shouldCallModalOnViewDisappearWhenModalDisplayedOverContextUnderneath() {
SimpleViewController child1 = spy(this.child1);
ViewController<?> child2 = spy(this.child2);
final Options overContextOptions = tabOptions.copy();
overContextOptions.modal = new ModalOptions();
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal", overContextOptions));
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showModal(overContextModal, new CommandListenerAdapter());
uut.showModal(child2, new CommandListenerAdapter());
uut.onHostPause();
verify(child2, times(1)).onViewDisappear();
verify(overContextModal, never()).onViewDisappear();
}
use of com.reactnativenavigation.options.ModalOptions in project react-native-navigation by wix.
the class NavigatorTest method shouldCallRootOnViewDisappearWhenModalDisplayedOverContext.
@Test
public void shouldCallRootOnViewDisappearWhenModalDisplayedOverContext() {
SimpleViewController child1 = spy(this.child1);
final Options overContextOptions = tabOptions.copy();
overContextOptions.modal = new ModalOptions();
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal", overContextOptions));
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showModal(overContextModal, new CommandListenerAdapter());
uut.onHostPause();
verify(child1, times(1)).onViewDisappear();
verify(overContextModal, times(1)).onViewDisappear();
}
use of com.reactnativenavigation.options.ModalOptions in project react-native-navigation by wix.
the class NavigatorTest method shouldCallRootOnViewDidAppearWhenModalDisplayedOverContext.
@Test
public void shouldCallRootOnViewDidAppearWhenModalDisplayedOverContext() {
SimpleViewController child1 = spy(this.child1);
final Options overContextOptions = tabOptions.copy();
overContextOptions.modal = new ModalOptions();
overContextOptions.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
ViewController<?> overContextModal = spy(new SimpleViewController(activity, childRegistry, "overContextModal", overContextOptions));
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showModal(overContextModal, new CommandListenerAdapter());
uut.onHostResume();
verify(child1, times(2)).onViewDidAppear();
verify(overContextModal, times(1)).onViewDidAppear();
}
Aggregations