Browse Source

fixed e2e dismissModal #962

Daniel Zlotin 7 years ago
parent
commit
e04d175880
2 changed files with 4 additions and 2 deletions
  1. 1
    1
      e2e/app.test.js
  2. 3
    1
      lib/ios/RNNModalManager.m

+ 1
- 1
e2e/app.test.js View File

191
     await device.relaunchApp();
191
     await device.relaunchApp();
192
   });
192
   });
193
 
193
 
194
-  it.only('declare a navigationStyle on container component', async () => {
194
+  it('declare a navigationStyle on container component', async () => {
195
     await elementByLabel('Push').tap();
195
     await elementByLabel('Push').tap();
196
     await expect(element(by.label('Static Title').and(by.type('UILabel')))).toBeVisible();
196
     await expect(element(by.label('Static Title').and(by.type('UILabel')))).toBeVisible();
197
   });
197
   });

+ 3
- 1
lib/ios/RNNModalManager.m View File

39
 		return;
39
 		return;
40
 	}
40
 	}
41
 	
41
 	
42
-	if (modalToDismiss == [self topPresentedVC]) {
42
+	UIViewController* topPresentedVC = [self topPresentedVC];
43
+	
44
+	if (modalToDismiss == topPresentedVC || [[topPresentedVC childViewControllers] containsObject:modalToDismiss]) {
43
 		[modalToDismiss dismissViewControllerAnimated:YES completion:^{
45
 		[modalToDismiss dismissViewControllerAnimated:YES completion:^{
44
 			[[_store pendingModalIdsToDismiss] removeObject:containerId];
46
 			[[_store pendingModalIdsToDismiss] removeObject:containerId];
45
 			[self removePendingNextModalIfOnTop];
47
 			[self removePendingNextModalIfOnTop];