Browse Source

fixed lint

Daniel Zlotin 7 years ago
parent
commit
b6b7fc187f
3 changed files with 13 additions and 43 deletions
  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 View File

1
-import _ from 'lodash';
2
 import {NativeModules} from 'react-native';
1
 import {NativeModules} from 'react-native';
3
 const {NativeNavigation} = NativeModules;
2
 const {NativeNavigation} = NativeModules;
4
 import * as LayoutBuilder from './LayoutBuilder';
3
 import * as LayoutBuilder from './LayoutBuilder';
6
 export function startApp(params) {
5
 export function startApp(params) {
7
   NativeNavigation.startApp(LayoutBuilder.parse(params));
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 View File

20
       });
20
       });
21
       expect(mockNativeNavigation.startApp).toHaveBeenCalledTimes(1);
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 View File

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
 });