|
@@ -7,6 +7,7 @@ import android.widget.FrameLayout;
|
7
|
7
|
import com.reactnativenavigation.BaseTest;
|
8
|
8
|
import com.reactnativenavigation.anim.ModalAnimator;
|
9
|
9
|
import com.reactnativenavigation.mocks.SimpleViewController;
|
|
10
|
+import com.reactnativenavigation.parse.ModalPresentationStyle;
|
10
|
11
|
import com.reactnativenavigation.parse.Options;
|
11
|
12
|
import com.reactnativenavigation.utils.CommandListenerAdapter;
|
12
|
13
|
import com.reactnativenavigation.viewcontrollers.Navigator.CommandListener;
|
|
@@ -122,6 +123,7 @@ public class ModalPresenterTest extends BaseTest {
|
122
|
123
|
|
123
|
124
|
@Test
|
124
|
125
|
public void dismissModal_previousViewIsAddedAtIndex0() {
|
|
126
|
+ modal2.ensureViewIsCreated();
|
125
|
127
|
FrameLayout spy = spy(new FrameLayout(newActivity()));
|
126
|
128
|
uut.setContentLayout(spy);
|
127
|
129
|
uut.dismissModal(modal1, modal2, new CommandListenerAdapter());
|
|
@@ -150,4 +152,14 @@ public class ModalPresenterTest extends BaseTest {
|
150
|
152
|
uut.dismissModal(modal2, modal1, new CommandListenerAdapter());
|
151
|
153
|
verify(modal1, times(2)).onViewAppeared();
|
152
|
154
|
}
|
|
155
|
+
|
|
156
|
+ @Test
|
|
157
|
+ public void dismissModal_previousViewIsNotDetachedIfOverCurrentContext() {
|
|
158
|
+ modal1.options.modal.presentationStyle = ModalPresentationStyle.OverCurrentContext;
|
|
159
|
+ disableShowModalAnimation(modal1, modal2);
|
|
160
|
+
|
|
161
|
+ uut.showModal(modal1, rootController, new CommandListenerAdapter());
|
|
162
|
+ assertThat(rootController.getView().getParent()).isNotNull();
|
|
163
|
+ verify(rootController, times(0)).onViewDisappear();
|
|
164
|
+ }
|
153
|
165
|
}
|