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:
authorPhil Hughes <me@iamphill.com>2018-07-25 13:02:40 +0300
committerPhil Hughes <me@iamphill.com>2018-07-30 13:45:14 +0300
commit377afd65d158eca8dd6b875e50e20e76b6117507 (patch)
treea224321ae292ec2984008e702f27b5d1fc85d649 /spec/javascripts
parent2ca8219a20f16636b7a0ffa899a1a04ab8e84782 (diff)
Enable renaming files & folders in the Web IDE
Closes #44845
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/ide/components/new_dropdown/modal_spec.js34
1 files changed, 33 insertions, 1 deletions
diff --git a/spec/javascripts/ide/components/new_dropdown/modal_spec.js b/spec/javascripts/ide/components/new_dropdown/modal_spec.js
index 70651535e87..ed9b3cd8a29 100644
--- a/spec/javascripts/ide/components/new_dropdown/modal_spec.js
+++ b/spec/javascripts/ide/components/new_dropdown/modal_spec.js
@@ -15,7 +15,7 @@ describe('new file modal component', () => {
describe(type, () => {
beforeEach(() => {
const store = createStore();
- store.state.newEntryModal = {
+ store.state.entryModal = {
type,
path: '',
};
@@ -55,4 +55,36 @@ describe('new file modal component', () => {
});
});
});
+
+ describe('rename entry', () => {
+ beforeEach(() => {
+ const store = createStore();
+ store.state.entryModal = {
+ type: 'rename',
+ path: '',
+ entry: {
+ name: 'test',
+ },
+ };
+
+ vm = createComponentWithStore(Component, store).$mount();
+ });
+
+ it('renders title and button for renaming', () => {
+ expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe('Rename');
+ expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe('Update');
+ });
+
+ describe('entryName', () => {
+ it('returns entries name', () => {
+ expect(vm.entryName).toBe('test');
+ });
+
+ it('updated name', () => {
+ vm.name = 'index.js';
+
+ expect(vm.entryName).toBe('index.js');
+ });
+ });
+ });
});