|
@@ -1,29 +1,22 @@
|
1
|
1
|
package com.reactnativenavigation.viewcontrollers;
|
2
|
2
|
|
3
|
|
-import android.app.Activity;
|
4
|
|
-import android.view.View;
|
5
|
|
-
|
6
|
|
-import com.reactnativenavigation.BaseTest;
|
7
|
|
-import com.reactnativenavigation.parse.params.Button;
|
8
|
|
-import com.reactnativenavigation.parse.params.Text;
|
9
|
|
-import com.reactnativenavigation.react.Constants;
|
10
|
|
-import com.reactnativenavigation.react.ReactView;
|
11
|
|
-import com.reactnativenavigation.utils.CollectionUtils;
|
12
|
|
-import com.reactnativenavigation.views.titlebar.TitleBar;
|
13
|
|
-
|
14
|
|
-import org.junit.Test;
|
15
|
|
-
|
16
|
|
-import java.util.ArrayList;
|
17
|
|
-import java.util.Arrays;
|
18
|
|
-import java.util.Collections;
|
19
|
|
-import java.util.HashMap;
|
20
|
|
-import java.util.List;
|
21
|
|
-import java.util.Map;
|
22
|
|
-
|
23
|
|
-import static com.reactnativenavigation.utils.TitleBarHelper.createButtonController;
|
24
|
|
-import static org.assertj.core.api.Java6Assertions.assertThat;
|
25
|
|
-import static org.mockito.Mockito.spy;
|
26
|
|
-import static org.mockito.Mockito.verify;
|
|
3
|
+import android.app.*;
|
|
4
|
+import android.support.v7.widget.*;
|
|
5
|
+import android.view.*;
|
|
6
|
+
|
|
7
|
+import com.reactnativenavigation.*;
|
|
8
|
+import com.reactnativenavigation.parse.params.*;
|
|
9
|
+import com.reactnativenavigation.react.*;
|
|
10
|
+import com.reactnativenavigation.utils.*;
|
|
11
|
+import com.reactnativenavigation.views.titlebar.*;
|
|
12
|
+
|
|
13
|
+import org.junit.*;
|
|
14
|
+
|
|
15
|
+import java.util.*;
|
|
16
|
+
|
|
17
|
+import static com.reactnativenavigation.utils.TitleBarHelper.*;
|
|
18
|
+import static org.assertj.core.api.Java6Assertions.*;
|
|
19
|
+import static org.mockito.Mockito.*;
|
27
|
20
|
|
28
|
21
|
public class TitleBarTest extends BaseTest {
|
29
|
22
|
|
|
@@ -31,14 +24,12 @@ public class TitleBarTest extends BaseTest {
|
31
|
24
|
private Button leftButton;
|
32
|
25
|
private Button textButton;
|
33
|
26
|
private Button customButton;
|
34
|
|
- private Map<String, TitleBarButtonController> buttonControllers;
|
35
|
27
|
private Activity activity;
|
36
|
28
|
|
37
|
29
|
@Override
|
38
|
30
|
public void beforeEach() {
|
39
|
31
|
activity = newActivity();
|
40
|
32
|
createButtons();
|
41
|
|
- buttonControllers = new HashMap<>();
|
42
|
33
|
uut = spy(new TitleBar(activity));
|
43
|
34
|
}
|
44
|
35
|
|
|
@@ -105,6 +96,13 @@ public class TitleBarTest extends BaseTest {
|
105
|
96
|
verify(uut).addView(component);
|
106
|
97
|
}
|
107
|
98
|
|
|
99
|
+ @Test
|
|
100
|
+ public void addView_overflowIsEnabledForButtonsContainer() {
|
|
101
|
+ ActionMenuView buttonsContainer = mock(ActionMenuView.class);
|
|
102
|
+ uut.addView(buttonsContainer);
|
|
103
|
+ verify(buttonsContainer).setClipChildren(false);
|
|
104
|
+ }
|
|
105
|
+
|
108
|
106
|
@Test
|
109
|
107
|
public void clear() {
|
110
|
108
|
View title = new View(activity);
|