Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onChange={onChange}
/>
);
const dropzone = getDropzoneForFileType(wrapper, 2);
const file1 = {type: 'pdf', name: 'test.pdf'};
// simulate actual "drop" event
await act(async () => {
dropzone.simulate('drop', createDtWithFiles([file1]));
});
const mockDispatch = React.mockDispatches[0];
// the upload endpoint is properly called
expect(mockAxios.post).toHaveBeenCalledWith(
'http://upload/endpoint',
expect.toContainFile(file1),
expect.anything()
);
// the internal state is updated
expect(mockDispatch).toHaveBeenCalledWith(
expect.objectContaining({type: actions.START_UPLOADS})
);
expect(onChange).not.toHaveBeenCalled();
await act(async () => {
mockAxios.mockResponse(
{
data: {