diff options
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', () => { |