Search in sources :

Example 31 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class ButtonPresenterTest method applyColor_shouldChangeDisabledColor.

@Test
public void applyColor_shouldChangeDisabledColor() {
    button.enabled = new Bool(false);
    MenuItem menuItem = addMenuButton();
    uut.applyOptions(titleBar, menuItem, buttonController::getView);
    ThemeColour disabledColor = new ThemeColour(new Colour(Color.BLUE), new Colour(Color.BLUE));
    uut.applyDisabledColor(titleBar, menuItem, disabledColor);
    assertThat(findButtonView().getCurrentTextColor()).isEqualTo(Color.BLUE);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) MenuItem(android.view.MenuItem) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) Colour(com.reactnativenavigation.options.params.Colour) ThemeColour(com.reactnativenavigation.options.params.ThemeColour) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 32 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class TopBarButtonControllerTest method disableIconTint.

@Test
public void disableIconTint() {
    setIconButton(false);
    button.disableIconTint = new Bool(true);
    uut.addToMenu(getTitleBar(), 0);
    verify(optionsPresenter, times(0)).tint(any(), anyInt());
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 33 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class ModalPresenterTest method showModal_waitForRender.

@Test
public void showModal_waitForRender() {
    modal1.options.animations.showModal.setWaitForRender(new Bool(true));
    uut.showModal(modal1, root, new CommandListenerAdapter());
    verify(modal1).addOnAppearedListener(any());
    verifyNoInteractions(animator);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 34 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class NavigatorTest method setRoot_withWaitForRender.

@Test
public void setRoot_withWaitForRender() {
    ViewController<?> initialRoot = spy(child2);
    uut.setRoot(initialRoot, new CommandListenerAdapter(), reactInstanceManager);
    child3.options.animations.setRoot.getEnter().waitForRender = new Bool(true);
    ViewController<?> secondRoot = spy(child3);
    CommandListenerAdapter listener = spy(new CommandListenerAdapter());
    uut.setRoot(secondRoot, listener, reactInstanceManager);
    verify(secondRoot).addOnAppearedListener(any());
    // make isRendered return true and trigger onViewAppeared
    secondRoot.getView().addView(new View(activity));
    idleMainLooper();
    assertThat(initialRoot.isDestroyed()).isTrue();
    assertThat(secondRoot.isViewShown()).isEqualTo(true);
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) View(android.view.View) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 35 with Bool

use of com.reactnativenavigation.options.params.Bool in project react-native-navigation by wix.

the class ViewControllerTest method isRendered_falseIfViewIsNotCreated.

@Test
public void isRendered_falseIfViewIsNotCreated() {
    uut.setWaitForRender(new Bool(true));
    assertThat(uut.isRendered()).isFalse();
}
Also used : Bool(com.reactnativenavigation.options.params.Bool) NullBool(com.reactnativenavigation.options.params.NullBool) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

Bool (com.reactnativenavigation.options.params.Bool)40 BaseTest (com.reactnativenavigation.BaseTest)29 Test (org.junit.Test)29 Options (com.reactnativenavigation.options.Options)14 SideMenuOptions (com.reactnativenavigation.options.SideMenuOptions)10 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)7 Colour (com.reactnativenavigation.options.params.Colour)6 Text (com.reactnativenavigation.options.params.Text)6 ThemeColour (com.reactnativenavigation.options.params.ThemeColour)6 MenuItem (android.view.MenuItem)5 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)4 Drawable (android.graphics.drawable.Drawable)4 NullBool (com.reactnativenavigation.options.params.NullBool)4 IconBackgroundDrawable (com.reactnativenavigation.views.stack.topbar.titlebar.IconBackgroundDrawable)4 ViewGroup (android.view.ViewGroup)3 StackController (com.reactnativenavigation.viewcontrollers.stack.StackController)3 SimpleComponentViewController (com.reactnativenavigation.mocks.SimpleComponentViewController)2 IconBackgroundOptions (com.reactnativenavigation.options.IconBackgroundOptions)2 View (android.view.View)1 FrameLayout (android.widget.FrameLayout)1