diff options
-rw-r--r-- | spec/javascripts/ide/components/new_dropdown/upload_spec.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/javascripts/ide/components/new_dropdown/upload_spec.js b/spec/javascripts/ide/components/new_dropdown/upload_spec.js index 22b28cdf69e..878e17ac805 100644 --- a/spec/javascripts/ide/components/new_dropdown/upload_spec.js +++ b/spec/javascripts/ide/components/new_dropdown/upload_spec.js @@ -61,29 +61,31 @@ describe('new dropdown upload', () => { const binaryTarget = { result: 'base64,w4I=', }; - const file = { - name: 'file', + const textFile = { + name: 'textFile', type: 'text/plain', }; + const binaryFile = { + name: 'binaryFile', + type: 'image/png', + }; it('creates file in plain text (without encoding) if the file content is plain text', () => { - vm.createFile(textTarget, file); + vm.createFile(textTarget, textFile); expect(vm.$emit).toHaveBeenCalledWith('create', { - name: file.name, + name: textFile.name, type: 'blob', content: 'plain text', base64: false, }); }); - file.type = 'image/png'; - it('splits content on base64 if binary', () => { - vm.createFile(binaryTarget, file); + vm.createFile(binaryTarget, binaryFile); expect(vm.$emit).toHaveBeenCalledWith('create', { - name: file.name, + name: binaryFile.name, type: 'blob', content: binaryTarget.result.split('base64,')[1], base64: true, |