summaryrefslogtreecommitdiff
path: root/spec/javascripts/ide
diff options
context:
space:
mode:
authorDenys Mishunov <dmishunov@gitlab.com>2019-06-05 12:28:26 +0200
committerDenys Mishunov <dmishunov@gitlab.com>2019-06-25 12:32:35 +0200
commit875cba9d99b49ace61a5dfc52b4fe365893f4b37 (patch)
tree9ea154d55131d2bffd44d6490576aa819f8f5c7e /spec/javascripts/ide
parentb1038a3a8db9960f39812d7c6e3c888e35c4d679 (diff)
downloadgitlab-ce-875cba9d99b49ace61a5dfc52b4fe365893f4b37.tar.gz
Keep empty folders in the tree list
When removing the last file from a folder in WebIDE, do not remove the folder from the view. We keep those to give users possibility to re-upload files to the same folders. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60860
Diffstat (limited to 'spec/javascripts/ide')
-rw-r--r--spec/javascripts/ide/stores/actions_spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/javascripts/ide/stores/actions_spec.js b/spec/javascripts/ide/stores/actions_spec.js
index 37354283cab..537152f5eed 100644
--- a/spec/javascripts/ide/stores/actions_spec.js
+++ b/spec/javascripts/ide/stores/actions_spec.js
@@ -492,6 +492,33 @@ describe('Multi-file store actions', () => {
done,
);
});
+
+ it('does not delete a folder after it is emptied', done => {
+ const testFolder = {
+ type: 'tree',
+ tree: [],
+ };
+ const testEntry = {
+ path: 'testFolder/entry-to-delete',
+ parentPath: 'testFolder',
+ opened: false,
+ tree: [],
+ };
+ testFolder.tree.push(testEntry);
+ store.state.entries = {
+ testFolder,
+ 'testFolder/entry-to-delete': testEntry,
+ };
+
+ testAction(
+ deleteEntry,
+ 'testFolder/entry-to-delete',
+ store.state,
+ [{ type: types.DELETE_ENTRY, payload: 'testFolder/entry-to-delete' }],
+ [{ type: 'burstUnusedSeal' }, { type: 'triggerFilesChange' }],
+ done,
+ );
+ });
});
describe('renameEntry', () => {