diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 19:58:23 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 19:58:23 +0000 |
commit | 09432c7f561449734e2ae298496dc0f1d7da0d6a (patch) | |
tree | b444ddf7f6f8d25aa1af899f9c1f9a41feafaec7 /spec/javascripts | |
parent | e2aba30891c3deff4174df08b92817095eec38d5 (diff) | |
download | gitlab-ce-09432c7f561449734e2ae298496dc0f1d7da0d6a.tar.gz |
Add latest changes from gitlab-org/gitlab@12-8-stable-ee
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/vue_shared/components/file_row_spec.js | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/spec/javascripts/vue_shared/components/file_row_spec.js b/spec/javascripts/vue_shared/components/file_row_spec.js deleted file mode 100644 index 11fcb9b89c1..00000000000 --- a/spec/javascripts/vue_shared/components/file_row_spec.js +++ /dev/null @@ -1,87 +0,0 @@ -import Vue from 'vue'; -import { file } from 'spec/ide/helpers'; -import FileRow from '~/vue_shared/components/file_row.vue'; -import mountComponent from '../../helpers/vue_mount_component_helper'; - -describe('File row component', () => { - let vm; - - function createComponent(propsData) { - const FileRowComponent = Vue.extend(FileRow); - - vm = mountComponent(FileRowComponent, propsData); - } - - afterEach(() => { - vm.$destroy(); - }); - - it('renders name', () => { - createComponent({ - file: file('t4'), - level: 0, - }); - - const name = vm.$el.querySelector('.file-row-name'); - - expect(name.textContent.trim()).toEqual(vm.file.name); - }); - - it('emits toggleTreeOpen on click', () => { - createComponent({ - file: { - ...file('t3'), - type: 'tree', - }, - level: 0, - }); - spyOn(vm, '$emit').and.stub(); - - vm.$el.click(); - - expect(vm.$emit).toHaveBeenCalledWith('toggleTreeOpen', vm.file.path); - }); - - it('calls scrollIntoView if made active', done => { - createComponent({ - file: { - ...file(), - type: 'blob', - active: false, - }, - level: 0, - }); - - spyOn(vm, 'scrollIntoView').and.stub(); - - vm.file.active = true; - - vm.$nextTick(() => { - expect(vm.scrollIntoView).toHaveBeenCalled(); - - done(); - }); - }); - - it('indents row based on level', () => { - createComponent({ - file: file('t4'), - level: 2, - }); - - expect(vm.$el.querySelector('.file-row-name').style.marginLeft).toBe('32px'); - }); - - it('renders header for file', () => { - createComponent({ - file: { - isHeader: true, - path: 'app/assets', - tree: [], - }, - level: 0, - }); - - expect(vm.$el.classList).toContain('js-file-row-header'); - }); -}); |