Browse Source

e2e fixes

yogevbd 6 years ago
parent
commit
2ab8998ba8

+ 5
- 5
e2e/StaticLifecycleEvents.test.js View File

7
     await device.relaunchApp();
7
     await device.relaunchApp();
8
   });
8
   });
9
 
9
 
10
-  it(':android: didAppear didDisappear', async () => {
10
+  it('didAppear didDisappear', async () => {
11
     await elementById(testIDs.PUSH_STATIC_LIFECYCLE_BUTTON).tap();
11
     await elementById(testIDs.PUSH_STATIC_LIFECYCLE_BUTTON).tap();
12
     await expect(elementByLabel('Static Lifecycle Events Overlay')).toBeVisible();
12
     await expect(elementByLabel('Static Lifecycle Events Overlay')).toBeVisible();
13
-    await expect(elementByLabel('didAppear | navigation.playground.StaticLifecycleOverlay')).toBeVisible();
14
-    await elementByLabel('PUSH').tap();
15
-    await expect(elementByLabel('didAppear | navigation.playground.PushedScreen')).toBeVisible();
16
-    await expect(elementByLabel('didDisappear | navigation.playground.WelcomeScreen')).toBeVisible();
13
+    await expect(elementByLabel('componentDidAppear | navigation.playground.StaticLifecycleOverlay')).toBeVisible();
14
+    await elementById(testIDs.PUSH_BUTTON).tap();
15
+    await expect(elementByLabel('componentDidAppear | navigation.playground.PushedScreen')).toBeVisible();
16
+    await expect(elementByLabel('componentDidDisappear | navigation.playground.WelcomeScreen')).toBeVisible();
17
   });
17
   });
18
 });
18
 });

+ 2
- 2
lib/ios/RNNEventEmitter.m View File

27
 }
27
 }
28
 
28
 
29
 -(void)sendComponentDidAppear:(NSString *)componentId componentName:(NSString *)componentName {
29
 -(void)sendComponentDidAppear:(NSString *)componentId componentName:(NSString *)componentName {
30
-	[self send:componentDidAppear body:@{@"componentId":componentId}];
30
+	[self send:componentDidAppear body:@{@"componentId":componentId, @"componentName": componentName}];
31
 }
31
 }
32
 
32
 
33
 -(void)sendComponentDidDisappear:(NSString *)componentId componentName:(NSString *)componentName{
33
 -(void)sendComponentDidDisappear:(NSString *)componentId componentName:(NSString *)componentName{
34
-	[self send:componentDidDisappear body:@{@"componentId":componentId}];
34
+	[self send:componentDidDisappear body:@{@"componentId":componentId, @"componentName": componentName}];
35
 }
35
 }
36
 
36
 
37
 -(void)sendOnNavigationButtonPressed:(NSString *)componentId buttonId:(NSString*)buttonId {
37
 -(void)sendOnNavigationButtonPressed:(NSString *)componentId buttonId:(NSString*)buttonId {

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

53
 	}
53
 	}
54
 }
54
 }
55
 
55
 
56
--(void)applyOn:(UIViewController*)viewController {	
56
+-(void)applyOn:(UIViewController<RNNRootViewProtocol> *)viewController {
57
 	[self.topBar applyOn:viewController];
57
 	[self.topBar applyOn:viewController];
58
 	[self.bottomTabs applyOn:viewController];
58
 	[self.bottomTabs applyOn:viewController];
59
 	[self.topTab applyOn:viewController];
59
 	[self.topTab applyOn:viewController];
61
 	[self.sideMenu applyOn:viewController];
61
 	[self.sideMenu applyOn:viewController];
62
 	[self.overlay applyOn:viewController];
62
 	[self.overlay applyOn:viewController];
63
 	[self applyOtherOptionsOn:viewController];
63
 	[self applyOtherOptionsOn:viewController];
64
+	
65
+	[viewController optionsUpdated];
64
 }
66
 }
65
 
67
 
