diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2019-06-25 14:42:03 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-06-25 14:42:03 +0300 |
commit | 546355f734f74c040d0ef0917ade50751fd90731 (patch) | |
tree | 1a40935ecb508b52bf8b19114a1e55b4659f0e85 /spec | |
parent | 938db9132245b0b33574ffee3dfcf770aa005620 (diff) | |
parent | 875cba9d99b49ace61a5dfc52b4fe365893f4b37 (diff) |
Merge branch '60860-keep-empty-folders-in-tree' into 'master'
Keep empty folders in the tree list
Closes #60860
See merge request gitlab-org/gitlab-ce!29196
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/ide/stores/actions_spec.js | 27 |
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', () => { |