Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Mishunov <dmishunov@gitlab.com>2019-03-18 14:22:51 +0300
committerDenys Mishunov <dmishunov@gitlab.com>2019-03-18 15:59:16 +0300
commit1a2bdb4366ab819a43e2df48124073c836564e37 (patch)
treeb05d7b6d464cef1bb1c6b38435c18d4fbcd4e52b /spec/javascripts
parentbbbaa7078b62621f86030502bb1b317edea93039 (diff)
Implemented trimming for item's name in Web IDE
Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/57540
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/ide/components/new_dropdown/modal_spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/ide/components/new_dropdown/modal_spec.js b/spec/javascripts/ide/components/new_dropdown/modal_spec.js
index d1a0964ccdd..0556feae46a 100644
--- a/spec/javascripts/ide/components/new_dropdown/modal_spec.js
+++ b/spec/javascripts/ide/components/new_dropdown/modal_spec.js
@@ -109,6 +109,18 @@ describe('new file modal component', () => {
expect(vm.entryName).toBe('index.js');
});
+
+ it('removes leading/trailing spaces when found in the new name', () => {
+ vm.entryName = ' index.js ';
+
+ expect(vm.entryName).toBe('index.js');
+ });
+
+ it('does not remove internal spaces in the file name', () => {
+ vm.entryName = ' In Praise of Idleness.txt ';
+
+ expect(vm.entryName).toBe('In Praise of Idleness.txt');
+ });
});
});