use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OverlayManagerTest method dismiss_rejectIfOverlayNotFound.
@Test
public void dismiss_rejectIfOverlayNotFound() {
CommandListener listener = spy(new CommandListenerAdapter());
uut.dismiss(overlayContainer, overlay1.getId(), listener);
verify(listener, times(1)).onError(any());
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OverlayManagerTest method show.
@Test
public void show() {
CommandListenerAdapter listener = spy(new CommandListenerAdapter());
uut.show(overlayContainer, overlay1, listener);
idleMainLooper();
verify(listener).onSuccess(OVERLAY_ID_1);
verify(overlay1).onViewDidAppear();
assertThat(overlay1.getView().getParent()).isEqualTo(overlayContainer);
assertMatchParent(overlay1.getView());
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ViewControllerTest method holdsAReferenceToStackControllerOrNull.
@SuppressWarnings("ConstantConditions")
@Test
public void holdsAReferenceToStackControllerOrNull() {
uut.setParentController(null);
assertThat(uut.getParentController()).isNull();
StackController nav = TestUtils.newStackController(activity).build();
nav.ensureViewIsCreated();
nav.push(uut, new CommandListenerAdapter());
assertThat(uut.getParentController()).isEqualTo(nav);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class SideMenuControllerTest method handleBack_closesRightMenu.
@Test
public void handleBack_closesRightMenu() {
uut.setRightController(right);
assertThat(uut.handleBack(new CommandListenerAdapter())).isFalse();
verify(center, times(1)).handleBack(any());
openRightMenu();
assertThat(uut.handleBack(new CommandListenerAdapter())).isTrue();
verify(center, times(1)).handleBack(any());
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class FloatingActionButtonTest method showOnPop.
@Test
public void showOnPop() {
disablePushAnimation(childFab, childNoFab);
stackController.push(childFab, new CommandListenerAdapter());
stackController.push(childNoFab, new CommandListenerAdapter());
childNoFab.onViewWillAppear();
assertThat(hasFab()).isFalse();
stackController.pop(Options.EMPTY, new CommandListenerAdapter());
childFab.onViewWillAppear();
assertThat(hasFab()).isTrue();
}
Aggregations