diff options
author | Illya Klymov <xanf@xanf.me> | 2019-09-10 12:10:51 +0300 |
---|---|---|
committer | Illya Klymov <xanf@xanf.me> | 2019-09-10 12:10:51 +0300 |
commit | 7f5d86d82e602f4eaed4e25521dfa7213fb07a1a (patch) | |
tree | a95a92c78cb0f91769152c3985e554d04b68d032 /spec/javascripts | |
parent | 4d542db508e454d4ed3a2cdb0a91aee67e1c5cd8 (diff) |
Fix FormData usage in karma tests
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/blob/blob_file_dropzone_spec.js | 5 | ||||
-rw-r--r-- | spec/javascripts/dropzone_input_spec.js | 6 |
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}"> |