Search in sources :

Example 96 with Options

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

the class ChildControllerTest method mergeOptions.

@Test
public void mergeOptions() {
    newActivity().setContentView(uut.getView());
    Options options = new Options();
    uut.mergeOptions(options);
    verify(presenter).mergeOptions(uut, options);
}
Also used : Options(com.reactnativenavigation.options.Options) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 97 with Options

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

the class ChildControllerTest method mergeOptions_mergeWithParentViewController.

@Test
public void mergeOptions_mergeWithParentViewController() {
    Options options = new Options();
    uut.mergeOptions(options);
    verify(uut.getParentController()).mergeChildOptions(options, uut);
}
Also used : Options(com.reactnativenavigation.options.Options) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 98 with Options

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

the class ChildControllerTest method beforeEach.

@Override
public void beforeEach() {
    childRegistry = spy(new ChildControllersRegistry());
    presenter = Mockito.mock(Presenter.class);
    uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options()) {

        @Override
        public Options resolveCurrentOptions() {
            return resolvedOptions;
        }
    };
    ParentController<?> parent = Mockito.mock(ParentController.class);
    Mockito.when(parent.resolveChildOptions(uut)).thenReturn(Options.EMPTY);
    uut.setParentController(parent);
}
Also used : Options(com.reactnativenavigation.options.Options) Presenter(com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController)

Example 99 with Options

use of com.reactnativenavigation.options.Options 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);
}
Also used : Options(com.reactnativenavigation.options.Options) Bool(com.reactnativenavigation.options.params.Bool) Text(com.reactnativenavigation.options.params.Text) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 100 with Options

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

the class ModalStackTest method setDefaultOptions.

@Test
public void setDefaultOptions() {
    Options defaultOptions = new Options();
    uut.setDefaultOptions(defaultOptions);
    verify(presenter).setDefaultOptions(defaultOptions);
}
Also used : TransitionAnimationOptions(com.reactnativenavigation.options.TransitionAnimationOptions) Options(com.reactnativenavigation.options.Options) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Aggregations

Options (com.reactnativenavigation.options.Options)110 BaseTest (com.reactnativenavigation.BaseTest)57 Test (org.junit.Test)57 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)32 SideMenuOptions (com.reactnativenavigation.options.SideMenuOptions)19 CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)18 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)16 Bool (com.reactnativenavigation.options.params.Bool)15 Text (com.reactnativenavigation.options.params.Text)15 OrientationOptions (com.reactnativenavigation.options.OrientationOptions)10 AnimationOptions (com.reactnativenavigation.options.AnimationOptions)9 ButtonOptions (com.reactnativenavigation.options.ButtonOptions)9 FrameLayout (android.widget.FrameLayout)8 SimpleComponentViewController (com.reactnativenavigation.mocks.SimpleComponentViewController)8 Presenter (com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter)8 ComponentOptions (com.reactnativenavigation.options.ComponentOptions)6 TopBarOptions (com.reactnativenavigation.options.TopBarOptions)6 TopTabOptions (com.reactnativenavigation.options.TopTabOptions)6 TopTabsOptions (com.reactnativenavigation.options.TopTabsOptions)6 Activity (android.app.Activity)5