diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/frontend/ide/components/new_dropdown/upload_spec.js | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/frontend/ide/components/new_dropdown/upload_spec.js')
-rw-r--r-- | spec/frontend/ide/components/new_dropdown/upload_spec.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/frontend/ide/components/new_dropdown/upload_spec.js b/spec/frontend/ide/components/new_dropdown/upload_spec.js index ae497106f73..3f3784dbb3a 100644 --- a/spec/frontend/ide/components/new_dropdown/upload_spec.js +++ b/spec/frontend/ide/components/new_dropdown/upload_spec.js @@ -59,14 +59,11 @@ describe('new dropdown upload', () => { result: 'base64,cGxhaW4gdGV4dA==', }; const binaryTarget = { - result: 'base64,w4I=', + result: 'base64,8PDw8A==', // ðððð }; - const textFile = new File(['plain text'], 'textFile'); - const binaryFile = { - name: 'binaryFile', - type: 'image/png', - }; + const textFile = new File(['plain text'], 'textFile'); + const binaryFile = new File(['😺'], 'binaryFile'); beforeEach(() => { jest.spyOn(FileReader.prototype, 'readAsText'); @@ -92,16 +89,16 @@ describe('new dropdown upload', () => { .catch(done.fail); }); - it('splits content on base64 if binary', () => { + it('creates a blob URL for the content if binary', () => { vm.createFile(binaryTarget, binaryFile); - expect(FileReader.prototype.readAsText).not.toHaveBeenCalledWith(textFile); + expect(FileReader.prototype.readAsText).not.toHaveBeenCalled(); expect(vm.$emit).toHaveBeenCalledWith('create', { name: binaryFile.name, type: 'blob', - content: binaryTarget.result.split('base64,')[1], - rawPath: binaryTarget.result, + content: 'ðððð', + rawPath: 'blob:https://gitlab.com/048c7ac1-98de-4a37-ab1b-0206d0ea7e1b', }); }); }); |