use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method pop_FromCorrectStackByFindingChildId.
@Test
public void pop_FromCorrectStackByFindingChildId() {
StackController stack1 = newStack(child1);
StackController stack2 = newStack(child2);
BottomTabsController bottomTabsController = newTabs(Arrays.asList(stack1, stack2));
uut.setRoot(bottomTabsController, new CommandListenerAdapter(), reactInstanceManager);
stack2.push(child3, new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
stack2.push(child4, new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
uut.pop("child4", Options.EMPTY, new CommandListenerAdapter());
assertThat(stack2.getChildControllers()).containsOnly(child2, child3);
}
});
}
});
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method push_OnCorrectStackByFindingChildId.
@Test
public void push_OnCorrectStackByFindingChildId() {
StackController stack1 = newStack();
stack1.ensureViewIsCreated();
StackController stack2 = newStack();
stack2.ensureViewIsCreated();
stack1.push(child1, new CommandListenerAdapter());
stack2.push(child2, new CommandListenerAdapter());
BottomTabsController bottomTabsController = newTabs(Arrays.asList(stack1, stack2));
uut.setRoot(bottomTabsController, new CommandListenerAdapter(), reactInstanceManager);
SimpleViewController newChild = new SimpleViewController(activity, childRegistry, "new child", tabOptions);
uut.push(child2.getId(), newChild, new CommandListenerAdapter());
assertThat(stack1.getChildControllers()).doesNotContain(newChild);
assertThat(stack2.getChildControllers()).contains(newChild);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method push_InvalidPushWithoutAStack_DoesNothing.
@Test
public void push_InvalidPushWithoutAStack_DoesNothing() {
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.push(child1.getId(), child2, new CommandListenerAdapter());
assertIsChild(uut.getView(), child1.getView());
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method setRoot_ReplacesExistingChildControllerViews.
@Test
public void setRoot_ReplacesExistingChildControllerViews() {
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.setRoot(child2, new CommandListenerAdapter(), reactInstanceManager);
assertIsChild(uut.getRootLayout(), child2.getView());
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalPresenterTest method showModal_animatesByDefault.
@Test
public void showModal_animatesByDefault() {
uut.showModal(modal1, root, new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
verify(animator).show(eq(modal1), eq(root), any(), any());
assertThat(animator.isRunning()).isFalse();
}
});
assertThat(animator.isRunning()).isTrue();
}
Aggregations