use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class SideMenuControllerTest method openRightMenu.
private void openRightMenu() {
Options options = new Options();
options.sideMenuRootOptions.right.visible = new Bool(true);
options.sideMenuRootOptions.right.animate = new Bool(false);
uut.mergeOptions(options);
uut.onDrawerSlide(right.getView(), 1);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ViewControllerTest method onDestroy_destroysViewEvenIfHidden.
@Test
public void onDestroy_destroysViewEvenIfHidden() {
final SimpleViewController.SimpleView[] spy = new SimpleViewController.SimpleView[1];
ViewController uut = new SimpleViewController(activity, childRegistry, "uut", new Options()) {
@Override
public SimpleView createView() {
SimpleView view = spy(super.createView());
spy[0] = view;
return view;
}
};
assertThat(uut.isViewShown()).isFalse();
uut.destroy();
verify(spy[0], times(1)).destroy();
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ViewControllerTest method onChildViewAdded_delegatesToYellowBoxDelegate.
@Test
public void onChildViewAdded_delegatesToYellowBoxDelegate() {
View child = new View(activity);
ViewGroup view = new FrameLayout(activity);
ViewController vc = new ViewController(activity, "", yellowBoxDelegate, new Options(), new ViewControllerOverlay(activity)) {
@Override
public ViewGroup createView() {
return view;
}
@Override
public void sendOnNavigationButtonPressed(String buttonId) {
}
@Override
public String getCurrentComponentName() {
return null;
}
};
vc.onChildViewAdded(view, child);
verify(yellowBoxDelegate).onChildViewAdded(view, child);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ComponentViewControllerTest method getTopInset_drawBehind_defaultOptions.
@Test
public void getTopInset_drawBehind_defaultOptions() {
Options defaultOptions = new Options();
defaultOptions.statusBar.drawBehind = new Bool(true);
uut.setDefaultOptions(defaultOptions);
uut.options.topBar.drawBehind = new Bool(true);
Java6Assertions.assertThat(uut.getTopInset()).isEqualTo(0);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ComponentViewControllerTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
SystemUiUtils.saveStatusBarHeight(63);
view = Mockito.spy(new TestComponentLayout(activity, new TestReactView(activity)));
parent = TestUtils.newStackController(activity).build();
Presenter presenter = new Presenter(activity, new Options());
this.presenter = Mockito.spy(new ComponentPresenter(Options.EMPTY));
uut = Mockito.spy(new ComponentViewController(activity, new ChildControllersRegistry(), "componentId1", "componentName", (activity1, componentId, componentName) -> view, new Options(), presenter, this.presenter) {
@Override
public Options resolveCurrentOptions(Options defaultOptions) {
// Hacky way to return the same instance of resolvedOptions without copying it.
return resolvedOptions.withDefaultOptions(uut.options).withDefaultOptions(defaultOptions);
}
});
uut.setParentController(parent);
parent.ensureViewIsCreated();
}
Aggregations