This repository was archived by the owner on Jul 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -9,20 +9,26 @@ var CommentBox = m.CommentBox;
99
1010describe ( 'TestCommentBoxComponent' , ( ) => {
1111 var boxNode ;
12+ var commentBox ;
1213 beforeEach ( ( ) => {
13- const commentBox = ReactTestUtils . renderIntoDocument (
14+ commentBox = ReactTestUtils . renderIntoDocument (
1415 < CommentBox url = "/api/comments" pollInterval = { 2000 } />
1516 ) ;
16-
1717 boxNode = ReactDOM . findDOMNode ( commentBox ) ;
1818 } ) ;
1919
20+ it ( 'should exists' , function ( ) {
21+ expect ( ReactTestUtils . isCompositeComponent ( commentBox ) ) . toBeTruthy ( ) ;
22+ } ) ;
23+
2024 it ( 'class should equal commentBox' , ( ) => {
2125 expect ( boxNode . className ) . toEqual ( 'commentBox' ) ;
2226 } ) ;
2327
24- it ( 'header should be Comments' , ( ) => {
25- //expect(boxNode.children.h1).toBeDefined();
26- //console.log(boxNode.children)
27- } ) ;
28+ it ( 'initial state data should be empty' , ( ) => {
29+ expect ( commentBox . getInitialState ( ) ) . toBeDefined ( ) ;
30+ const commentBoxData = commentBox . getInitialState ( ) . data ;
31+ expect ( commentBoxData ) . toBeDefined ( ) ;
32+ expect ( commentBoxData ) . toEqual ( [ ] ) ;
33+ } )
2834} )
You can’t perform that action at this time.
0 commit comments