diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 18:08:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 18:08:11 +0000 |
commit | 8a7efa45c38ed3200d173d2c3207a8154e583c16 (patch) | |
tree | 1bb4d579b95c79aae4946a06fefa089e5549b722 /spec/frontend/lib | |
parent | 53b1f4eaa2a451aaba908a5fee7ce97a930021ac (diff) | |
download | gitlab-ce-8a7efa45c38ed3200d173d2c3207a8154e583c16.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/lib')
-rw-r--r-- | spec/frontend/lib/utils/file_upload_spec.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/frontend/lib/utils/file_upload_spec.js b/spec/frontend/lib/utils/file_upload_spec.js index 1255d6fc14f..1dff5d4f925 100644 --- a/spec/frontend/lib/utils/file_upload_spec.js +++ b/spec/frontend/lib/utils/file_upload_spec.js @@ -1,4 +1,4 @@ -import fileUpload from '~/lib/utils/file_upload'; +import fileUpload, { getFilename } from '~/lib/utils/file_upload'; describe('File upload', () => { beforeEach(() => { @@ -62,3 +62,15 @@ describe('File upload', () => { expect(input.click).not.toHaveBeenCalled(); }); }); + +describe('getFilename', () => { + it('returns first value correctly', () => { + const event = { + clipboardData: { + getData: () => 'test.png\rtest.txt', + }, + }; + + expect(getFilename(event)).toBe('test.png'); + }); +}); |