mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
Revert "fix: Drapper mulitple should work" (#18626)
This reverts commit 06d7f0deec
.
This commit is contained in:
parent
e4a3b72e78
commit
e5d644f71a
@ -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';
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user