use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class NavigatorTest method shouldNotCallModalOnHostResumeWhenHostResumesAndNoModals.
@Test
public void shouldNotCallModalOnHostResumeWhenHostResumesAndNoModals() {
SimpleViewController child1 = spy(this.child1);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.onHostResume();
verify(modalStack, never()).onHostResume();
}
use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class NavigatorTest method onConfigurationChange_shouldCallOnConfigurationChangedForModals.
@Test
public void onConfigurationChange_shouldCallOnConfigurationChangedForModals() {
Navigator spyUUT = spy(uut);
SimpleViewController spyChild1 = spy(child1);
ViewController<?> spyChild2 = spy(child2);
ViewController<?> spyChild3 = spy(child3);
spyUUT.setRoot(spyChild1, new CommandListenerAdapter(), reactInstanceManager);
spyUUT.showModal(spyChild2, new CommandListenerAdapter());
spyUUT.showModal(spyChild3, new CommandListenerAdapter());
spyUUT.onConfigurationChanged(mockConfiguration);
verify(spyChild2).onConfigurationChanged(any());
verify(spyChild3).onConfigurationChanged(any());
}
use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class NavigatorTest method shouldCallOnViewDidAppearWhenHostResumes.
@Test
public void shouldCallOnViewDidAppearWhenHostResumes() {
SimpleViewController child1 = spy(this.child1);
uut.setRoot(child1, new CommandListenerAdapter(), reactInstanceManager);
uut.onHostResume();
verify(child1, times(2)).onViewDidAppear();
}
use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class ParentControllerTest method optionsAreClearedWhenChildIsAppeared.
@Test
public void optionsAreClearedWhenChildIsAppeared() {
StackController stackController = spy(TestUtils.newStackController(activity).build());
stackController.ensureViewIsCreated();
SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options());
stackController.push(child1, new CommandListenerAdapter());
child1.onViewWillAppear();
verify(stackController, times(1)).clearOptions();
}
use of com.reactnativenavigation.mocks.SimpleViewController in project react-native-navigation by wix.
the class FloatingActionButtonTest method hasChildren.
@Test
public void hasChildren() {
childFab = new SimpleViewController(activity, childRegistry, "child1", getOptionsWithFabActions());
stackController.push(childFab, new CommandListenerAdapter());
childFab.onViewWillAppear();
assertThat(hasFab()).isTrue();
assertThat(containsActions()).isTrue();
}
Aggregations