use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method shouldCallModalPeekDidAppearWhenHostResumes.
@Test
public void shouldCallModalPeekDidAppearWhenHostResumes() {
SimpleViewController child1 = spy(this.child1);
ViewController<?> child2 = spy(this.child2);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showModal(child2, new CommandListenerAdapter());
uut.onHostResume();
verify(modalStack).onHostResume();
verify(child2).onViewDidAppear();
verify(child1, times(1)).onViewDidAppear();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method push_promise.
@Test
public void push_promise() {
final StackController stackController = newStack();
stackController.push(child1, new CommandListenerAdapter());
uut.setRoot(stackController, new CommandListenerAdapter(), reactInstanceManager);
assertIsChild(uut.getView(), stackController.getView());
assertIsChild(stackController.getView(), child1.getView());
uut.push(child1.getId(), child2, new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
assertIsChild(uut.getView(), stackController.getView());
assertIsChild(stackController.getView(), child2.getView());
}
});
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method dismissModal_reattachedToRoot.
@Test
public void dismissModal_reattachedToRoot() {
disableModalAnimations(child1);
uut.setRoot(parentController, new CommandListenerAdapter(), reactInstanceManager);
assertThat(ViewUtils.isChildOf(uut.getRootLayout(), parentController.getView())).isTrue();
uut.showModal(child1, new CommandListenerAdapter());
uut.dismissModal(child1.getId(), new CommandListenerAdapter());
assertThat(ViewUtils.isChildOf(uut.getRootLayout(), parentController.getView())).isTrue();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method shouldCallModalPeekDidDisappearWhenHostPauses.
@Test
public void shouldCallModalPeekDidDisappearWhenHostPauses() {
SimpleViewController child1 = spy(this.child1);
ViewController<?> child2 = spy(this.child2);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showModal(child2, new CommandListenerAdapter());
uut.onHostPause();
verify(modalStack).onHostPause();
verify(child2).onViewDisappear();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method pushIntoModal.
@Test
public void pushIntoModal() {
uut.setRoot(parentController, new CommandListenerAdapter(), reactInstanceManager);
StackController stackController = newStack();
stackController.push(child1, new CommandListenerAdapter());
uut.showModal(stackController, new CommandListenerAdapter());
uut.push(stackController.getId(), child2, new CommandListenerAdapter());
assertIsChild(stackController.getView(), child2.getView());
}
Aggregations