Search in sources :

Example 6 with BottomTabsController

use of com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController in project react-native-navigation by wix.

the class NavigatorTest method popTo_FromCorrectStackUpToChild.

@Test
public void popTo_FromCorrectStackUpToChild() {
    disablePushAnimation(child5);
    StackController stack1 = newStack(child1);
    StackController stack2 = newStack(child2, child3, child4);
    BottomTabsController bottomTabsController = newTabs(Arrays.asList(stack1, stack2));
    uut.setRoot(bottomTabsController, new CommandListenerAdapter(), reactInstanceManager);
    idleMainLooper();
    CommandListenerAdapter listener = spy(new CommandListenerAdapter() {

        @Override
        public void onSuccess(String childId) {
            uut.popTo(child2.getId(), Options.EMPTY, new CommandListenerAdapter());
            assertThat(stack2.getChildControllers()).containsOnly(child2);
        }
    });
    stack2.push(child5, listener);
    verify(listener).onSuccess(child5.getId());
}
Also used : BottomTabsController(com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController) StackController(com.reactnativenavigation.viewcontrollers.stack.StackController) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

BottomTabsController (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController)6 BaseTest (com.reactnativenavigation.BaseTest)5 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)5 StackController (com.reactnativenavigation.viewcontrollers.stack.StackController)5 Test (org.junit.Test)5 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)1 TypefaceLoader (com.reactnativenavigation.options.parsers.TypefaceLoader)1 ImageLoader (com.reactnativenavigation.utils.ImageLoader)1 BottomTabPresenter (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabPresenter)1 BottomTabsAnimator (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsAnimator)1 BottomTabsPresenter (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsPresenter)1 BottomTabsAttacher (com.reactnativenavigation.viewcontrollers.bottomtabs.attacher.BottomTabsAttacher)1 ComponentPresenter (com.reactnativenavigation.viewcontrollers.component.ComponentPresenter)1 ComponentViewController (com.reactnativenavigation.viewcontrollers.component.ComponentViewController)1 ExternalComponentPresenter (com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentPresenter)1 ExternalComponentViewController (com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentViewController)1 SideMenuPresenter (com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter)1 StackPresenter (com.reactnativenavigation.viewcontrollers.stack.StackPresenter)1 Presenter (com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter)1 ViewController (com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController)1