use of com.reactnativenavigation.react.CommandListenerAdapter 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();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class FloatingActionButtonTest method showOnPush.
@Test
public void showOnPush() {
stackController.push(childFab, new CommandListenerAdapter());
childFab.onViewWillAppear();
assertThat(hasFab()).isTrue();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalPresenterTest method showModal_overCurrentContext_previousModalIsNotRemovedFromHierarchy.
@Test
public void showModal_overCurrentContext_previousModalIsNotRemovedFromHierarchy() {
Options options = new Options();
options.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
uut.setDefaultOptions(options);
disableShowModalAnimation(modal1);
uut.showModal(modal1, root, new CommandListenerAdapter());
verify(root, times(0)).detachView();
verify(root, times(0)).onViewDisappear();
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalPresenterTest method showModal_noAnimation.
@Test
public void showModal_noAnimation() {
disableShowModalAnimation(modal1);
CommandListener listener = spy(new CommandListenerAdapter() {
@Override
public void onSuccess(String childId) {
Shadows.shadowOf(Looper.getMainLooper()).idle();
assertThat(modal1.getView().getParent()).isEqualTo(modalsLayout);
verify(modal1).onViewWillAppear();
}
});
uut.showModal(modal1, root, listener);
verify(animator, never()).show(eq(modal1), eq(root), eq(modal1.options.animations.showModal), any());
verify(listener).onSuccess(MODAL_ID_1);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalPresenterTest method showModal.
@Test
public void showModal() {
Options defaultOptions = new Options();
uut.setDefaultOptions(defaultOptions);
disableShowModalAnimation(modal1);
uut.showModal(modal1, root, new CommandListenerAdapter());
verify(modal1).setWaitForRender(any());
assertThat(modal1.getView().getFitsSystemWindows()).isTrue();
}
Aggregations