Browse Source

e2e fixes

yogevbd 6 years ago
parent
commit
2ab8998ba8

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

@@ -7,12 +7,12 @@ describe('static lifecycle events', () => {
7 7
     await device.relaunchApp();
8 8
   });
9 9
 
10
-  it(':android: didAppear didDisappear', async () => {
10
+  it('didAppear didDisappear', async () => {
11 11
     await elementById(testIDs.PUSH_STATIC_LIFECYCLE_BUTTON).tap();
12 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,11 +27,11 @@ static NSString* const onNavigationButtonPressed	= @"RNN.onNavigationButtonPress
27 27
 }
28 28
 
29 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 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 37
 -(void)sendOnNavigationButtonPressed:(NSString *)componentId buttonId:(NSString*)buttonId {

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

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

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

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

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

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

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

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

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

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

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

@@ -261,7 +261,12 @@ class WelcomeScreen extends Component {
261 261
   onClickShowStaticLifecycleOverlay = () => {
262 262
     Navigation.showOverlay({
263 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
   }