summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-09-12 07:52:24 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-09-12 07:52:24 +0000
commitc8a11c34577d18c19cadd94be6a0406f20966eb2 (patch)
tree728915182e9a7ee46e70c4042b788e4fb0606a16
parent9615a3d3f05e23cb2b5d50884820004c98b252f6 (diff)
parent7f5d86d82e602f4eaed4e25521dfa7213fb07a1a (diff)
downloadgitlab-ce-c8a11c34577d18c19cadd94be6a0406f20966eb2.tar.gz
Merge branch 'fix-invalid-formdata-usage' into 'master'
Fix invalid usage of FormData in karma tests See merge request gitlab-org/gitlab-ce!32865
-rw-r--r--spec/javascripts/blob/blob_file_dropzone_spec.js5
-rw-r--r--spec/javascripts/dropzone_input_spec.js6
2 files changed, 4 insertions, 7 deletions
diff --git a/spec/javascripts/blob/blob_file_dropzone_spec.js b/spec/javascripts/blob/blob_file_dropzone_spec.js
index cab06a0a9be..fe03775ec4d 100644
--- a/spec/javascripts/blob/blob_file_dropzone_spec.js
+++ b/spec/javascripts/blob/blob_file_dropzone_spec.js
@@ -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] },
});
diff --git a/spec/javascripts/dropzone_input_spec.js b/spec/javascripts/dropzone_input_spec.js
index 326b2c029fb..ef899612b08 100644
--- a/spec/javascripts/dropzone_input_spec.js
+++ b/spec/javascripts/dropzone_input_spec.js
@@ -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}">