|
@@ -52,32 +52,31 @@ describe('ComponentRegistry', () => {
|
52
|
52
|
);
|
53
|
53
|
expect(tree.toJSON().children).toEqual(['Hello, Daniel!']);
|
54
|
54
|
});
|
55
|
|
-
|
56
|
|
-
|
57
|
|
-
|
58
|
|
-
|
59
|
|
-
|
60
|
|
-
|
61
|
|
-
|
62
|
|
-
|
63
|
|
-
|
64
|
|
-
|
65
|
|
-
|
66
|
|
-
|
67
|
|
-
|
68
|
|
-
|
69
|
|
-
|
70
|
|
-
|
71
|
|
-
|
72
|
|
-
|
73
|
|
-
|
74
|
|
-
|
75
|
|
-
|
76
|
|
-
|
77
|
|
-
|
78
|
|
-
|
79
|
|
-
|
80
|
|
-
|
81
|
|
-
|
82
|
|
-
|
|
55
|
+
|
|
56
|
+ it('updates props into original container', () => {
|
|
57
|
+ uut.registerContainer('example.MyContainer', () => MyContainer);
|
|
58
|
+
|
|
59
|
+ const NavigationContainer = getRegisteredComponentClassFromAppRegistry();
|
|
60
|
+ let testParentRef = null;
|
|
61
|
+ class TestParent extends Component {
|
|
62
|
+ constructor(props) {
|
|
63
|
+ super(props);
|
|
64
|
+ this.state = {};
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+ render() {
|
|
68
|
+ return (
|
|
69
|
+ <NavigationContainer name={this.state.name}/>
|
|
70
|
+ );
|
|
71
|
+ }
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ const tree = renderer.create(
|
|
75
|
+ <TestParent ref={(r) => testParentRef = r}/>
|
|
76
|
+ );
|
|
77
|
+
|
|
78
|
+ expect(tree.toJSON().children).toEqual(['Hello, World!']);
|
|
79
|
+ testParentRef.setState({name: 'Gandalf'});
|
|
80
|
+ expect(tree.toJSON().children).toEqual(['Hello, Gandalf!']);
|
|
81
|
+ });
|
83
|
82
|
});
|