use of com.reactnativenavigation.mocks.SimpleComponentViewController in project react-native-navigation by wix.
the class SideMenuControllerTest method mergeOptions_openRightSideMenu.
@Test
public void mergeOptions_openRightSideMenu() {
uut.setRightController(new SimpleComponentViewController(activity, childRegistry, "right", new Options()));
Options options = new Options();
options.sideMenuRootOptions.right.visible = new Bool(true);
assertThat(uut.getView().isDrawerOpen(Gravity.RIGHT)).isFalse();
uut.mergeOptions(options);
assertThat(uut.getView().isDrawerOpen(Gravity.RIGHT)).isTrue();
}
use of com.reactnativenavigation.mocks.SimpleComponentViewController in project react-native-navigation by wix.
the class SideMenuControllerTest method mergeOptions_openLeftSideMenu.
@Test
public void mergeOptions_openLeftSideMenu() {
uut.setLeftController(new SimpleComponentViewController(activity, childRegistry, "left", new Options()));
Options options = new Options();
options.sideMenuRootOptions.left.visible = new Bool(true);
assertThat(uut.getView().isDrawerOpen(Gravity.LEFT)).isFalse();
uut.mergeOptions(options);
assertThat(uut.getView().isDrawerOpen(Gravity.LEFT)).isTrue();
}
use of com.reactnativenavigation.mocks.SimpleComponentViewController 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");
}
Aggregations