mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
Add test case for upload
This commit is contained in:
parent
e4d9e5af54
commit
61a3d66a02
25
components/upload/__tests__/upload.test.js
Normal file
25
components/upload/__tests__/upload.test.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* eslint-disable react/no-string-refs, react/prefer-es6-class */
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Upload from '..';
|
||||
|
||||
describe('Upload', () => {
|
||||
// https://github.com/react-component/upload/issues/36
|
||||
it('should get refs inside Upload in componentDidMount', () => {
|
||||
let ref;
|
||||
const App = React.createClass({
|
||||
componentDidMount() {
|
||||
ref = this.refs.input;
|
||||
},
|
||||
render() {
|
||||
return (
|
||||
<Upload supportServerRender={false}>
|
||||
<input ref="input" />
|
||||
</Upload>
|
||||
);
|
||||
},
|
||||
});
|
||||
mount(<App />);
|
||||
expect(ref).toBeDefined();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user