use of com.reactnativenavigation.views.toptabs.TopTabsViewPager 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.views.toptabs.TopTabsViewPager in project react-native-navigation by wix.
the class TopTabsViewControllerTest method componentViewDestroyedOnDestroy.
@Test
public void componentViewDestroyedOnDestroy() {
uut.ensureViewIsCreated();
TopTabsViewPager topTabs = uut.getView();
for (int i = 0; i < SIZE; i++) {
verify(tab(topTabs, i), times(0)).destroy();
}
uut.destroy();
for (ViewController<?> tabController : tabControllers) {
verify(tabController, times(1)).destroy();
}
}
Aggregations