Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await act(async () => {
mockAxios.mockResponse(undefined, mockAxios.mustGetReqByUrl(deleteUrl));
});
} else {
await act(async () => {
fileEntry.find('FileAction').simulate('click');
mockAxios.mockResponse(
undefined,
mockAxios.mustGetReqByUrl(`flask://files.delete_file/uuid=${uuid}`)
);
});
expect(mockAxios.delete).toHaveBeenCalledWith(`flask://files.delete_file/uuid=${uuid}`);
await act(async () => {
mockAxios.mockResponse(
{
data: {
uuid: 'newfile2',
filename: file1.name,
claimed: false,
downloadURL: 'goes://nowhere',
},
},
mockAxios.mustGetReqByUrl('http://upload/endpoint')
);
});
await act(async () => {
mockAxios.mockResponse(
{
data: {
uuid,
filename: name,
claimed: false,
downloadURL: 'goes://nowhere',
},
},
mockAxios.mustGetReqByUrl('goes://nowhere')
);
});