Search in sources :

Example 81 with Options

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

the class SideMenuControllerTest method applyOptions.

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

Example 82 with Options

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

the class SideMenuControllerTest method mergeChildOptions.

@Test
public void mergeChildOptions() {
    Options options = new Options();
    uut.mergeChildOptions(options, child);
    verify(presenter).mergeOptions(options.sideMenuRootOptions);
    verify(parent).mergeChildOptions(options, child);
}
Also used : SideMenuOptions(com.reactnativenavigation.options.SideMenuOptions) Options(com.reactnativenavigation.options.Options) BaseTest(com.reactnativenavigation.BaseTest) Test(org.junit.Test)

Example 83 with Options

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

the class FloatingActionButtonTest method getOptionsWithFabActions.

@NonNull
private Options getOptionsWithFabActions() {
    Options options = new Options();
    FabOptions fabOptions = new FabOptions();
    fabOptions.id = new Text("FAB");
    for (int i = 0; i < CHILD_FAB_COUNT; i++) {
        FabOptions childOptions = new FabOptions();
        childOptions.id = new Text("fab" + i);
        fabOptions.actionsArray.add(childOptions);
    }
    options.fabOptions = fabOptions;
    return options;
}
Also used : FabOptions(com.reactnativenavigation.options.FabOptions) Options(com.reactnativenavigation.options.Options) FabOptions(com.reactnativenavigation.options.FabOptions) Text(com.reactnativenavigation.options.params.Text) NonNull(androidx.annotation.NonNull)

Example 84 with Options

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

the class ChildControllersRegistryTest method beforeEach.

@Override
public void beforeEach() {
    Activity activity = newActivity();
    uut = new ChildControllersRegistry();
    child1 = spy(new SimpleViewController(activity, uut, "child1", new Options()));
    child2 = spy(new SimpleViewController(activity, uut, "child2", new Options()));
}
Also used : Options(com.reactnativenavigation.options.Options) Activity(android.app.Activity) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController)

Example 85 with Options

use of com.reactnativenavigation.options.Options 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();
}
Also used : Options(com.reactnativenavigation.options.Options) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter) 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