Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revert "fix: Upload.Dragger should work with multiple is false" #18626

Merged
merged 1 commit into from Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions components/upload/Upload.tsx
Expand Up @@ -81,12 +81,6 @@ class Upload extends React.Component<UploadProps, UploadState> {

onStart = (file: RcFile) => {
const { fileList } = this.state;
const { multiple } = this.props;

if (!multiple && fileList.length > 0) {
return;
}

const targetItem = fileToObject(file);
targetItem.status = 'uploading';

Expand Down
24 changes: 0 additions & 24 deletions components/upload/__tests__/upload.test.js
Expand Up @@ -484,28 +484,4 @@ describe('Upload', () => {
);
errorSpy.mockRestore();
});

it('not allow multiple upload when multiple is false', done => {
const onChange = jest.fn();

const wrapper = mount(
<Upload
fileList={[{ uid: '903', file: 'bamboo.png' }]}
action="http://upload.com"
onChange={onChange}
multiple={false}
/>,
);

wrapper.find('input').simulate('change', {
target: {
files: [{ file: 'light.png' }],
},
});

setTimeout(() => {
expect(onChange).not.toHaveBeenCalled();
done();
});
});
});