Commit c8a11c34 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'fix-invalid-formdata-usage' into 'master'

Fix invalid usage of FormData in karma tests

See merge request gitlab-org/gitlab-ce!32865
parents 9615a3d3 7f5d86d8
...@@ -24,10 +24,7 @@ describe('BlobFileDropzone', function() { ...@@ -24,10 +24,7 @@ describe('BlobFileDropzone', function() {
it('is disabled while uploading', () => { it('is disabled while uploading', () => {
spyOn(window, 'alert'); spyOn(window, 'alert');
const file = { const file = new File([], 'some-file.jpg');
name: 'some-file.jpg',
type: 'jpg',
};
const fakeEvent = $.Event('drop', { const fakeEvent = $.Event('drop', {
dataTransfer: { files: [file] }, dataTransfer: { files: [file] },
}); });
......
...@@ -2,9 +2,9 @@ import $ from 'jquery'; ...@@ -2,9 +2,9 @@ import $ from 'jquery';
import dropzoneInput from '~/dropzone_input'; import dropzoneInput from '~/dropzone_input';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
const TEST_FILE = { const TEST_FILE = new File([], 'somefile.jpg');
upload: {}, TEST_FILE.upload = {};
};
const TEST_UPLOAD_PATH = `${TEST_HOST}/upload/file`; const TEST_UPLOAD_PATH = `${TEST_HOST}/upload/file`;
const TEST_ERROR_MESSAGE = 'A big error occurred!'; const TEST_ERROR_MESSAGE = 'A big error occurred!';
const TEMPLATE = `<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}"> const TEMPLATE = `<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment