use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class NavigatorTest method shouldCallOnViewDisappearWhenHostPauses.
@Test
public void shouldCallOnViewDisappearWhenHostPauses() {
SimpleViewController child1 = spy(this.child1);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.onHostPause();
verify(child1).onViewDidAppear();
}
use of com.reactnativenavigation.mocks.SimpleViewController 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.mocks.SimpleViewController 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.mocks.SimpleViewController in project react-native-navigation by wix.
the class NavigatorTest method shouldCallOverlaysChildrenOnViewDidAppearOnHostResume.
@Test
public void shouldCallOverlaysChildrenOnViewDidAppearOnHostResume() {
SimpleViewController child1 = spy(this.child1);
ViewController<?> child2 = spy(this.child2);
ViewController<?> child3 = spy(this.child3);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.showOverlay(child2, new CommandListenerAdapter());
uut.showOverlay(child3, new CommandListenerAdapter());
verify(child1, times(1)).onViewDidAppear();
uut.onHostResume();
verify(overlayManager).onHostResume();
verify(child1, times(2)).onViewDidAppear();
verify(child2).onViewDidAppear();
verify(child3).onViewDidAppear();
}
use of com.reactnativenavigation.mocks.SimpleViewController 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);
}
Aggregations