diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 15:10:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-28 15:10:22 +0300 |
commit | d2f4295270852f1ec4b9736f1db493421729474d (patch) | |
tree | c3bb3833ab7b6039a6b7223cc26745d373295fa3 /spec/frontend/dropzone_input_spec.js | |
parent | 89cbcca95d58b6185098c13467d2382032f11774 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/dropzone_input_spec.js')
-rw-r--r-- | spec/frontend/dropzone_input_spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/frontend/dropzone_input_spec.js b/spec/frontend/dropzone_input_spec.js index acf7d0780cd..12e10f7c5f4 100644 --- a/spec/frontend/dropzone_input_spec.js +++ b/spec/frontend/dropzone_input_spec.js @@ -71,6 +71,7 @@ describe('dropzone_input', () => { triggerPasteEvent({ types: ['text/plain', 'text/html', 'text/rtf', 'Files'], getData: () => longFileName, + files: [new File([new Blob()], longFileName, { type: 'image/png' })], items: [ { kind: 'file', @@ -84,6 +85,24 @@ describe('dropzone_input', () => { await waitForPromises(); expect(axiosMock.history.post[0].data.get('file').name).toHaveLength(246); }); + + it('display original file name in comment box', async () => { + const axiosMock = new MockAdapter(axios); + triggerPasteEvent({ + types: ['Files'], + files: [new File([new Blob()], 'test.png', { type: 'image/png' })], + items: [ + { + kind: 'file', + type: 'image/png', + getAsFile: () => new Blob(), + }, + ], + }); + axiosMock.onPost().reply(httpStatusCodes.OK, { link: { markdown: 'foo' } }); + await waitForPromises(); + expect(axiosMock.history.post[0].data.get('file').name).toEqual('test.png'); + }); }); describe('shows error message', () => { |