|
@@ -53,6 +53,7 @@ import static org.mockito.ArgumentMatchers.eq;
|
53
|
53
|
import static org.mockito.Mockito.spy;
|
54
|
54
|
import static org.mockito.Mockito.times;
|
55
|
55
|
import static org.mockito.Mockito.verify;
|
|
56
|
+import static org.mockito.Mockito.verifyZeroInteractions;
|
56
|
57
|
import static org.mockito.Mockito.when;
|
57
|
58
|
|
58
|
59
|
@Config(qualifiers = "xxhdpi")
|
|
@@ -167,6 +168,20 @@ public class NavigatorTest extends BaseTest {
|
167
|
168
|
assertIsChild(uut.getRootLayout(), child2.getView());
|
168
|
169
|
}
|
169
|
170
|
|
|
171
|
+ @Test
|
|
172
|
+ public void setRoot_WithWaitForRender() {
|
|
173
|
+ ViewController primaryView = spy(child2);
|
|
174
|
+ uut.setRoot(primaryView, new CommandListenerAdapter(), reactInstanceManager);
|
|
175
|
+ child3.options.animations.setRoot.waitForRender = new Bool(true);
|
|
176
|
+ ViewController secondaryView = spy(child3);
|
|
177
|
+ CommandListenerAdapter listener = spy(new CommandListenerAdapter());
|
|
178
|
+ uut.setRoot(secondaryView, listener, reactInstanceManager);
|
|
179
|
+ verify(secondaryView).addOnAppearedListener(any());
|
|
180
|
+ verifyZeroInteractions(listener);
|
|
181
|
+ assertThat(primaryView.isViewShown()).isEqualTo(true);
|
|
182
|
+ secondaryView.onViewAppeared();
|
|
183
|
+ }
|
|
184
|
+
|
170
|
185
|
@Test
|
171
|
186
|
public void setRoot_destroysModals() {
|
172
|
187
|
uut.showModal(child1, new CommandListenerAdapter());
|