Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit d38d75a

Browse files
author
lewa
committed
More tests
1 parent 7b52264 commit d38d75a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

__tests__/example-test.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ var CommentBox = m.CommentBox;
99

1010
describe('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
})

0 commit comments

Comments
 (0)