@@ -595,7 +595,7 @@ def render
595
595
596
596
expect { |b |
597
597
element = React . create_element ( Foo ) . on ( :foo_submit , &b )
598
- renderElementToDocument ( element )
598
+ React :: Test :: Utils . render_into_document ( element )
599
599
} . to yield_with_args ( 'bar' )
600
600
end
601
601
@@ -614,7 +614,7 @@ def render
614
614
615
615
expect { |b |
616
616
element = React . create_element ( Foo ) . on ( :foo_invoked , &b )
617
- renderElementToDocument ( element )
617
+ React :: Test :: Utils . render_into_document ( element )
618
618
} . to yield_with_args ( [ 1 , 2 , 3 ] , 'bar' )
619
619
end
620
620
end
@@ -845,10 +845,6 @@ def render
845
845
stub_const 'Foo' , Class . new
846
846
Foo . class_eval do
847
847
include React ::Component
848
- export_state :the_children
849
- before_mount do
850
- the_children! children
851
- end
852
848
def render
853
849
React . create_element ( 'div' ) { 'lorem' }
854
850
end
@@ -859,9 +855,9 @@ def render
859
855
ele = React . create_element ( Foo ) {
860
856
[ React . create_element ( 'a' ) , React . create_element ( 'li' ) ]
861
857
}
862
- renderElementToDocument ( ele )
858
+ instance = React :: Test :: Utils . render_into_document ( ele )
863
859
864
- children = Foo . the_children
860
+ children = instance . children
865
861
866
862
expect ( children ) . to be_a ( React ::Children )
867
863
expect ( children . count ) . to eq ( 2 )
@@ -870,8 +866,8 @@ def render
870
866
871
867
it 'returns an empty Enumerator if there are no children' do
872
868
ele = React . create_element ( Foo )
873
- renderElementToDocument ( ele )
874
- nodes = Foo . the_children . each
869
+ instance = React :: Test :: Utils . render_into_document ( ele )
870
+ nodes = instance . children . each
875
871
expect ( nodes . size ) . to eq ( 0 )
876
872
expect ( nodes . count ) . to eq ( 0 )
877
873
end
0 commit comments