use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ModalPresenterTest method showModal.
@Test
public void showModal() {
Options defaultOptions = new Options();
uut.setDefaultOptions(defaultOptions);
disableShowModalAnimation(modal1);
uut.showModal(modal1, root, new CommandListenerAdapter());
verify(modal1).setWaitForRender(any());
assertThat(modal1.getView().getFitsSystemWindows()).isTrue();
}
use of com.reactnativenavigation.options.Options 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.Options in project react-native-navigation by wix.
the class NavigatorTest method mergeOptions_CallsApplyNavigationOptions.
@Test
public void mergeOptions_CallsApplyNavigationOptions() {
ComponentViewController componentVc = new SimpleComponentViewController(activity, childRegistry, "theId", new Options());
componentVc.setParentController(parentController);
assertThat(componentVc.options.topBar.title.text.get("")).isEmpty();
uut.setRoot(componentVc, new CommandListenerAdapter(), reactInstanceManager);
Options options = new Options();
options.topBar.title.text = new Text("new title");
uut.mergeOptions("theId", options);
assertThat(componentVc.options.topBar.title.text.get()).isEqualTo("new title");
}
use of com.reactnativenavigation.options.Options 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.Options in project react-native-navigation by wix.
the class NavigatorTest method setDefaultOptions.
@Test
public void setDefaultOptions() {
uut.setDefaultOptions(new Options());
SimpleViewController spy = spy(child1);
uut.setRoot(spy, new CommandListenerAdapter(), reactInstanceManager);
Options defaultOptions = new Options();
uut.setDefaultOptions(defaultOptions);
verify(spy).setDefaultOptions(defaultOptions);
verify(modalStack).setDefaultOptions(defaultOptions);
}
Aggregations