use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class NavigatorTest method findController_overlay.
@Test
public void findController_overlay() {
uut.showOverlay(child1, new CommandListenerAdapter());
assertThat(uut.findController(child1.getId())).isEqualTo(child1);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OptionsApplyingTest method appliesTopBackBackgroundColor.
@Test
public void appliesTopBackBackgroundColor() {
uut.options.topBar.background.color = new ThemeColour(new Colour(Color.RED));
stack.push(uut, new CommandListenerAdapter());
idleMainLooper();
assertThat(((ColorDrawable) stack.getTopBar().getBackground()).getColor()).isEqualTo(Color.RED);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OptionsApplyingTest method initialOptionsAppliedOnAppear.
@Test
public void initialOptionsAppliedOnAppear() {
uut.options.topBar.title.text = new Text("the title");
StackController stackController = TestUtils.newStackController(activity).build();
stackController.ensureViewIsCreated();
stackController.push(uut, new CommandListenerAdapter());
assertThat(stackController.getTopBar().getTitle()).isEmpty();
uut.onViewWillAppear();
assertThat(stackController.getTopBar().getTitle()).isEqualTo("the title");
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class OptionsApplyingTest method appliesTopBarVisible.
@Test
public void appliesTopBarVisible() {
stack.push(uut, new CommandListenerAdapter());
assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
initialNavigationOptions.topBar.title.text = new Text("the title");
assertThat(stack.getTopBar().getVisibility()).isNotEqualTo(View.GONE);
Options opts = new Options();
opts.topBar.visible = new Bool(false);
opts.topBar.animate = new Bool(false);
uut.mergeOptions(opts);
assertThat(stack.getTopBar().getVisibility()).isEqualTo(View.GONE);
}
use of com.reactnativenavigation.react.CommandListenerAdapter in project react-native-navigation by wix.
the class ModalStackTest method dismissModal_rejectIfModalNotFound.
@SuppressWarnings("Convert2Lambda")
@Test
public void dismissModal_rejectIfModalNotFound() {
CommandListener listener = spy(new CommandListenerAdapter());
Runnable onModalWillDismiss = spy(new Runnable() {
@Override
public void run() {
}
});
uut.dismissModal(MODAL_ID_1, root, listener);
verify(onModalWillDismiss, times(0)).run();
verify(listener, times(1)).onError(anyString());
verifyNoMoreInteractions(listener);
}
Aggregations