diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-17 10:13:26 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-17 19:18:17 +0300 |
commit | f666026d71ebefd70219d5078b1f0c83fa01f84d (patch) | |
tree | ce43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/groups | |
parent | 5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff) |
Prettify all spec files
Diffstat (limited to 'spec/javascripts/groups')
7 files changed, 31 insertions, 16 deletions
diff --git a/spec/javascripts/groups/components/group_folder_spec.js b/spec/javascripts/groups/components/group_folder_spec.js index 9342c04e4d5..fdfd1b82bd8 100644 --- a/spec/javascripts/groups/components/group_folder_spec.js +++ b/spec/javascripts/groups/components/group_folder_spec.js @@ -18,7 +18,7 @@ const createComponent = (groups = mockGroups, parentGroup = mockParentGroupItem) describe('GroupFolderComponent', () => { let vm; - beforeEach((done) => { + beforeEach(done => { Vue.component('group-item', groupItemComponent); vm = createComponent(); diff --git a/spec/javascripts/groups/components/group_item_spec.js b/spec/javascripts/groups/components/group_item_spec.js index 48e79fd85e4..4d6d0c895b6 100644 --- a/spec/javascripts/groups/components/group_item_spec.js +++ b/spec/javascripts/groups/components/group_item_spec.js @@ -17,7 +17,7 @@ const createComponent = (group = mockParentGroupItem, parentGroup = mockChildren describe('GroupItemComponent', () => { let vm; - beforeEach((done) => { + beforeEach(done => { Vue.component('group-folder', groupFolderComponent); vm = createComponent(); @@ -44,7 +44,7 @@ describe('GroupItemComponent', () => { const { rowClass } = vm; expect(Object.keys(rowClass).length).toBe(classes.length); - Object.keys(rowClass).forEach((className) => { + Object.keys(rowClass).forEach(className => { expect(classes.indexOf(className)).toBeGreaterThan(-1); }); }); @@ -137,7 +137,7 @@ describe('GroupItemComponent', () => { expect(eventHub.$emit).toHaveBeenCalledWith('toggleChildren', vm.group); }); - it('should navigate page to group homepage if group does not have any children present', (done) => { + it('should navigate page to group homepage if group does not have any children present', done => { const group = Object.assign({}, mockParentGroupItem); group.childrenCount = 0; const newVm = createComponent(group); diff --git a/spec/javascripts/groups/components/groups_spec.js b/spec/javascripts/groups/components/groups_spec.js index 0f3907f1ca2..6ba4fe23a69 100644 --- a/spec/javascripts/groups/components/groups_spec.js +++ b/spec/javascripts/groups/components/groups_spec.js @@ -21,7 +21,7 @@ const createComponent = (searchEmpty = false) => { describe('GroupsComponent', () => { let vm; - beforeEach((done) => { + beforeEach(done => { Vue.component('group-folder', groupFolderComponent); Vue.component('group-item', groupItemComponent); @@ -43,13 +43,19 @@ describe('GroupsComponent', () => { vm.change(2); - expect(eventHub.$emit).toHaveBeenCalledWith('fetchPage', 2, jasmine.any(Object), jasmine.any(Object), jasmine.any(Object)); + expect(eventHub.$emit).toHaveBeenCalledWith( + 'fetchPage', + 2, + jasmine.any(Object), + jasmine.any(Object), + jasmine.any(Object), + ); }); }); }); describe('template', () => { - it('should render component template correctly', (done) => { + it('should render component template correctly', done => { Vue.nextTick(() => { expect(vm.$el.querySelector('.groups-list-tree-container')).toBeDefined(); expect(vm.$el.querySelector('.group-list-tree')).toBeDefined(); @@ -59,7 +65,7 @@ describe('GroupsComponent', () => { }); }); - it('should render empty search message when `searchEmpty` is `true`', (done) => { + it('should render empty search message when `searchEmpty` is `true`', done => { vm.searchEmpty = true; Vue.nextTick(() => { expect(vm.$el.querySelector('.has-no-search-results')).toBeDefined(); diff --git a/spec/javascripts/groups/components/item_actions_spec.js b/spec/javascripts/groups/components/item_actions_spec.js index bffeb4acd45..3f66e7fd6f2 100644 --- a/spec/javascripts/groups/components/item_actions_spec.js +++ b/spec/javascripts/groups/components/item_actions_spec.js @@ -31,7 +31,11 @@ describe('ItemActionsComponent', () => { spyOn(eventHub, '$emit'); vm.onLeaveGroup(); - expect(eventHub.$emit).toHaveBeenCalledWith('showLeaveGroupModal', vm.group, vm.parentGroup); + expect(eventHub.$emit).toHaveBeenCalledWith( + 'showLeaveGroupModal', + vm.group, + vm.parentGroup, + ); }); }); }); diff --git a/spec/javascripts/groups/components/item_stats_spec.js b/spec/javascripts/groups/components/item_stats_spec.js index 55a28dfea11..00d6a4817d7 100644 --- a/spec/javascripts/groups/components/item_stats_spec.js +++ b/spec/javascripts/groups/components/item_stats_spec.js @@ -22,7 +22,7 @@ describe('ItemStatsComponent', () => { describe('computed', () => { describe('visibilityIcon', () => { it('should return icon class based on `item.visibility` value', () => { - Object.keys(VISIBILITY_TYPE_ICON).forEach((visibility) => { + Object.keys(VISIBILITY_TYPE_ICON).forEach(visibility => { const item = Object.assign({}, mockParentGroupItem, { visibility }); const vm = createComponent(item); @@ -34,7 +34,7 @@ describe('ItemStatsComponent', () => { describe('visibilityTooltip', () => { it('should return tooltip string for Group based on `item.visibility` value', () => { - Object.keys(GROUP_VISIBILITY_TYPE).forEach((visibility) => { + Object.keys(GROUP_VISIBILITY_TYPE).forEach(visibility => { const item = Object.assign({}, mockParentGroupItem, { visibility, type: ITEM_TYPE.GROUP, @@ -47,7 +47,7 @@ describe('ItemStatsComponent', () => { }); it('should return tooltip string for Project based on `item.visibility` value', () => { - Object.keys(PROJECT_VISIBILITY_TYPE).forEach((visibility) => { + Object.keys(PROJECT_VISIBILITY_TYPE).forEach(visibility => { const item = Object.assign({}, mockParentGroupItem, { visibility, type: ITEM_TYPE.PROJECT, diff --git a/spec/javascripts/groups/mock_data.js b/spec/javascripts/groups/mock_data.js index 8bf6417487d..2fdc844f3d9 100644 --- a/spec/javascripts/groups/mock_data.js +++ b/spec/javascripts/groups/mock_data.js @@ -340,7 +340,8 @@ export const mockSearchedGroups = [ { id: 17, name: 'v4.4', - description: 'Voluptatem qui ea error aperiam veritatis doloremque consequatur temporibus.', + description: + 'Voluptatem qui ea error aperiam veritatis doloremque consequatur temporibus.', visibility: 'public', full_name: 'platform / hardware / bsp / kernel / common / v4.4', relative_path: '/platform/hardware/bsp/kernel/common/v4.4', diff --git a/spec/javascripts/groups/store/groups_store_spec.js b/spec/javascripts/groups/store/groups_store_spec.js index 23324d26cf0..38de4b89f31 100644 --- a/spec/javascripts/groups/store/groups_store_spec.js +++ b/spec/javascripts/groups/store/groups_store_spec.js @@ -1,7 +1,9 @@ import GroupsStore from '~/groups/store/groups_store'; import { - mockGroups, mockSearchedGroups, - mockParentGroupItem, mockRawChildren, + mockGroups, + mockSearchedGroups, + mockParentGroupItem, + mockRawChildren, mockRawPageInfo, } from '../mock_data'; @@ -46,7 +48,9 @@ describe('ProjectsStore', () => { expect(store.state.groups.length).toBe(mockSearchedGroups.length); expect(store.formatGroupItem).toHaveBeenCalledWith(jasmine.any(Object)); expect(Object.keys(store.state.groups[0]).indexOf('fullName')).toBeGreaterThan(-1); - expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName')).toBeGreaterThan(-1); + expect(Object.keys(store.state.groups[0].children[0]).indexOf('fullName')).toBeGreaterThan( + -1, + ); }); }); |