Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

Commit ec447cf

Browse files
Hoang Chau KhanhHoang Chau Khanh
authored andcommitted
Add test for core validation func (#20)
1 parent d4821da commit ec447cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/react-tree-test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ describe('ReactTree', () => {
1717
const reactTreeNode = ReactDOM.findDOMNode(reactTree);
1818

1919
expect(reactTreeNode.textContent).not.toBeNull();
20-
expect(ReactTree.propTypes.core).toBeDefined();
2120
});
2221

2322
it('should run the handle function of onChanged event', () => {
@@ -37,4 +36,12 @@ describe('ReactTree', () => {
3736

3837
expect(renderReactTree).toThrowError(TypeError);
3938
});
39+
40+
it('should validation of "core" prop is defined', () => {
41+
const ERROR_CORE = { data: 1 };
42+
43+
TestUtils.renderIntoDocument(<ReactTree core={ERROR_CORE} />);
44+
45+
expect(ReactTree.propTypes.core).toBeDefined();
46+
});
4047
});

0 commit comments

Comments
 (0)