Browse Source

driving through e2e

Daniel Zlotin 7 years ago
parent
commit
909d2d8723
2 changed files with 3 additions and 21 deletions
  1. 0
    20
      integration/SingleScreen.test.js
  2. 3
    1
      src/Navigation.js

+ 0
- 20
integration/SingleScreen.test.js View File

1
-describe('single screen integration', () => {
2
-  let Navigation;
3
-  let mockNativeNavigation;
4
-
5
-  beforeEach(() => {
6
-    mockNativeNavigation = {};
7
-    require('react-native').NativeModules.NativeNavigation = mockNativeNavigation;
8
-    Navigation = require('../../src/index').default;
9
-  });
10
-
11
-  xit('startApp directs to native with constructed hirarchy for single screens', () => {
12
-    mockNativeNavigation.startApp = jest.fn();
13
-    Navigation.startApp({
14
-      root: {
15
-        key: 'com.integration.MyFirstScreen'
16
-      }
17
-    });
18
-    expect(mockNativeNavigation.startApp).toHaveBeenCalledTimes(1);
19
-  });
20
-});

+ 3
- 1
src/Navigation.js View File

1
 import * as ContainerRegistry from './containers/ContainerRegistry';
1
 import * as ContainerRegistry from './containers/ContainerRegistry';
2
+import {NativeModules} from 'react-native';
3
+const {NativeNavigation} = NativeModules;
2
 
4
 
3
 export function registerContainer(containerKey, getContainerFunc) {
5
 export function registerContainer(containerKey, getContainerFunc) {
4
   ContainerRegistry.registerContainer(containerKey, getContainerFunc);
6
   ContainerRegistry.registerContainer(containerKey, getContainerFunc);
5
 }
7
 }
6
 
8
 
7
 export function startApp(params) {
9
 export function startApp(params) {
8
-  //
10
+  NativeNavigation.startApp(params);
9
 }
11
 }
10
 
12
 
11
 export function push(params) {
13
 export function push(params) {