summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorDenys Mishunov <dmishunov@gitlab.com>2019-08-12 18:13:12 +0200
committerDenys Mishunov <dmishunov@gitlab.com>2019-08-12 18:19:38 +0200
commit4882303760c9f22112985f78746f2416b701a47b (patch)
treee31ee10ca4df5b7dba10a93a5ddc4a1c1f65e005 /spec/javascripts
parent7a22b4bae55ba3afcc6fc961e6a0aeb47c7bd937 (diff)
downloadgitlab-ce-4882303760c9f22112985f78746f2416b701a47b.tar.gz
Fixed deletion of directories in Web IDE64677-delete-directory-webide
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/ide/stores/utils_spec.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/javascripts/ide/stores/utils_spec.js b/spec/javascripts/ide/stores/utils_spec.js
index bceb3a8db91..0fc9519a6bf 100644
--- a/spec/javascripts/ide/stores/utils_spec.js
+++ b/spec/javascripts/ide/stores/utils_spec.js
@@ -261,6 +261,41 @@ describe('Multi-file store utils', () => {
},
]);
});
+
+ it('filters out folders from the list', () => {
+ const files = [
+ {
+ path: 'a',
+ type: 'blob',
+ deleted: true,
+ },
+ {
+ path: 'c',
+ type: 'tree',
+ deleted: true,
+ },
+ {
+ path: 'c/d',
+ type: 'blob',
+ deleted: true,
+ },
+ ];
+
+ const flattendFiles = utils.getCommitFiles(files);
+
+ expect(flattendFiles).toEqual([
+ {
+ path: 'a',
+ type: 'blob',
+ deleted: true,
+ },
+ {
+ path: 'c/d',
+ type: 'blob',
+ deleted: true,
+ },
+ ]);
+ });
});
describe('mergeTrees', () => {