Skip to content

Commit

Permalink
test: part
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Dec 21, 2023
1 parent 8d5f90f commit f413433
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/uploader.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@ describe('uploader', () => {
}, 100);
});

return;

it('drag unaccepted type files to upload will not trigger onStart', done => {
const input = uploader.find('input').first();
const input = uploader.container.querySelector('input')!;
const files = [
{
name: 'success.jpg',
Expand All @@ -254,8 +252,11 @@ describe('uploader', () => {
},
},
];
files.item = i => files[i];
input.simulate('drop', { dataTransfer: { files } });
(files as any).item = (i: number) => files[i];

fireEvent.drop(input, {
dataTransfer: { files },
});
const mockStart = jest.fn();
handlers.onStart = mockStart;
setTimeout(() => {
Expand All @@ -264,6 +265,8 @@ describe('uploader', () => {
}, 100);
});

return;

it('drag files with multiple false', done => {
const wrapper = render(<Upload {...props} multiple={false} />);
const input = wrapper.find('input').first();
Expand Down

0 comments on commit f413433

Please sign in to comment.