use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class NavigatorTest method destroy_shouldNotChangeViewIds.
@Test
public void destroy_shouldNotChangeViewIds() {
disablePushAnimation(child1);
disableShowModalAnimation(child1, child2, child3);
StackController spy = spy(parentController);
SimpleViewController.SimpleView view = child1.getView();
ViewGroup view1 = child2.getView();
view.setId(10);
view1.setId(11);
spy.options.animations.setRoot.getEnter().enabled = new Bool(false);
uut.setRoot(spy, new CommandListenerAdapter(), reactInstanceManager);
spy.push(child1, new CommandListenerAdapter());
uut.showModal(child2, new CommandListenerAdapter());
activityController.destroy();
assertThat(view.getId()).isEqualTo(10);
assertThat(view1.getId()).isEqualTo(11);
verify(spy, times(1)).destroy();
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class NavigatorTest method pushedStackCanBePopped.
@Test
public void pushedStackCanBePopped() {
StackController spy = spy(parentController);
disablePushAnimation(spy, child2);
spy.push(child2, new CommandListenerAdapter());
StackController parent = newStack(spy);
parent.options.animations.setRoot.getEnter().enabled = new Bool(false);
uut.setRoot(parent, new CommandListenerAdapter(), reactInstanceManager);
CommandListenerAdapter listener = new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
assertThat(spy.getChildControllers().size()).isEqualTo(1);
}
};
disablePopAnimation(child2);
uut.pop("child2", Options.EMPTY, listener);
verify(spy, times(1)).pop(Options.EMPTY, listener);
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class SideMenuControllerTest method openLeftMenu.
private void openLeftMenu() {
Options options = new Options();
options.sideMenuRootOptions.left.visible = new Bool(true);
options.sideMenuRootOptions.left.animate = new Bool(false);
uut.mergeOptions(options);
uut.onDrawerSlide(left.getView(), 1);
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class SideMenuControllerTest method mergeChildOptions_lockModeIsUpdatedInInitialOptions.
@Test
public void mergeChildOptions_lockModeIsUpdatedInInitialOptions() {
setLeftRight(left, right);
Options leftDisabled = new Options();
leftDisabled.sideMenuRootOptions.left.enabled = new Bool(false);
left.mergeOptions(leftDisabled);
assertThat(uut.resolveCurrentOptions().sideMenuRootOptions.left.enabled.get()).isFalse();
Options rightVisible = new Options();
rightVisible.sideMenuRootOptions.right.visible = new Bool(true);
right.mergeOptions(rightVisible);
assertThat(uut.resolveCurrentOptions().sideMenuRootOptions.left.enabled.get()).isFalse();
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class SideMenuControllerTest method createSideMenuOptions.
@NotNull
private Options createSideMenuOptions() {
Options options = new Options();
options.sideMenuRootOptions.left.animate = new Bool(false);
options.sideMenuRootOptions.right.animate = new Bool(false);
return options;
}
Aggregations