Browse Source

fix tests

Daniel Zlotin 7 years ago
parent
commit
0df3b8b32c

+ 3
- 3
lib/src/xparams/containers/Root.js View File

@@ -3,15 +3,15 @@ const SideMenu = require('./SideMenu');
3 3
 
4 4
 class Root {
5 5
   /**
6
-   * @property {Container} container
6
+   * @property {Container} component
7 7
    * @property {SideMenu} [sideMenu]
8 8
    * @property {Container[]} [bottomTabs]
9 9
    */
10 10
   constructor(root) {
11
-    this.container = root.container && new Container(root.container);
11
+    this.component = root.container && new Container(root.component);
12 12
     this.sideMenu = root.sideMenu && new SideMenu(root.sideMenu);
13 13
     if (root.bottomTabs) {
14
-      root.bottomTabs.map((t) => new Container(t.container));
14
+      root.bottomTabs.map((t) => new Container(t.component));
15 15
       this.bottomTabs = root.bottomTabs;
16 16
     }
17 17
   }

+ 11
- 11
lib/src/xparams/containers/Root.test.js View File

@@ -1,9 +1,9 @@
1 1
 const Root = require('./Root');
2 2
 
3
-const CONTAINER = { name: 'myScreen' };
3
+const COMPONENT = { name: 'myScreen' };
4 4
 const SIDE_MENU = {
5 5
   left: {
6
-    container: {
6
+    component: {
7 7
       name: 'navigation.playground.TextScreen',
8 8
       passProps: {
9 9
         text: 'This is a left side menu screen'
@@ -11,7 +11,7 @@ const SIDE_MENU = {
11 11
     }
12 12
   },
13 13
   right: {
14
-    container: {
14
+    component: {
15 15
       name: 'navigation.playground.TextScreen',
16 16
       passProps: {
17 17
         text: 'This is a right side menu screen'
@@ -21,7 +21,7 @@ const SIDE_MENU = {
21 21
 };
22 22
 const BOTTOM_TABS = [
23 23
   {
24
-    container: {
24
+    component: {
25 25
       name: 'navigation.playground.TextScreen',
26 26
       passProps: {
27 27
         text: 'This is a side menu center screen tab 1'
@@ -29,7 +29,7 @@ const BOTTOM_TABS = [
29 29
     }
30 30
   },
31 31
   {
32
-    container: {
32
+    component: {
33 33
       name: 'navigation.playground.TextScreen',
34 34
       passProps: {
35 35
         text: 'This is a side menu center screen tab 2'
@@ -37,7 +37,7 @@ const BOTTOM_TABS = [
37 37
     }
38 38
   },
39 39
   {
40
-    container: {
40
+    component: {
41 41
       name: 'navigation.playground.TextScreen',
42 42
       passProps: {
43 43
         text: 'This is a side menu center screen tab 3'
@@ -49,12 +49,12 @@ const BOTTOM_TABS = [
49 49
 describe('Root', () => {
50 50
   it('Parses Root', () => {
51 51
     const uut = new Root(simpleRoot());
52
-    expect(uut.container.name).toEqual(CONTAINER.name);
52
+    expect(uut.component.name).toEqual(COMPONENT.name);
53 53
   });
54 54
 
55 55
   it('parses root with sideMenu', () => {
56 56
     const uut = new Root(rootWithSideMenu());
57
-    expect(uut.container.name).toEqual(CONTAINER.name);
57
+    expect(uut.component.name).toEqual(COMPONENT.name);
58 58
     expect(uut.sideMenu).toEqual(SIDE_MENU);
59 59
   });
60 60
 
@@ -66,18 +66,18 @@ describe('Root', () => {
66 66
 
67 67
 function rootWithBottomTabs() {
68 68
   return {
69
-    container: CONTAINER,
69
+    component: COMPONENT,
70 70
     bottomTabs: BOTTOM_TABS
71 71
   };
72 72
 }
73 73
 
74 74
 function simpleRoot() {
75
-  return { container: CONTAINER };
75
+  return { component: COMPONENT };
76 76
 }
77 77
 
78 78
 function rootWithSideMenu() {
79 79
   return {
80
-    container: CONTAINER,
80
+    component: COMPONENT,
81 81
     sideMenu: SIDE_MENU
82 82
   };
83 83
 }

+ 2
- 2
lib/src/xparams/containers/SideMenu.js View File

@@ -6,8 +6,8 @@ class SideMenu {
6 6
   * @property {Container} [right]
7 7
   */
8 8
   constructor(params) {
9
-    this.left = params.left && { container: new Container(params.left.container) };
10
-    this.right = params.right && { container: new Container(params.right.container) };
9
+    this.left = params.left && { component: new Container(params.left.component) };
10
+    this.right = params.right && { component: new Container(params.right.component) };
11 11
   }
12 12
 }
13 13
 

+ 2
- 2
lib/src/xparams/containers/SideMenu.test.js View File

@@ -1,7 +1,7 @@
1 1
 const SideMenu = require('./SideMenu');
2 2
 
3
-const LEFT = { container: { name: 'myLeftScreen' } };
4
-const RIGHT = { container: { name: 'myRightScreen' } };
3
+const LEFT = { component: { name: 'myLeftScreen' } };
4
+const RIGHT = { component: { name: 'myRightScreen' } };
5 5
 const SIDE_MENU = { left: LEFT, right: RIGHT };
6 6
 
7 7
 describe('SideMenu', () => {

+ 1
- 1
playground/src/containers/ModalScreen.js View File

@@ -45,7 +45,7 @@ class ModalScreen extends Component {
45 45
 
46 46
   onClickShowModal() {
47 47
     Navigation.showModal({
48
-      container: {
48
+      component: {
49 49
         name: 'navigation.playground.ModalScreen',
50 50
         passProps: {
51 51
           modalPosition: this.getModalPosition() + 1,

+ 1
- 1
playground/src/containers/OrientationSelectScreen.js View File

@@ -21,7 +21,7 @@ class OrientationSelectScreen extends Component {
21 21
 
22 22
   onClickOrientationScreen(orientation) {
23 23
     Navigation.showModal({
24
-      container: {
24
+      component: {
25 25
         name: 'navigation.playground.OrientationDetectScreen',
26 26
         passProps: {
27 27
           orientation