|
@@ -47,7 +47,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
47
|
47
|
private ViewController child1;
|
48
|
48
|
private ViewController child2;
|
49
|
49
|
private ViewController child3;
|
50
|
|
- private ViewController child4;
|
|
50
|
+ private StackController child4;
|
51
|
51
|
private ViewController child5;
|
52
|
52
|
private Options tabOptions = OptionHelper.createBottomTabOptions();
|
53
|
53
|
private ImageLoader imageLoaderMock = ImageLoaderMock.mock();
|
|
@@ -64,7 +64,7 @@ public class BottomTabsControllerTest extends BaseTest {
|
64
|
64
|
child1 = spy(new SimpleViewController(activity, childRegistry, "child1", tabOptions));
|
65
|
65
|
child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tabOptions));
|
66
|
66
|
child3 = spy(new SimpleViewController(activity, childRegistry, "child3", tabOptions));
|
67
|
|
- child4 = spy(new SimpleViewController(activity, childRegistry, "child4", tabOptions));
|
|
67
|
+ child4 = spy(createStack("someStack"));
|
68
|
68
|
child5 = spy(new SimpleViewController(activity, childRegistry, "child5", tabOptions));
|
69
|
69
|
when(child5.handleBack(any())).thenReturn(true);
|
70
|
70
|
tabs = createTabs();
|
|
@@ -214,6 +214,20 @@ public class BottomTabsControllerTest extends BaseTest {
|
214
|
214
|
verify(child5, times(1)).sendOnNavigationButtonPressed("btn1");
|
215
|
215
|
}
|
216
|
216
|
|
|
217
|
+ @Test
|
|
218
|
+ public void push() {
|
|
219
|
+ uut.selectTab(3);
|
|
220
|
+
|
|
221
|
+ SimpleViewController stackChild = new SimpleViewController(activity, childRegistry, "stackChild", new Options());
|
|
222
|
+ SimpleViewController stackChild2 = new SimpleViewController(activity, childRegistry, "stackChild", new Options());
|
|
223
|
+ disablePushAnimation(stackChild, stackChild2);
|
|
224
|
+
|
|
225
|
+ child4.push(stackChild, new CommandListenerAdapter());
|
|
226
|
+ assertThat(child4.size()).isOne();
|
|
227
|
+ child4.push(stackChild2, new CommandListenerAdapter());
|
|
228
|
+ assertThat(child4.size()).isEqualTo(2);
|
|
229
|
+ }
|
|
230
|
+
|
217
|
231
|
@NonNull
|
218
|
232
|
private List<ViewController> createTabs() {
|
219
|
233
|
return Arrays.asList(child1, child2, child3, child4, child5);
|