|
@@ -20,11 +20,19 @@ describe('app', () => {
|
20
|
20
|
});
|
21
|
21
|
|
22
|
22
|
it('screen lifecycle', () => {
|
23
|
|
- elementByLabel('Switch to lifecycle screen').tap();
|
|
23
|
+ elementByLabel('Push lifecycle screen').tap();
|
24
|
24
|
expect(elementByLabel('onStart!')).toBeVisible();
|
25
|
25
|
elementByLabel('Push to test onStop').tap();
|
26
|
26
|
expect(elementByLabel('Alert')).toBeVisible();
|
27
|
|
- expect(elementByLabel('onStop!')).toBeVisible();
|
|
27
|
+ expect(elementByLabel('onStop')).toBeVisible();
|
|
28
|
+ });
|
|
29
|
+
|
|
30
|
+ it('unmount is called on pop', () => {
|
|
31
|
+ elementByLabel('Push lifecycle screen').tap();
|
|
32
|
+ expect(elementByLabel('onStart!')).toBeVisible();
|
|
33
|
+ element(by.traits(['button']).and(by.label('Back'))).tap();
|
|
34
|
+ expect(elementByLabel('onStop')).toBeVisible();
|
|
35
|
+ expect(elementByLabel('componentWillUnmount')).toBeVisible();
|
28
|
36
|
});
|
29
|
37
|
});
|
30
|
38
|
|
|
@@ -148,12 +156,17 @@ describe('modal', () => {
|
148
|
156
|
});
|
149
|
157
|
});
|
150
|
158
|
|
151
|
|
-describe('reload app', () => {
|
152
|
|
- before((done) => {
|
|
159
|
+describe.only('reload app', () => {
|
|
160
|
+ beforeEach((done) => {
|
153
|
161
|
simulator.reloadReactNativeApp(done);
|
154
|
162
|
});
|
155
|
163
|
|
156
|
|
- it('shows welcome screen', () => {
|
|
164
|
+ it('push a screen to ensure its not there after reload', () => {
|
|
165
|
+ elementByLabel('Push').tap();
|
|
166
|
+ expect(elementByLabel('Pushed Screen')).toBeVisible();
|
|
167
|
+ });
|
|
168
|
+
|
|
169
|
+ it('show welcome screen after reload', () => {
|
157
|
170
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
158
|
171
|
});
|
159
|
172
|
});
|