|
@@ -192,6 +192,26 @@ public class BottomTabsControllerTest extends BaseTest {
|
192
|
192
|
verify(bottomTabs, times(2)).superCreateItems(); // first time when view is created, second time when options are applied
|
193
|
193
|
}
|
194
|
194
|
|
|
195
|
+ @Test
|
|
196
|
+ public void onSizeChanged_recreateItemsIfSizeHasChanged() {
|
|
197
|
+ int numberOfPreviousInvocations = 2;
|
|
198
|
+ bottomTabs.onSizeChanged(0, 0, 0, 0);
|
|
199
|
+ verify(bottomTabs, times(numberOfPreviousInvocations)).superCreateItems();
|
|
200
|
+
|
|
201
|
+ bottomTabs.onSizeChanged(100, 0, 0, 0);
|
|
202
|
+ verify(bottomTabs, times(numberOfPreviousInvocations)).superCreateItems();
|
|
203
|
+
|
|
204
|
+ bottomTabs.onSizeChanged(1080, 147, 0, 0);
|
|
205
|
+ verify(bottomTabs, times(numberOfPreviousInvocations + 1)).superCreateItems();
|
|
206
|
+
|
|
207
|
+ bottomTabs.onSizeChanged(1920, 147, 0, 0);
|
|
208
|
+ verify(bottomTabs, times(numberOfPreviousInvocations + 2)).superCreateItems();
|
|
209
|
+
|
|
210
|
+ when(bottomTabs.getItemsCount()).thenReturn(0);
|
|
211
|
+ bottomTabs.onSizeChanged(1080, 147, 0, 0);
|
|
212
|
+ verify(bottomTabs, times(numberOfPreviousInvocations + 2)).superCreateItems();
|
|
213
|
+ }
|
|
214
|
+
|
195
|
215
|
@Test
|
196
|
216
|
public void mergeOptions_currentTabIndex() {
|
197
|
217
|
uut.ensureViewIsCreated();
|