use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class PresenterTest method mergeStatusBarVisible_callsShowHide.
@Test
public void mergeStatusBarVisible_callsShowHide() {
mockSystemUiUtils(1, 1, (mockedStatic) -> {
ViewGroup spy = spy(new FrameLayout(activity));
Mockito.when(controller.getView()).thenReturn(spy);
Mockito.when(controller.resolveCurrentOptions()).thenReturn(Options.EMPTY);
Options options = new Options();
options.statusBar.visible = new Bool(false);
uut.mergeOptions(controller, options);
mockedStatic.verify(() -> SystemUiUtils.hideStatusBar(any(), eq(spy)), times(1));
options.statusBar.visible = new Bool(true);
uut.mergeOptions(controller, options);
mockedStatic.verify(() -> SystemUiUtils.showStatusBar(any(), eq(spy)), times(1));
});
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class SideMenuPresenterTest method mergeVisibility_visibilityOptionsAreConsumed.
@Test
public void mergeVisibility_visibilityOptionsAreConsumed() {
SideMenuRootOptions options = new SideMenuRootOptions();
options.left.visible = new Bool(true);
options.right.visible = new Bool(true);
uut.mergeOptions(options);
assertFalse(options.right.visible.hasValue());
assertFalse(options.left.visible.hasValue());
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class BackButtonHelperTest method clear.
@Test
public void clear() {
child1.options.topBar.buttons.back.visible = new Bool(true);
uut.clear(child1);
assertThat(child1.options.topBar.buttons.back.visible.get()).isFalse();
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class TopTabsViewControllerTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
childRegistry = new ChildControllersRegistry();
List<Options> tabOptions = createOptions();
tabControllers = createTabsControllers(activity, tabOptions);
topTabsLayout = spy(new TopTabsViewPager(activity, tabControllers, new TopTabsAdapter(tabControllers)));
TopTabsLayoutCreator layoutCreator = Mockito.mock(TopTabsLayoutCreator.class);
Mockito.when(layoutCreator.create()).thenReturn(topTabsLayout);
Presenter presenter = new Presenter(activity, new Options());
options.topBar.buttons.back.visible = new Bool(false);
uut = spy(new TopTabsController(activity, childRegistry, "componentId", tabControllers, layoutCreator, options, presenter));
tabControllers.forEach(viewController -> viewController.setParentController(uut));
stack = spy(TestUtils.newStackController(activity).build());
stack.ensureViewIsCreated();
}
use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.
the class NavigatorTest method destroy_destroyedRoot.
@Test
public void destroy_destroyedRoot() {
disablePushAnimation(child1);
StackController spy = spy(parentController);
spy.options.animations.setRoot.getEnter().enabled = new Bool(false);
uut.setRoot(spy, new CommandListenerAdapter(), reactInstanceManager);
spy.push(child1, new CommandListenerAdapter());
activityController.destroy();
verify(spy, times(1)).destroy();
}
Aggregations