Selaa lähdekoodia

Fix unit tests

Guy Carmeli 6 vuotta sitten
vanhempi
commit
45c8a35fe4

+ 2
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabPresenterTest.java Näytä tiedosto

@@ -4,6 +4,7 @@ import android.app.Activity;
4 4
 import android.graphics.Color;
5 5
 
6 6
 import com.reactnativenavigation.BaseTest;
7
+import com.reactnativenavigation.mocks.ImageLoaderMock;
7 8
 import com.reactnativenavigation.mocks.SimpleViewController;
8 9
 import com.reactnativenavigation.parse.Options;
9 10
 import com.reactnativenavigation.parse.params.Colour;
@@ -43,7 +44,7 @@ public class BottomTabPresenterTest extends BaseTest {
43 44
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
44 45
         child3 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
45 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 48
         uut.bindView(bottomTabs);
48 49
         uut.setDefaultOptions(new Options());
49 50
     }

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java Näytä tiedosto

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

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java Näytä tiedosto

@@ -346,7 +346,7 @@ public class NavigatorTest extends BaseTest {
346 346
 
347 347
     @NonNull
348 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 352
     @NonNull