瀏覽代碼

driving through e2e

Daniel Zlotin 7 年之前
父節點
當前提交
909d2d8723
共有 2 個文件被更改,包括 3 次插入21 次删除
  1. 0
    20
      integration/SingleScreen.test.js
  2. 3
    1
      src/Navigation.js

+ 0
- 20
integration/SingleScreen.test.js 查看文件

@@ -1,20 +0,0 @@
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 查看文件

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