diff options
Diffstat (limited to 'spec/javascripts/ide/components/new_dropdown/modal_spec.js')
-rw-r--r-- | spec/javascripts/ide/components/new_dropdown/modal_spec.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/spec/javascripts/ide/components/new_dropdown/modal_spec.js b/spec/javascripts/ide/components/new_dropdown/modal_spec.js index 1a9c96c64da..a6e1e5a0d35 100644 --- a/spec/javascripts/ide/components/new_dropdown/modal_spec.js +++ b/spec/javascripts/ide/components/new_dropdown/modal_spec.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import modal from 'ee/ide/components/new_dropdown/modal.vue'; +import modal from '~/ide/components/new_dropdown/modal.vue'; import createComponent from 'spec/helpers/vue_mount_component_helper'; describe('new file modal component', () => { @@ -10,7 +10,7 @@ describe('new file modal component', () => { vm.$destroy(); }); - ['tree', 'blob'].forEach((type) => { + ['tree', 'blob'].forEach(type => { describe(type, () => { beforeEach(() => { vm = createComponent(Component, { @@ -25,19 +25,25 @@ describe('new file modal component', () => { it(`sets modal title as ${type}`, () => { const title = type === 'tree' ? 'directory' : 'file'; - expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe(`Create new ${title}`); + expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe( + `Create new ${title}`, + ); }); it(`sets button label as ${type}`, () => { const title = type === 'tree' ? 'directory' : 'file'; - expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe(`Create ${title}`); + expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe( + `Create ${title}`, + ); }); it(`sets form label as ${type}`, () => { const title = type === 'tree' ? 'Directory' : 'File'; - expect(vm.$el.querySelector('.label-light').textContent.trim()).toBe(`${title} name`); + expect(vm.$el.querySelector('.label-light').textContent.trim()).toBe( + `${title} name`, + ); }); describe('createEntryInStore', () => { @@ -59,11 +65,15 @@ describe('new file modal component', () => { it('focuses field on mount', () => { document.body.innerHTML += '<div class="js-test"></div>'; - vm = createComponent(Component, { - type: 'tree', - branchId: 'master', - path: '', - }, '.js-test'); + vm = createComponent( + Component, + { + type: 'tree', + branchId: 'master', + path: '', + }, + '.js-test', + ); expect(document.activeElement).toBe(vm.$refs.fieldName); |