Fix FormData usage in karma tests
This commit is contained in:
parent
4d542db508
commit
7f5d86d82e
|
@ -24,10 +24,7 @@ describe('BlobFileDropzone', function() {
|
|||
it('is disabled while uploading', () => {
|
||||
spyOn(window, 'alert');
|
||||
|
||||
const file = {
|
||||
name: 'some-file.jpg',
|
||||
type: 'jpg',
|
||||
};
|
||||
const file = new File([], 'some-file.jpg');
|
||||
const fakeEvent = $.Event('drop', {
|
||||
dataTransfer: { files: [file] },
|
||||
});
|
||||
|
|
|
@ -2,9 +2,9 @@ import $ from 'jquery';
|
|||
import dropzoneInput from '~/dropzone_input';
|
||||
import { TEST_HOST } from 'spec/test_constants';
|
||||
|
||||
const TEST_FILE = {
|
||||
upload: {},
|
||||
};
|
||||
const TEST_FILE = new File([], 'somefile.jpg');
|
||||
TEST_FILE.upload = {};
|
||||
|
||||
const TEST_UPLOAD_PATH = `${TEST_HOST}/upload/file`;
|
||||
const TEST_ERROR_MESSAGE = 'A big error occurred!';
|
||||
const TEMPLATE = `<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}">
|
||||
|
|
Loading…
Reference in New Issue