@@ -19,16 +19,7 @@ describe('<TreeNode />', () => {
1919 describe ( 'component' , ( ) => {
2020 it ( 'should render the rct-node container' , ( ) => {
2121 const wrapper = shallow (
22- < TreeNode
23- checked = { 0 }
24- expanded = { false }
25- label = "Europa"
26- optimisticToggle
27- treeId = "id"
28- value = "europa"
29- onCheck = { ( ) => { } }
30- onExpand = { ( ) => { } }
31- /> ,
22+ < TreeNode { ...baseProps } /> ,
3223 ) ;
3324
3425 assert . isTrue ( wrapper . find ( '.rct-node' ) . exists ( ) ) ;
@@ -38,16 +29,7 @@ describe('<TreeNode />', () => {
3829 describe ( 'label' , ( ) => {
3930 it ( 'should render the node\'s label' , ( ) => {
4031 const wrapper = shallow (
41- < TreeNode
42- checked = { 0 }
43- expanded = { false }
44- label = "Europa"
45- optimisticToggle
46- treeId = "id"
47- value = "europa"
48- onCheck = { ( ) => { } }
49- onExpand = { ( ) => { } }
50- /> ,
32+ < TreeNode { ...baseProps } label = "Europa" value = "europa" /> ,
5133 ) ;
5234
5335 assert . isTrue ( wrapper . contains (
@@ -97,27 +79,8 @@ describe('<TreeNode />', () => {
9779 describe ( 'expanded' , ( ) => {
9880 it ( 'should render children when set to true' , ( ) => {
9981 const wrapper = shallow (
100- < TreeNode
101- checked = { 0 }
102- expanded
103- label = "Jupiter"
104- optimisticToggle
105- rawChildren = { [ { value : 'europa' , label : 'Europa' } ] }
106- treeId = "id"
107- value = "jupiter"
108- onCheck = { ( ) => { } }
109- onExpand = { ( ) => { } }
110- >
111- < TreeNode
112- checked = { 0 }
113- expanded = { false }
114- label = "Europa"
115- optimisticToggle
116- treeId = "id"
117- value = "europa"
118- onCheck = { ( ) => { } }
119- onExpand = { ( ) => { } }
120- />
82+ < TreeNode { ...baseProps } expanded rawChildren = { [ { value : 'europa' , label : 'Europa' } ] } >
83+ < TreeNode { ...baseProps } label = "Europa" value = "europa" />
12184 </ TreeNode > ,
12285 ) ;
12386
@@ -126,27 +89,8 @@ describe('<TreeNode />', () => {
12689
12790 it ( 'should not render children when set to false' , ( ) => {
12891 const wrapper = shallow (
129- < TreeNode
130- checked = { 0 }
131- expanded = { false }
132- label = "Jupiter"
133- optimisticToggle
134- rawChildren = { [ { value : 'europa' , label : 'Europa' } ] }
135- treeId = "id"
136- value = "jupiter"
137- onCheck = { ( ) => { } }
138- onExpand = { ( ) => { } }
139- >
140- < TreeNode
141- checked = { 0 }
142- expanded = { false }
143- label = "Europa"
144- optimisticToggle
145- treeId = "id"
146- value = "europa"
147- onCheck = { ( ) => { } }
148- onExpand = { ( ) => { } }
149- />
92+ < TreeNode { ...baseProps } expanded = { false } rawChildren = { [ { value : 'europa' , label : 'Europa' } ] } >
93+ < TreeNode { ...baseProps } />
15094 </ TreeNode > ,
15195 ) ;
15296
@@ -155,17 +99,7 @@ describe('<TreeNode />', () => {
15599
156100 it ( 'should render expanded icons when set to true' , ( ) => {
157101 const wrapper = shallow (
158- < TreeNode
159- checked = { 0 }
160- expanded
161- label = "Jupiter"
162- optimisticToggle
163- rawChildren = { [ { value : 'europa' , label : 'Europa' } ] }
164- treeId = "id"
165- value = "jupiter"
166- onCheck = { ( ) => { } }
167- onExpand = { ( ) => { } }
168- /> ,
102+ < TreeNode { ...baseProps } expanded rawChildren = { [ { value : 'europa' , label : 'Europa' } ] } /> ,
169103 ) ;
170104
171105 assert . isTrue ( wrapper . contains ( < i className = "fa fa-chevron-down" /> ) ) ;
@@ -174,17 +108,7 @@ describe('<TreeNode />', () => {
174108
175109 it ( 'should render collapsed icons when set to false' , ( ) => {
176110 const wrapper = shallow (
177- < TreeNode
178- checked = { 0 }
179- expanded = { false }
180- label = "Jupiter"
181- optimisticToggle
182- rawChildren = { [ { value : 'europa' , label : 'Europa' } ] }
183- treeId = "id"
184- value = "jupiter"
185- onCheck = { ( ) => { } }
186- onExpand = { ( ) => { } }
187- /> ,
111+ < TreeNode { ...baseProps } expanded = { false } rawChildren = { [ { value : 'europa' , label : 'Europa' } ] } /> ,
188112 ) ;
189113
190114 assert . isTrue ( wrapper . contains ( < i className = "fa fa-chevron-right" /> ) ) ;
0 commit comments