You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
643 B

/* 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();
});
});