Daniel Zlotin hace 7 años
padre
commit
b6b7fc187f
Se han modificado 3 ficheros con 13 adiciones y 43 borrados
  1. 0
    27
      src/commands/Commands.js
  2. 0
    16
      src/commands/Commands.test.js
  3. 13
    0
      src/commands/LayoutBuilder.test.js

+ 0
- 27
src/commands/Commands.js Ver fichero

@@ -1,4 +1,3 @@
1
-import _ from 'lodash';
2 1
 import {NativeModules} from 'react-native';
3 2
 const {NativeNavigation} = NativeModules;
4 3
 import * as LayoutBuilder from './LayoutBuilder';
@@ -6,29 +5,3 @@ import * as LayoutBuilder from './LayoutBuilder';
6 5
 export function startApp(params) {
7 6
   NativeNavigation.startApp(LayoutBuilder.parse(params));
8 7
 }
9
-//
10
-//function parseParams(params) {
11
-//  const msg = `invalid params passed to startApp: ${params}`;
12
-//  if (!params) {
13
-//    throw new Error(msg);
14
-//  }
15
-//
16
-//  if (params.tabs) {
17
-//    return parseTabs(params);
18
-//  }
19
-//
20
-//  if (params.container) {
21
-//    return parseContainer(params);
22
-//  }
23
-//
24
-//  throw new Error(msg);
25
-//}
26
-//
27
-//function parseTabs(params) {
28
-////&& params.tabs.length > 0 && _.every(params.tabs, (t) => t.containerKey)
29
-//}
30
-//
31
-//function parseContainer(params) {
32
-//
33
-//}
34
-

+ 0
- 16
src/commands/Commands.test.js Ver fichero

@@ -20,21 +20,5 @@ describe('Commands', () => {
20 20
       });
21 21
       expect(mockNativeNavigation.startApp).toHaveBeenCalledTimes(1);
22 22
     });
23
-
24
-    it('adds uniqueId to passed container', () => {
25
-      uut.startApp({
26
-        container: {
27
-          key: 'com.example.MyScreen'
28
-        }
29
-      });
30
-
31
-      expect(mockNativeNavigation.startApp).toHaveBeenCalledWith({
32
-        container: {
33
-          key: 'com.example.MyScreen',
34
-          id: 'container123'
35
-        }
36
-      });
37
-    });
38
-
39 23
   });
40 24
 });

+ 13
- 0
src/commands/LayoutBuilder.test.js Ver fichero

@@ -42,5 +42,18 @@ describe('LayoutBuilder', () => {
42 42
         }
43 43
       });
44 44
     });
45
+
46
+    it('adds uniqueId to passed container', () => {
47
+      expect(uut.parse({
48
+        container: {
49
+          key: 'com.example.MyScreen'
50
+        }
51
+      })).toEqual({
52
+        container: {
53
+          key: 'com.example.MyScreen',
54
+          id: 'container123'
55
+        }
56
+      });
57
+    });
45 58
   });
46 59
 });