66
 - (void)applyOtherOptionsOn:(UIViewController*)viewController {
68
 - (void)applyOtherOptionsOn:(UIViewController*)viewController {

+ 7
- 4
lib/ios/RNNRootViewController.m View File

44
 -(void)viewWillAppear:(BOOL)animated{
44
 -(void)viewWillAppear:(BOOL)animated{
45
 	[super viewWillAppear:animated];
45
 	[super viewWillAppear:animated];
46
 	[self.options applyOn:self];
46
 	[self.options applyOn:self];
47
-
48
-	[self setCustomNavigationTitleView];
49
-	[self setCustomNavigationBarView];
50
-	[self setCustomNavigationComponentBackground];
47
+	[self optionsUpdated];
51
 }
48
 }
52
 
49
 
53
 -(void)viewDidAppear:(BOOL)animated {
50
 -(void)viewDidAppear:(BOOL)animated {
68
 	[super viewDidLoad];
65
 	[super viewDidLoad];
69
 }
66
 }
70
 
67
 
68
+- (void)optionsUpdated {
69
+	[self setCustomNavigationTitleView];
70
+	[self setCustomNavigationBarView];
71
+	[self setCustomNavigationComponentBackground];
72
+}
73
+
71
 - (void)mergeOptions:(NSDictionary *)options {
74
 - (void)mergeOptions:(NSDictionary *)options {
72
 	[self.options mergeIfEmptyWith:options];
75
 	[self.options mergeIfEmptyWith:options];
73
 }
76
 }

+ 1
- 0
lib/ios/RNNRootViewProtocol.h View File

5
 @optional
5
 @optional
6
 - (void)mergeOptions:(NSDictionary*)options;
6
 - (void)mergeOptions:(NSDictionary*)options;
7
 - (BOOL)isCustomViewController;
7
 - (BOOL)isCustomViewController;
8
+- (void)optionsUpdated;
8
 
9
 
9
 @required
10
 @required
10
 - (BOOL)isCustomTransitioned;
11
 - (BOOL)isCustomTransitioned;

+ 1
- 0
lib/ios/RNNTitleOptions.m View File

1
 #import "RNNTitleOptions.h"
1
 #import "RNNTitleOptions.h"
2
 #import "RNNTitleViewHelper.h"
2
 #import "RNNTitleViewHelper.h"
3
 
3
 
4
+
4
 @implementation RNNTitleOptions
5
 @implementation RNNTitleOptions
5
 
6
 
6
 - (void)applyOn:(UIViewController *)viewController {
7
 - (void)applyOn:(UIViewController *)viewController {

+ 4
- 4
playground/src/screens/CustomTopBar.js View File

17
   }
17
   }
18
 
18
 
19
   componentDidAppear() {
19
   componentDidAppear() {
20
-    console.log('guyca', 'componentDidAppear');
20
+    // console.log('guyca', 'componentDidAppear');
21
   }
21
   }
22
 
22
 
23
   componentDidDisappear() {
23
   componentDidDisappear() {
24
-    console.log('guyca', `componentDidDisappear`);
24
+    // console.log('guyca', `componentDidDisappear`);
25
   }
25
   }
26
 
26
 
27
   componentDidMount() {
27
   componentDidMount() {
28
-    console.log('guyca', `componentDidMount`);
28
+    // console.log('guyca', `componentDidMount`);
29
   }
29
   }
30
 
30
 
31
   componentWillUnmount() {
31
   componentWillUnmount() {
32
-    console.log('guyca', `componentWillUnmount`);
32
+    // console.log('guyca', `componentWillUnmount`);
33
   }
33
   }
34
 
34
 
35
   render() {
35
   render() {

+ 6
- 1
playground/src/screens/WelcomeScreen.js View File

261
   onClickShowStaticLifecycleOverlay = () => {
261
   onClickShowStaticLifecycleOverlay = () => {
262
     Navigation.showOverlay({
262
     Navigation.showOverlay({
263
       component: {
263
       component: {
264
-        name: 'navigation.playground.StaticLifecycleOverlay'
264
+        name: 'navigation.playground.StaticLifecycleOverlay',
265
+        options: {
266
+          overlay: {
267
+            interceptTouchOutside: false
268
+          }
269
+        }
265
       }
270
       }
266
     });
271
     });
267
   }
272
   }