Commit e94556e9 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 32 files - 59 of 73

Part of our prettier migration; changing the arrow-parens style.
parent dc6c2412
...@@ -1887,40 +1887,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js ...@@ -1887,40 +1887,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.js spec/frontend/helpers/wait_for_promises.js
spec/frontend/helpers/wait_using_real_timer.js spec/frontend/helpers/wait_using_real_timer.js
## condescending-haslett
spec/frontend/ide/components/activity_bar_spec.js
spec/frontend/ide/components/branches/search_list_spec.js
spec/frontend/ide/components/commit_sidebar/actions_spec.js
spec/frontend/ide/components/commit_sidebar/list_item_spec.js
spec/frontend/ide/components/commit_sidebar/list_spec.js
spec/frontend/ide/components/commit_sidebar/message_field_spec.js
spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js
spec/frontend/ide/components/commit_sidebar/radio_group_spec.js
spec/frontend/ide/components/commit_sidebar/success_message_spec.js
spec/frontend/ide/components/error_message_spec.js
spec/frontend/ide/components/file_row_extra_spec.js
spec/frontend/ide/components/file_templates/bar_spec.js
spec/frontend/ide/components/file_templates/dropdown_spec.js
spec/frontend/ide/components/ide_sidebar_nav_spec.js
spec/frontend/ide/components/ide_spec.js
spec/frontend/ide/components/ide_status_bar_spec.js
spec/frontend/ide/components/ide_status_mr_spec.js
spec/frontend/ide/components/ide_tree_list_spec.js
spec/frontend/ide/components/jobs/detail/scroll_button_spec.js
spec/frontend/ide/components/jobs/detail_spec.js
spec/frontend/ide/components/jobs/item_spec.js
spec/frontend/ide/components/jobs/list_spec.js
spec/frontend/ide/components/jobs/stage_spec.js
spec/frontend/ide/components/merge_requests/list_spec.js
spec/frontend/ide/components/nav_dropdown_button_spec.js
spec/frontend/ide/components/nav_dropdown_spec.js
spec/frontend/ide/components/new_dropdown/button_spec.js
spec/frontend/ide/components/new_dropdown/index_spec.js
spec/frontend/ide/components/new_dropdown/modal_spec.js
spec/frontend/ide/components/new_dropdown/upload_spec.js
spec/frontend/ide/components/panes/collapsible_sidebar_spec.js
spec/frontend/ide/components/panes/right_spec.js
## jovial-mirzakhani ## jovial-mirzakhani
spec/frontend/ide/components/repo_commit_section_spec.js spec/frontend/ide/components/repo_commit_section_spec.js
spec/frontend/ide/components/repo_editor_spec.js spec/frontend/ide/components/repo_editor_spec.js
......
...@@ -59,7 +59,7 @@ describe('IDE activity bar', () => { ...@@ -59,7 +59,7 @@ describe('IDE activity bar', () => {
expect(vm.$el.querySelector('.js-ide-edit-mode').classList).toContain('active'); expect(vm.$el.querySelector('.js-ide-edit-mode').classList).toContain('active');
}); });
it('sets commit item active', done => { it('sets commit item active', (done) => {
vm.$store.state.currentActivityView = leftSidebarViews.commit.name; vm.$store.state.currentActivityView = leftSidebarViews.commit.name;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -71,7 +71,7 @@ describe('IDE branches search list', () => { ...@@ -71,7 +71,7 @@ describe('IDE branches search list', () => {
it('renders check next to active branch', () => { it('renders check next to active branch', () => {
const activeBranch = 'regular'; const activeBranch = 'regular';
createComponent({ branches }, activeBranch); createComponent({ branches }, activeBranch);
const items = wrapper.findAll(Item).filter(w => w.props('isActive')); const items = wrapper.findAll(Item).filter((w) => w.props('isActive'));
expect(items.length).toBe(1); expect(items.length).toBe(1);
expect(items.at(0).props('item').name).toBe(activeBranch); expect(items.at(0).props('item').name).toBe(activeBranch);
......
...@@ -30,7 +30,7 @@ describe('IDE commit sidebar actions', () => { ...@@ -30,7 +30,7 @@ describe('IDE commit sidebar actions', () => {
vm.$store.state.currentProjectId = 'abcproject'; vm.$store.state.currentProjectId = 'abcproject';
const proj = { ...projectData }; const proj = { ...projectData };
proj.branches[currentBranchId] = branches.find(branch => branch.name === currentBranchId); proj.branches[currentBranchId] = branches.find((branch) => branch.name === currentBranchId);
proj.empty_repo = emptyRepo; proj.empty_repo = emptyRepo;
Vue.set(vm.$store.state.projects, 'abcproject', proj); Vue.set(vm.$store.state.projects, 'abcproject', proj);
...@@ -72,7 +72,7 @@ describe('IDE commit sidebar actions', () => { ...@@ -72,7 +72,7 @@ describe('IDE commit sidebar actions', () => {
expect(findText()).toContain('Commit to master branch'); expect(findText()).toContain('Commit to master branch');
}); });
it('hides merge request option when project merge requests are disabled', done => { it('hides merge request option when project merge requests are disabled', (done) => {
createComponent({ hasMR: false }); createComponent({ hasMR: false });
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -106,7 +106,7 @@ describe('IDE commit sidebar actions', () => { ...@@ -106,7 +106,7 @@ describe('IDE commit sidebar actions', () => {
expect(vm.$store.dispatch).not.toHaveBeenCalled(); expect(vm.$store.dispatch).not.toHaveBeenCalled();
}); });
it('calls again after staged changes', done => { it('calls again after staged changes', (done) => {
createComponent({ currentBranchId: null }); createComponent({ currentBranchId: null });
vm.$store.state.currentBranchId = 'master'; vm.$store.state.currentBranchId = 'master';
......
...@@ -41,7 +41,7 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -41,7 +41,7 @@ describe('Multi-file editor commit sidebar list item', () => {
expect(findPathText()).toContain(f.path); expect(findPathText()).toContain(f.path);
}); });
it('correctly renders renamed entries', done => { it('correctly renders renamed entries', (done) => {
Vue.set(vm.file, 'prevName', 'Old name'); Vue.set(vm.file, 'prevName', 'Old name');
vm.$nextTick() vm.$nextTick()
...@@ -52,7 +52,7 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -52,7 +52,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('correctly renders entry, the name of which did not change after rename (as within a folder)', done => { it('correctly renders entry, the name of which did not change after rename (as within a folder)', (done) => {
Vue.set(vm.file, 'prevName', f.name); Vue.set(vm.file, 'prevName', f.name);
vm.$nextTick() vm.$nextTick()
...@@ -63,7 +63,7 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -63,7 +63,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('opens a closed file in the editor when clicking the file path', done => { it('opens a closed file in the editor when clicking the file path', (done) => {
jest.spyOn(vm, 'openPendingTab'); jest.spyOn(vm, 'openPendingTab');
jest.spyOn(router, 'push').mockImplementation(() => {}); jest.spyOn(router, 'push').mockImplementation(() => {});
...@@ -77,7 +77,7 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -77,7 +77,7 @@ describe('Multi-file editor commit sidebar list item', () => {
}); });
}); });
it('calls updateViewer with diff when clicking file', done => { it('calls updateViewer with diff when clicking file', (done) => {
jest.spyOn(vm, 'openFileInEditor'); jest.spyOn(vm, 'openFileInEditor');
jest.spyOn(vm, 'updateViewer'); jest.spyOn(vm, 'updateViewer');
jest.spyOn(router, 'push').mockImplementation(() => {}); jest.spyOn(router, 'push').mockImplementation(() => {});
...@@ -134,7 +134,7 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -134,7 +134,7 @@ describe('Multi-file editor commit sidebar list item', () => {
expect(vm.$el.querySelector('.is-active')).toBe(null); expect(vm.$el.querySelector('.is-active')).toBe(null);
}); });
it('adds active class when keys match', done => { it('adds active class when keys match', (done) => {
vm.keyPrefix = 'staged'; vm.keyPrefix = 'staged';
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -31,7 +31,7 @@ describe('Multi-file editor commit sidebar list', () => { ...@@ -31,7 +31,7 @@ describe('Multi-file editor commit sidebar list', () => {
}); });
describe('with a list of files', () => { describe('with a list of files', () => {
beforeEach(done => { beforeEach((done) => {
const f = file('file name'); const f = file('file name');
f.changed = true; f.changed = true;
vm.fileList.push(f); vm.fileList.push(f);
......
...@@ -23,7 +23,7 @@ describe('IDE commit message field', () => { ...@@ -23,7 +23,7 @@ describe('IDE commit message field', () => {
vm.$destroy(); vm.$destroy();
}); });
it('adds is-focused class on focus', done => { it('adds is-focused class on focus', (done) => {
vm.$el.querySelector('textarea').focus(); vm.$el.querySelector('textarea').focus();
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -33,7 +33,7 @@ describe('IDE commit message field', () => { ...@@ -33,7 +33,7 @@ describe('IDE commit message field', () => {
}); });
}); });
it('removed is-focused class on blur', done => { it('removed is-focused class on blur', (done) => {
vm.$el.querySelector('textarea').focus(); vm.$el.querySelector('textarea').focus();
vm.$nextTick() vm.$nextTick()
...@@ -66,7 +66,7 @@ describe('IDE commit message field', () => { ...@@ -66,7 +66,7 @@ describe('IDE commit message field', () => {
describe('highlights', () => { describe('highlights', () => {
describe('subject line', () => { describe('subject line', () => {
it('does not highlight less than 50 characters', done => { it('does not highlight less than 50 characters', (done) => {
vm.text = 'text less than 50 chars'; vm.text = 'text less than 50 chars';
vm.$nextTick() vm.$nextTick()
...@@ -81,7 +81,7 @@ describe('IDE commit message field', () => { ...@@ -81,7 +81,7 @@ describe('IDE commit message field', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('highlights characters over 50 length', done => { it('highlights characters over 50 length', (done) => {
vm.text = vm.text =
'text less than 50 chars that should not highlighted. text more than 50 should be highlighted'; 'text less than 50 chars that should not highlighted. text more than 50 should be highlighted';
...@@ -102,7 +102,7 @@ describe('IDE commit message field', () => { ...@@ -102,7 +102,7 @@ describe('IDE commit message field', () => {
}); });
describe('body text', () => { describe('body text', () => {
it('does not highlight body text less tan 72 characters', done => { it('does not highlight body text less tan 72 characters', (done) => {
vm.text = 'subject line\nbody content'; vm.text = 'subject line\nbody content';
vm.$nextTick() vm.$nextTick()
...@@ -114,7 +114,7 @@ describe('IDE commit message field', () => { ...@@ -114,7 +114,7 @@ describe('IDE commit message field', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('highlights body text more than 72 characters', done => { it('highlights body text more than 72 characters', (done) => {
vm.text = vm.text =
'subject line\nbody content that will be highlighted when it is more than 72 characters in length'; 'subject line\nbody content that will be highlighted when it is more than 72 characters in length';
...@@ -128,7 +128,7 @@ describe('IDE commit message field', () => { ...@@ -128,7 +128,7 @@ describe('IDE commit message field', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('highlights body text & subject line', done => { it('highlights body text & subject line', (done) => {
vm.text = vm.text =
'text less than 50 chars that should not highlighted\nbody content that will be highlighted when it is more than 72 characters in length'; 'text less than 50 chars that should not highlighted\nbody content that will be highlighted when it is more than 72 characters in length';
...@@ -147,7 +147,7 @@ describe('IDE commit message field', () => { ...@@ -147,7 +147,7 @@ describe('IDE commit message field', () => {
}); });
describe('scrolling textarea', () => { describe('scrolling textarea', () => {
it('updates transform of highlights', done => { it('updates transform of highlights', (done) => {
vm.text = 'subject line\n\n\n\n\n\n\n\n\n\n\nbody content'; vm.text = 'subject line\n\n\n\n\n\n\n\n\n\n\nbody content';
vm.$nextTick() vm.$nextTick()
......
...@@ -17,7 +17,7 @@ describe('create new MR checkbox', () => { ...@@ -17,7 +17,7 @@ describe('create new MR checkbox', () => {
] = { foo: 'bar' }; ] = { foo: 'bar' };
}; };
const setPermissions = permissions => { const setPermissions = (permissions) => {
store.state.projects[store.state.currentProjectId].userPermissions = permissions; store.state.projects[store.state.currentProjectId].userPermissions = permissions;
}; };
...@@ -33,7 +33,7 @@ describe('create new MR checkbox', () => { ...@@ -33,7 +33,7 @@ describe('create new MR checkbox', () => {
vm.$store.state.currentBranchId = currentBranchId; vm.$store.state.currentBranchId = currentBranchId;
store.state.projects.abcproject.branches[currentBranchId] = branches.find( store.state.projects.abcproject.branches[currentBranchId] = branches.find(
branch => branch.name === currentBranchId, (branch) => branch.name === currentBranchId,
); );
return vm.$mount(); return vm.$mount();
...@@ -69,7 +69,7 @@ describe('create new MR checkbox', () => { ...@@ -69,7 +69,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe(''); expect(vm.$el.textContent).not.toBe('');
}); });
it('has new MR', done => { it('has new MR', (done) => {
setMR(); setMR();
vm.$nextTick() vm.$nextTick()
...@@ -93,7 +93,7 @@ describe('create new MR checkbox', () => { ...@@ -93,7 +93,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).toBe(''); expect(vm.$el.textContent).toBe('');
}); });
it('has new MR', done => { it('has new MR', (done) => {
setMR(); setMR();
vm.$nextTick() vm.$nextTick()
...@@ -118,7 +118,7 @@ describe('create new MR checkbox', () => { ...@@ -118,7 +118,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe(''); expect(vm.$el.textContent).not.toBe('');
}); });
it('is rendered if MR exists', done => { it('is rendered if MR exists', (done) => {
setMR(); setMR();
vm.$nextTick() vm.$nextTick()
...@@ -141,7 +141,7 @@ describe('create new MR checkbox', () => { ...@@ -141,7 +141,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe(''); expect(vm.$el.textContent).not.toBe('');
}); });
it('is hidden if MR exists', done => { it('is hidden if MR exists', (done) => {
setMR(); setMR();
vm.$nextTick() vm.$nextTick()
...@@ -165,7 +165,7 @@ describe('create new MR checkbox', () => { ...@@ -165,7 +165,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe(''); expect(vm.$el.textContent).not.toBe('');
}); });
it('is hidden if MR exists', done => { it('is hidden if MR exists', (done) => {
setMR(); setMR();
vm.$nextTick() vm.$nextTick()
......
...@@ -7,7 +7,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -7,7 +7,7 @@ describe('IDE commit sidebar radio group', () => {
let vm; let vm;
let store; let store;
beforeEach(done => { beforeEach((done) => {
store = createStore(); store = createStore();
const Component = Vue.extend(radioGroup); const Component = Vue.extend(radioGroup);
...@@ -33,7 +33,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -33,7 +33,7 @@ describe('IDE commit sidebar radio group', () => {
expect(vm.$el.textContent).toContain('test'); expect(vm.$el.textContent).toContain('test');
}); });
it('uses slot if label is not present', done => { it('uses slot if label is not present', (done) => {
vm.$destroy(); vm.$destroy();
vm = new Vue({ vm = new Vue({
...@@ -41,7 +41,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -41,7 +41,7 @@ describe('IDE commit sidebar radio group', () => {
radioGroup, radioGroup,
}, },
store, store,
render: createElement => render: (createElement) =>
createElement('radio-group', { props: { value: '1' } }, 'Testing slot'), createElement('radio-group', { props: { value: '1' } }, 'Testing slot'),
}); });
...@@ -54,7 +54,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -54,7 +54,7 @@ describe('IDE commit sidebar radio group', () => {
}); });
}); });
it('updates store when changing radio button', done => { it('updates store when changing radio button', (done) => {
vm.$el.querySelector('input').dispatchEvent(new Event('change')); vm.$el.querySelector('input').dispatchEvent(new Event('change'));
Vue.nextTick(() => { Vue.nextTick(() => {
...@@ -65,7 +65,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -65,7 +65,7 @@ describe('IDE commit sidebar radio group', () => {
}); });
describe('with input', () => { describe('with input', () => {
beforeEach(done => { beforeEach((done) => {
vm.$destroy(); vm.$destroy();
const Component = Vue.extend(radioGroup); const Component = Vue.extend(radioGroup);
...@@ -89,7 +89,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -89,7 +89,7 @@ describe('IDE commit sidebar radio group', () => {
expect(vm.$el.querySelector('.form-control')).not.toBeNull(); expect(vm.$el.querySelector('.form-control')).not.toBeNull();
}); });
it('hides input when commitAction doesnt match value', done => { it('hides input when commitAction doesnt match value', (done) => {
store.state.commit.commitAction = '2'; store.state.commit.commitAction = '2';
Vue.nextTick(() => { Vue.nextTick(() => {
...@@ -98,7 +98,7 @@ describe('IDE commit sidebar radio group', () => { ...@@ -98,7 +98,7 @@ describe('IDE commit sidebar radio group', () => {
}); });
}); });
it('updates branch name in store on input', done => { it('updates branch name in store on input', (done) => {
const input = vm.$el.querySelector('.form-control'); const input = vm.$el.querySelector('.form-control');
input.value = 'testing-123'; input.value = 'testing-123';
input.dispatchEvent(new Event('input')); input.dispatchEvent(new Event('input'));
......
...@@ -23,7 +23,7 @@ describe('IDE commit panel successful commit state', () => { ...@@ -23,7 +23,7 @@ describe('IDE commit panel successful commit state', () => {
vm.$destroy(); vm.$destroy();
}); });
it('renders last commit message when it exists', done => { it('renders last commit message when it exists', (done) => {
vm.$store.state.lastCommitMsg = 'testing commit message'; vm.$store.state.lastCommitMsg = 'testing commit message';
Vue.nextTick(() => { Vue.nextTick(() => {
......
...@@ -10,7 +10,7 @@ describe('IDE error message component', () => { ...@@ -10,7 +10,7 @@ describe('IDE error message component', () => {
let wrapper; let wrapper;
const setErrorMessageMock = jest.fn(); const setErrorMessageMock = jest.fn();
const createComponent = messageProps => { const createComponent = (messageProps) => {
const fakeStore = new Vuex.Store({ const fakeStore = new Vuex.Store({
actions: { setErrorMessage: setErrorMessageMock }, actions: { setErrorMessage: setErrorMessageMock },
}); });
...@@ -103,7 +103,7 @@ describe('IDE error message component', () => { ...@@ -103,7 +103,7 @@ describe('IDE error message component', () => {
let resolveAction; let resolveAction;
actionMock.mockImplementation( actionMock.mockImplementation(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolveAction = resolve; resolveAction = resolve;
}), }),
); );
......
...@@ -70,7 +70,7 @@ describe('IDE extra file row component', () => { ...@@ -70,7 +70,7 @@ describe('IDE extra file row component', () => {
expect(vm.$el.querySelector('.ide-tree-changes')).toBe(null); expect(vm.$el.querySelector('.ide-tree-changes')).toBe(null);
}); });
it('does not show when tree is open', done => { it('does not show when tree is open', (done) => {
vm.file.type = 'tree'; vm.file.type = 'tree';
vm.file.opened = true; vm.file.opened = true;
changesCount = 1; changesCount = 1;
...@@ -82,7 +82,7 @@ describe('IDE extra file row component', () => { ...@@ -82,7 +82,7 @@ describe('IDE extra file row component', () => {
}); });
}); });
it('shows for trees with changes', done => { it('shows for trees with changes', (done) => {
vm.file.type = 'tree'; vm.file.type = 'tree';
vm.file.opened = false; vm.file.opened = false;
changesCount = 1; changesCount = 1;
...@@ -100,7 +100,7 @@ describe('IDE extra file row component', () => { ...@@ -100,7 +100,7 @@ describe('IDE extra file row component', () => {
expect(vm.$el.querySelector('.file-changed-icon')).toBe(null); expect(vm.$el.querySelector('.file-changed-icon')).toBe(null);
}); });
it('shows when file is changed', done => { it('shows when file is changed', (done) => {
vm.file.changed = true; vm.file.changed = true;
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -110,7 +110,7 @@ describe('IDE extra file row component', () => { ...@@ -110,7 +110,7 @@ describe('IDE extra file row component', () => {
}); });
}); });
it('shows when file is staged', done => { it('shows when file is staged', (done) => {
vm.file.staged = true; vm.file.staged = true;
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -120,7 +120,7 @@ describe('IDE extra file row component', () => { ...@@ -120,7 +120,7 @@ describe('IDE extra file row component', () => {
}); });
}); });
it('shows when file is a tempFile', done => { it('shows when file is a tempFile', (done) => {
vm.file.tempFile = true; vm.file.tempFile = true;
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -130,7 +130,7 @@ describe('IDE extra file row component', () => { ...@@ -130,7 +130,7 @@ describe('IDE extra file row component', () => {
}); });
}); });
it('shows when file is renamed', done => { it('shows when file is renamed', (done) => {
vm.file.prevPath = 'original-file'; vm.file.prevPath = 'original-file';
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -140,7 +140,7 @@ describe('IDE extra file row component', () => { ...@@ -140,7 +140,7 @@ describe('IDE extra file row component', () => {
}); });
}); });
it('hides when file is renamed', done => { it('hides when file is renamed', (done) => {
vm.file.prevPath = 'original-file'; vm.file.prevPath = 'original-file';
vm.file.type = 'tree'; vm.file.type = 'tree';
...@@ -157,7 +157,7 @@ describe('IDE extra file row component', () => { ...@@ -157,7 +157,7 @@ describe('IDE extra file row component', () => {
expect(vm.$el.querySelector('[data-testid="git-merge-icon"]')).toBe(null); expect(vm.$el.querySelector('[data-testid="git-merge-icon"]')).toBe(null);
}); });
it('shows when a merge request change', done => { it('shows when a merge request change', (done) => {
vm.file.mrChange = true; vm.file.mrChange = true;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -46,7 +46,7 @@ describe('IDE file templates bar component', () => { ...@@ -46,7 +46,7 @@ describe('IDE file templates bar component', () => {
}); });
describe('template dropdown', () => { describe('template dropdown', () => {
beforeEach(done => { beforeEach((done) => {
vm.$store.state.fileTemplates.templates = [ vm.$store.state.fileTemplates.templates = [
{ {
name: 'test', name: 'test',
...@@ -75,7 +75,7 @@ describe('IDE file templates bar component', () => { ...@@ -75,7 +75,7 @@ describe('IDE file templates bar component', () => {
}); });
}); });
it('shows undo button if updateSuccess is true', done => { it('shows undo button if updateSuccess is true', (done) => {
vm.$store.state.fileTemplates.updateSuccess = true; vm.$store.state.fileTemplates.updateSuccess = true;
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -93,7 +93,7 @@ describe('IDE file templates bar component', () => { ...@@ -93,7 +93,7 @@ describe('IDE file templates bar component', () => {
expect(vm.undoFileTemplate).toHaveBeenCalled(); expect(vm.undoFileTemplate).toHaveBeenCalled();
}); });
it('calls setSelectedTemplateType if activeFile name matches a template', done => { it('calls setSelectedTemplateType if activeFile name matches a template', (done) => {
const fileName = '.gitlab-ci.yml'; const fileName = '.gitlab-ci.yml';
jest.spyOn(vm, 'setSelectedTemplateType').mockImplementation(() => {}); jest.spyOn(vm, 'setSelectedTemplateType').mockImplementation(() => {});
......
...@@ -109,7 +109,7 @@ describe('IDE file templates dropdown component', () => { ...@@ -109,7 +109,7 @@ describe('IDE file templates dropdown component', () => {
}); });
const items = findItemButtons(); const items = findItemButtons();
expect(items.wrappers.map(x => x.text())).toEqual(templates.map(x => x.name)); expect(items.wrappers.map((x) => x.text())).toEqual(templates.map((x) => x.name));
}); });
it('searches template data', () => { it('searches template data', () => {
...@@ -124,7 +124,7 @@ describe('IDE file templates dropdown component', () => { ...@@ -124,7 +124,7 @@ describe('IDE file templates dropdown component', () => {
const items = findItemButtons(); const items = findItemButtons();
expect(items.length).toBe(matches.length); expect(items.length).toBe(matches.length);
expect(items.wrappers.map(x => x.text())).toEqual(matches); expect(items.wrappers.map((x) => x.text())).toEqual(matches);
}); });
}); });
...@@ -151,7 +151,7 @@ describe('IDE file templates dropdown component', () => { ...@@ -151,7 +151,7 @@ describe('IDE file templates dropdown component', () => {
const items = findItemButtons(); const items = findItemButtons();
expect(items.length).toBe(data.length); expect(items.length).toBe(data.length);
expect(items.wrappers.map(x => x.text())).toEqual(data.map(x => x.name)); expect(items.wrappers.map((x) => x.text())).toEqual(data.map((x) => x.name));
}); });
it('renders input when `searchable` is true', () => { it('renders input when `searchable` is true', () => {
...@@ -169,7 +169,7 @@ describe('IDE file templates dropdown component', () => { ...@@ -169,7 +169,7 @@ describe('IDE file templates dropdown component', () => {
const items = findItemButtons(); const items = findItemButtons();
expect(items.length).toBe(matches.length); expect(items.length).toBe(matches.length);
expect(items.wrappers.map(x => x.text())).toEqual(matches); expect(items.wrappers.map((x) => x.text())).toEqual(matches);
}); });
}); });
}); });
......
...@@ -48,7 +48,7 @@ describe('ide/components/ide_sidebar_nav', () => { ...@@ -48,7 +48,7 @@ describe('ide/components/ide_sidebar_nav', () => {
const findButtons = () => wrapper.findAll('li button'); const findButtons = () => wrapper.findAll('li button');
const findButtonsData = () => const findButtonsData = () =>
findButtons().wrappers.map(button => { findButtons().wrappers.map((button) => {
return { return {
title: button.attributes('title'), title: button.attributes('title'),
ariaLabel: button.attributes('aria-label'), ariaLabel: button.attributes('aria-label'),
......
...@@ -25,7 +25,7 @@ describe('WebIDE', () => { ...@@ -25,7 +25,7 @@ describe('WebIDE', () => {
tree: [], tree: [],
loading: false, loading: false,
}; };
Object.keys(state).forEach(key => { Object.keys(state).forEach((key) => {
store.state[key] = state[key]; store.state[key] = state[key];
}); });
......
...@@ -73,7 +73,7 @@ describe('ideStatusBar', () => { ...@@ -73,7 +73,7 @@ describe('ideStatusBar', () => {
}); });
describe('pipeline status', () => { describe('pipeline status', () => {
it('opens right sidebar on clicking icon', done => { it('opens right sidebar on clicking icon', (done) => {
jest.spyOn(vm, 'openRightPane').mockImplementation(() => {}); jest.spyOn(vm, 'openRightPane').mockImplementation(() => {});
Vue.set(vm.$store.state.pipelines, 'latestPipeline', { Vue.set(vm.$store.state.pipelines, 'latestPipeline', {
details: { details: {
......
...@@ -9,7 +9,7 @@ const TEST_URL = `${TEST_HOST}merge-requests/9001`; ...@@ -9,7 +9,7 @@ const TEST_URL = `${TEST_HOST}merge-requests/9001`;
describe('ide/components/ide_status_mr', () => { describe('ide/components/ide_status_mr', () => {
let wrapper; let wrapper;
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(IdeStatusMr, { wrapper = shallowMount(IdeStatusMr, {
propsData: props, propsData: props,
}); });
......
...@@ -41,7 +41,7 @@ describe('IDE tree list', () => { ...@@ -41,7 +41,7 @@ describe('IDE tree list', () => {
vm.$mount(); vm.$mount();
}); });
it('renders loading indicator', done => { it('renders loading indicator', (done) => {
store.state.trees['abcproject/master'].loading = true; store.state.trees['abcproject/master'].loading = true;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -5,7 +5,7 @@ import ScrollButton from '~/ide/components/jobs/detail/scroll_button.vue'; ...@@ -5,7 +5,7 @@ import ScrollButton from '~/ide/components/jobs/detail/scroll_button.vue';
describe('IDE job log scroll button', () => { describe('IDE job log scroll button', () => {
let wrapper; let wrapper;
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(ScrollButton, { wrapper = shallowMount(ScrollButton, {
propsData: { propsData: {
direction: 'up', direction: 'up',
......
...@@ -48,7 +48,7 @@ describe('IDE jobs detail view', () => { ...@@ -48,7 +48,7 @@ describe('IDE jobs detail view', () => {
expect(vm.$el.querySelector('.bash').textContent).toContain('testing'); expect(vm.$el.querySelector('.bash').textContent).toContain('testing');
}); });
it('renders empty message output', done => { it('renders empty message output', (done) => {
vm.$store.state.pipelines.detailJob.output = ''; vm.$store.state.pipelines.detailJob.output = '';
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -68,7 +68,7 @@ describe('IDE jobs detail view', () => { ...@@ -68,7 +68,7 @@ describe('IDE jobs detail view', () => {
expect(vm.$el.querySelector('.bash').style.display).toBe('none'); expect(vm.$el.querySelector('.bash').style.display).toBe('none');
}); });
it('hide loading icon when isLoading is false', done => { it('hide loading icon when isLoading is false', (done) => {
vm.$store.state.pipelines.detailJob.isLoading = false; vm.$store.state.pipelines.detailJob.isLoading = false;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -27,7 +27,7 @@ describe('IDE jobs item', () => { ...@@ -27,7 +27,7 @@ describe('IDE jobs item', () => {
expect(vm.$el.querySelector('[data-testid="status_success_borderless-icon"]')).not.toBe(null); expect(vm.$el.querySelector('[data-testid="status_success_borderless-icon"]')).not.toBe(null);
}); });
it('does not render view logs button if not started', done => { it('does not render view logs button if not started', (done) => {
vm.job.started = false; vm.job.started = false;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -36,7 +36,7 @@ describe('IDE stages list', () => { ...@@ -36,7 +36,7 @@ describe('IDE stages list', () => {
status: { icon: 'status_success' }, status: { icon: 'status_success' },
})); }));
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(StageList, { wrapper = shallowMount(StageList, {
propsData: { propsData: {
...defaultProps, ...defaultProps,
...@@ -48,7 +48,7 @@ describe('IDE stages list', () => { ...@@ -48,7 +48,7 @@ describe('IDE stages list', () => {
}; };
afterEach(() => { afterEach(() => {
Object.values(storeActions).forEach(actionMock => actionMock.mockClear()); Object.values(storeActions).forEach((actionMock) => actionMock.mockClear());
}); });
afterAll(() => { afterAll(() => {
......
...@@ -20,7 +20,7 @@ describe('IDE pipeline stage', () => { ...@@ -20,7 +20,7 @@ describe('IDE pipeline stage', () => {
const findHeader = () => wrapper.find({ ref: 'cardHeader' }); const findHeader = () => wrapper.find({ ref: 'cardHeader' });
const findJobList = () => wrapper.find({ ref: 'jobList' }); const findJobList = () => wrapper.find({ ref: 'jobList' });
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(Stage, { wrapper = shallowMount(Stage, {
propsData: { propsData: {
...defaultProps, ...defaultProps,
......
...@@ -151,8 +151,8 @@ describe('IDE merge requests list', () => { ...@@ -151,8 +151,8 @@ describe('IDE merge requests list', () => {
it('shows search types', () => { it('shows search types', () => {
const buttons = findSearchTypeButtons(); const buttons = findSearchTypeButtons();
expect(buttons.wrappers.map(x => x.text().trim())).toEqual( expect(buttons.wrappers.map((x) => x.text().trim())).toEqual(
wrapper.vm.$options.searchTypes.map(x => x.label), wrapper.vm.$options.searchTypes.map((x) => x.label),
); );
}); });
......
...@@ -23,7 +23,7 @@ describe('NavDropdown', () => { ...@@ -23,7 +23,7 @@ describe('NavDropdown', () => {
vm.$mount(); vm.$mount();
}; };
const findIcon = name => vm.$el.querySelector(`[data-testid="${name}-icon"]`); const findIcon = (name) => vm.$el.querySelector(`[data-testid="${name}-icon"]`);
const findMRIcon = () => findIcon('merge-request'); const findMRIcon = () => findIcon('merge-request');
const findBranchIcon = () => findIcon('branch'); const findBranchIcon = () => findIcon('branch');
...@@ -36,7 +36,7 @@ describe('NavDropdown', () => { ...@@ -36,7 +36,7 @@ describe('NavDropdown', () => {
expect(trimText(vm.$el.textContent)).toEqual('- -'); expect(trimText(vm.$el.textContent)).toEqual('- -');
}); });
it('renders branch name, if state has currentBranchId', done => { it('renders branch name, if state has currentBranchId', (done) => {
vm.$store.state.currentBranchId = TEST_BRANCH_ID; vm.$store.state.currentBranchId = TEST_BRANCH_ID;
vm.$nextTick() vm.$nextTick()
...@@ -47,7 +47,7 @@ describe('NavDropdown', () => { ...@@ -47,7 +47,7 @@ describe('NavDropdown', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('renders mr id, if state has currentMergeRequestId', done => { it('renders mr id, if state has currentMergeRequestId', (done) => {
vm.$store.state.currentMergeRequestId = TEST_MR_ID; vm.$store.state.currentMergeRequestId = TEST_MR_ID;
vm.$nextTick() vm.$nextTick()
...@@ -58,7 +58,7 @@ describe('NavDropdown', () => { ...@@ -58,7 +58,7 @@ describe('NavDropdown', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('renders branch and mr, if state has both', done => { it('renders branch and mr, if state has both', (done) => {
vm.$store.state.currentBranchId = TEST_BRANCH_ID; vm.$store.state.currentBranchId = TEST_BRANCH_ID;
vm.$store.state.currentMergeRequestId = TEST_MR_ID; vm.$store.state.currentMergeRequestId = TEST_MR_ID;
......
...@@ -39,7 +39,7 @@ describe('IDE NavDropdown', () => { ...@@ -39,7 +39,7 @@ describe('IDE NavDropdown', () => {
}); });
}; };
const findIcon = name => wrapper.find(`[data-testid="${name}-icon"]`); const findIcon = (name) => wrapper.find(`[data-testid="${name}-icon"]`);
const findMRIcon = () => findIcon('merge-request'); const findMRIcon = () => findIcon('merge-request');
const findNavForm = () => wrapper.find('.ide-nav-form'); const findNavForm = () => wrapper.find('.ide-nav-form');
const showDropdown = () => { const showDropdown = () => {
...@@ -58,7 +58,7 @@ describe('IDE NavDropdown', () => { ...@@ -58,7 +58,7 @@ describe('IDE NavDropdown', () => {
expect(findNavForm().exists()).toBe(false); expect(findNavForm().exists()).toBe(false);
}); });
it('renders nav form when show.bs.dropdown', done => { it('renders nav form when show.bs.dropdown', (done) => {
showDropdown(); showDropdown();
wrapper.vm wrapper.vm
...@@ -70,7 +70,7 @@ describe('IDE NavDropdown', () => { ...@@ -70,7 +70,7 @@ describe('IDE NavDropdown', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('destroys nav form when closed', done => { it('destroys nav form when closed', (done) => {
showDropdown(); showDropdown();
hideDropdown(); hideDropdown();
......
...@@ -37,7 +37,7 @@ describe('IDE new entry dropdown button component', () => { ...@@ -37,7 +37,7 @@ describe('IDE new entry dropdown button component', () => {
expect(vm.$emit).toHaveBeenCalledWith('click'); expect(vm.$emit).toHaveBeenCalledWith('click');
}); });
it('hides label if showLabel is false', done => { it('hides label if showLabel is false', (done) => {
vm.showLabel = false; vm.showLabel = false;
vm.$nextTick(() => { vm.$nextTick(() => {
...@@ -52,7 +52,7 @@ describe('IDE new entry dropdown button component', () => { ...@@ -52,7 +52,7 @@ describe('IDE new entry dropdown button component', () => {
expect(vm.tooltipTitle).toBe(''); expect(vm.tooltipTitle).toBe('');
}); });
it('returns label', done => { it('returns label', (done) => {
vm.showLabel = false; vm.showLabel = false;
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -57,7 +57,7 @@ describe('new dropdown component', () => { ...@@ -57,7 +57,7 @@ describe('new dropdown component', () => {
}); });
describe('isOpen', () => { describe('isOpen', () => {
it('scrolls dropdown into view', done => { it('scrolls dropdown into view', (done) => {
jest.spyOn(vm.$refs.dropdownMenu, 'scrollIntoView').mockImplementation(() => {}); jest.spyOn(vm.$refs.dropdownMenu, 'scrollIntoView').mockImplementation(() => {});
vm.isOpen = true; vm.isOpen = true;
......
...@@ -19,7 +19,7 @@ describe('new file modal component', () => { ...@@ -19,7 +19,7 @@ describe('new file modal component', () => {
${'tree'} | ${'Create new directory'} | ${'Create directory'} | ${false} ${'tree'} | ${'Create new directory'} | ${'Create directory'} | ${false}
${'blob'} | ${'Create new file'} | ${'Create file'} | ${true} ${'blob'} | ${'Create new file'} | ${'Create file'} | ${true}
`('$entryType', ({ entryType, modalTitle, btnTitle, showsFileTemplates }) => { `('$entryType', ({ entryType, modalTitle, btnTitle, showsFileTemplates }) => {
beforeEach(done => { beforeEach((done) => {
const store = createStore(); const store = createStore();
vm = createComponentWithStore(Component, store).$mount(); vm = createComponentWithStore(Component, store).$mount();
......
...@@ -69,8 +69,8 @@ describe('new dropdown upload', () => { ...@@ -69,8 +69,8 @@ describe('new dropdown upload', () => {
jest.spyOn(FileReader.prototype, 'readAsText'); jest.spyOn(FileReader.prototype, 'readAsText');
}); });
it('calls readAsText and creates file in plain text (without encoding) if the file content is plain text', done => { it('calls readAsText and creates file in plain text (without encoding) if the file content is plain text', (done) => {
const waitForCreate = new Promise(resolve => vm.$on('create', resolve)); const waitForCreate = new Promise((resolve) => vm.$on('create', resolve));
vm.createFile(textTarget, textFile); vm.createFile(textTarget, textFile);
......
...@@ -15,7 +15,7 @@ describe('ide/components/panes/collapsible_sidebar.vue', () => { ...@@ -15,7 +15,7 @@ describe('ide/components/panes/collapsible_sidebar.vue', () => {
const width = 350; const width = 350;
const fakeComponentName = 'fake-component'; const fakeComponentName = 'fake-component';
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(CollapsibleSidebar, { wrapper = shallowMount(CollapsibleSidebar, {
localVue, localVue,
store, store,
......
...@@ -14,7 +14,7 @@ describe('ide/components/panes/right.vue', () => { ...@@ -14,7 +14,7 @@ describe('ide/components/panes/right.vue', () => {
let wrapper; let wrapper;
let store; let store;
const createComponent = props => { const createComponent = (props) => {
extendStore(store, document.createElement('div')); extendStore(store, document.createElement('div'));
wrapper = shallowMount(RightPane, { wrapper = shallowMount(RightPane, {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment