Browse Source

Fix unit tests

Guy Carmeli 6 years ago
parent
commit
45c8a35fe4

+ 2
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabPresenterTest.java View File

4
 import android.graphics.Color;
4
 import android.graphics.Color;
5
 
5
 
6
 import com.reactnativenavigation.BaseTest;
6
 import com.reactnativenavigation.BaseTest;
7
+import com.reactnativenavigation.mocks.ImageLoaderMock;
7
 import com.reactnativenavigation.mocks.SimpleViewController;
8
 import com.reactnativenavigation.mocks.SimpleViewController;
8
 import com.reactnativenavigation.parse.Options;
9
 import com.reactnativenavigation.parse.Options;
9
 import com.reactnativenavigation.parse.params.Colour;
10
 import com.reactnativenavigation.parse.params.Colour;
43
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
44
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
44
         child3 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
45
         child3 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
45
         tabs = Arrays.asList(child1, child2, child3);
46
         tabs = Arrays.asList(child1, child2, child3);
46
-        uut = new BottomTabPresenter(activity, tabs, new Options());
47
+        uut = new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new Options());
47
         uut.bindView(bottomTabs);
48
         uut.bindView(bottomTabs);
48
         uut.setDefaultOptions(new Options());
49
         uut.setDefaultOptions(new Options());
49
     }
50
     }

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java View File

231
                 initialOptions,
231
                 initialOptions,
232
                 new Presenter(activity, new Options()),
232
                 new Presenter(activity, new Options()),
233
                 presenter,
233
                 presenter,
234
-                new BottomTabPresenter(activity, tabs, new Options())) {
234
+                new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new Options())) {
235
             @Override
235
             @Override
236
             public Options resolveCurrentOptions() {
236
             public Options resolveCurrentOptions() {
237
                 return resolvedOptions;
237
                 return resolvedOptions;
340
                 initialOptions,
340
                 initialOptions,
341
                 new Presenter(activity, new Options()),
341
                 new Presenter(activity, new Options()),
342
                 presenter,
342
                 presenter,
343
-                new BottomTabPresenter(activity, tabs, new Options())) {
343
+                new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new Options())) {
344
             @Override
344
             @Override
345
             public void ensureViewIsCreated() {
345
             public void ensureViewIsCreated() {
346
                 super.ensureViewIsCreated();
346
                 super.ensureViewIsCreated();

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java View File

346
 
346
 
347
     @NonNull
347
     @NonNull
348
     private BottomTabsController newTabs(List<ViewController> tabs) {
348
     private BottomTabsController newTabs(List<ViewController> tabs) {
349
-        return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, imageLoaderMock, "tabsController", new Options(), new Presenter(activity, new Options()), new BottomTabsPresenter(tabs, new Options()), new BottomTabPresenter(activity, tabs, new Options()));
349
+        return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, imageLoaderMock, "tabsController", new Options(), new Presenter(activity, new Options()), new BottomTabsPresenter(tabs, new Options()), new BottomTabPresenter(activity, tabs, ImageLoaderMock.mock(), new Options()));
350
     }
350
     }
351
 
351
 
352
     @NonNull
352
     @NonNull