use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ParentControllerTest method findControllerById_ChildById.
@Test
public void findControllerById_ChildById() {
SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options());
SimpleViewController child2 = new SimpleViewController(activity, childRegistry, "child2", new Options());
children.add(child1);
children.add(child2);
assertThat(uut.findController("uut")).isEqualTo(uut);
assertThat(uut.findController("child1")).isEqualTo(child1);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class BackButtonHelperTest method addToChild_addsIfStackContainsMoreThenOneChild.
@Test
public void addToChild_addsIfStackContainsMoreThenOneChild() {
disablePushAnimation(child1, child2);
stack.push(child1, new CommandListenerAdapter());
stack.push(child2, new CommandListenerAdapter());
ArgumentCaptor<Options> optionWithBackButton = ArgumentCaptor.forClass(Options.class);
verify(child2, times(1)).mergeOptions(optionWithBackButton.capture());
assertThat(optionWithBackButton.getValue().topBar.buttons.back.visible.get()).isTrue();
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class TopTabsViewControllerTest method createOptions.
@NonNull
private ArrayList<Options> createOptions() {
ArrayList<Options> result = new ArrayList<>();
for (int i = 0; i < SIZE; i++) {
final Options options = new Options();
options.topTabOptions.title = new Text("Tab " + i);
options.topBar.title.text = new Text(createTabTopBarTitle(i));
result.add(options);
}
return result;
}
use of com.reactnativenavigation.options.Options 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();
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ParentControllerTest method optionsAreClearedWhenChildIsAppeared.
@Test
public void optionsAreClearedWhenChildIsAppeared() {
StackController stackController = spy(TestUtils.newStackController(activity).build());
stackController.ensureViewIsCreated();
SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options());
stackController.push(child1, new CommandListenerAdapter());
child1.onViewWillAppear();
verify(stackController, times(1)).clearOptions();
}
Aggregations