Commit 43b4f5b4 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'leipert-prettier-arrow-parens-13' into 'master'

Format files with prettier arrowParens [13/15]

See merge request gitlab-org/gitlab!50542
parents cf266017 7c1fa749
......@@ -1226,193 +1226,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.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
spec/frontend/ide/components/repo_commit_section_spec.js
spec/frontend/ide/components/repo_editor_spec.js
spec/frontend/ide/components/repo_tabs_spec.js
spec/frontend/ide/components/resizable_panel_spec.js
spec/frontend/ide/components/shared/tokened_input_spec.js
spec/frontend/ide/components/terminal/session_spec.js
spec/frontend/ide/components/terminal/terminal_controls_spec.js
spec/frontend/ide/components/terminal/terminal_spec.js
spec/frontend/ide/components/terminal_sync/terminal_sync_status_spec.js
spec/frontend/ide/file_helpers.js
spec/frontend/ide/helpers.js
spec/frontend/ide/ide_router_extension_spec.js
spec/frontend/ide/ide_router_spec.js
spec/frontend/ide/lib/common/model_spec.js
spec/frontend/ide/lib/create_diff_spec.js
spec/frontend/ide/lib/create_file_diff_spec.js
spec/frontend/ide/lib/diff/controller_spec.js
spec/frontend/ide/lib/editor_spec.js
spec/frontend/ide/lib/editorconfig/parser_spec.js
spec/frontend/ide/lib/errors_spec.js
spec/frontend/ide/lib/files_spec.js
spec/frontend/ide/lib/mirror_spec.js
spec/frontend/ide/services/index_spec.js
spec/frontend/ide/stores/actions/file_spec.js
spec/frontend/ide/stores/actions/merge_request_spec.js
spec/frontend/ide/stores/actions/project_spec.js
spec/frontend/ide/stores/actions/tree_spec.js
spec/frontend/ide/stores/actions_spec.js
spec/frontend/ide/stores/extend_spec.js
spec/frontend/ide/stores/getters_spec.js
spec/frontend/ide/stores/integration_spec.js
## angry-bhabha
spec/frontend/ide/stores/modules/branches/actions_spec.js
spec/frontend/ide/stores/modules/branches/mutations_spec.js
spec/frontend/ide/stores/modules/clientside/actions_spec.js
spec/frontend/ide/stores/modules/commit/actions_spec.js
spec/frontend/ide/stores/modules/commit/getters_spec.js
spec/frontend/ide/stores/modules/file_templates/actions_spec.js
spec/frontend/ide/stores/modules/merge_requests/actions_spec.js
spec/frontend/ide/stores/modules/pane/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
spec/frontend/ide/stores/modules/terminal/actions/checks_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_controls_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_status_spec.js
spec/frontend/ide/stores/modules/terminal_sync/actions_spec.js
spec/frontend/ide/stores/mutations/file_spec.js
spec/frontend/ide/sync_router_and_store_spec.js
spec/frontend/ide/utils_spec.js
spec/frontend/image_diff/init_discussion_tab_spec.js
spec/frontend/image_diff/replaced_image_diff_spec.js
spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
spec/frontend/import_entities/import_projects/store/actions_spec.js
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
spec/frontend/integrations/edit/components/trigger_fields_spec.js
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
spec/frontend/issuable_show/components/issuable_body_spec.js
spec/frontend/issuable_show/components/issuable_edit_form_spec.js
spec/frontend/issuable_show/components/issuable_header_spec.js
spec/frontend/issuable_show/components/issuable_show_root_spec.js
## practical-murdock
spec/frontend/issuable_spec.js
spec/frontend/issue_show/components/app_spec.js
spec/frontend/issue_show/components/description_spec.js
spec/frontend/issue_show/components/edit_actions_spec.js
spec/frontend/issue_show/components/fields/description_spec.js
spec/frontend/issue_show/components/form_spec.js
spec/frontend/issue_show/components/header_actions_spec.js
spec/frontend/issue_show/components/incidents/highlight_bar_spec.js
spec/frontend/issue_show/components/pinned_links_spec.js
spec/frontend/issue_show/issue_spec.js
spec/frontend/issue_spec.js
spec/frontend/issues_list/components/issuable_spec.js
spec/frontend/issues_list/components/issuables_list_app_spec.js
spec/frontend/jira_import/components/jira_import_form_spec.js
spec/frontend/jira_import/components/jira_import_progress_spec.js
spec/frontend/jira_import/components/jira_import_setup_spec.js
spec/frontend/jobs/components/artifacts_block_spec.js
spec/frontend/jobs/components/empty_state_spec.js
spec/frontend/jobs/components/erased_block_spec.js
spec/frontend/jobs/components/job_app_spec.js
spec/frontend/jobs/components/job_container_item_spec.js
spec/frontend/jobs/components/job_log_controllers_spec.js
spec/frontend/jobs/components/log/line_spec.js
spec/frontend/jobs/components/manual_variables_form_spec.js
spec/frontend/jobs/components/stuck_block_spec.js
spec/frontend/jobs/components/trigger_block_spec.js
spec/frontend/jobs/store/actions_spec.js
spec/frontend/jobs/store/helpers.js
spec/frontend/lazy_loader_spec.js
spec/frontend/lib/dompurify_spec.js
spec/frontend/lib/utils/ajax_cache_spec.js
spec/frontend/lib/utils/apollo_startup_js_link_spec.js
spec/frontend/lib/utils/common_utils_spec.js
spec/frontend/lib/utils/datetime_range_spec.js
spec/frontend/lib/utils/datetime_utility_spec.js
spec/frontend/lib/utils/dom_utils_spec.js
spec/frontend/lib/utils/forms_spec.js
spec/frontend/lib/utils/highlight_spec.js
spec/frontend/lib/utils/icon_utils_spec.js
spec/frontend/lib/utils/poll_spec.js
spec/frontend/lib/utils/poll_until_complete_spec.js
spec/frontend/lib/utils/text_utility_spec.js
spec/frontend/lib/utils/url_utility_spec.js
spec/frontend/lib/utils/users_cache_spec.js
## determined-shamir
spec/frontend/logs/components/environment_logs_spec.js
spec/frontend/logs/components/log_advanced_filters_spec.js
spec/frontend/logs/components/log_control_buttons_spec.js
spec/frontend/logs/components/log_simple_filters_spec.js
spec/frontend/logs/stores/actions_spec.js
spec/frontend/logs/stores/mutations_spec.js
spec/frontend/matchers.js
spec/frontend/matchers_spec.js
spec/frontend/members/components/avatars/user_avatar_spec.js
spec/frontend/members/components/filter_sort/filter_sort_container_spec.js
spec/frontend/members/components/filter_sort/members_filtered_search_bar_spec.js
spec/frontend/members/components/filter_sort/sort_dropdown_spec.js
spec/frontend/members/components/modals/remove_group_link_modal_spec.js
spec/frontend/members/components/table/created_at_spec.js
spec/frontend/members/components/table/expiration_datepicker_spec.js
spec/frontend/members/components/table/expires_at_spec.js
spec/frontend/members/components/table/member_avatar_spec.js
spec/frontend/members/components/table/member_source_spec.js
spec/frontend/members/components/table/members_table_spec.js
spec/frontend/members/components/table/role_dropdown_spec.js
spec/frontend/members/utils_spec.js
spec/frontend/merge_request_spec.js
spec/frontend/merge_request_tabs_spec.js
spec/frontend/milestones/milestone_combobox_spec.js
spec/frontend/mini_pipeline_graph_dropdown_spec.js
spec/frontend/mocks/ce/lib/utils/axios_utils.js
spec/frontend/mocks/mocks_helper.js
spec/frontend/mocks/mocks_helper_spec.js
spec/frontend/monitoring/alert_widget_spec.js
spec/frontend/monitoring/components/charts/annotations_spec.js
spec/frontend/monitoring/components/charts/anomaly_spec.js
spec/frontend/monitoring/components/charts/bar_spec.js
spec/frontend/monitoring/components/charts/column_spec.js
spec/frontend/monitoring/components/charts/gauge_spec.js
spec/frontend/monitoring/components/charts/options_spec.js
spec/frontend/monitoring/components/charts/stacked_column_spec.js
spec/frontend/monitoring/components/charts/time_series_spec.js
## beautiful-benz
spec/frontend/monitoring/components/dashboard_actions_menu_spec.js
spec/frontend/monitoring/components/dashboard_header_spec.js
......
......@@ -59,7 +59,7 @@ describe('IDE activity bar', () => {
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.$nextTick(() => {
......
......@@ -71,7 +71,7 @@ describe('IDE branches search list', () => {
it('renders check next to active branch', () => {
const activeBranch = 'regular';
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.at(0).props('item').name).toBe(activeBranch);
......
......@@ -30,7 +30,7 @@ describe('IDE commit sidebar actions', () => {
vm.$store.state.currentProjectId = 'abcproject';
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;
Vue.set(vm.$store.state.projects, 'abcproject', proj);
......@@ -72,7 +72,7 @@ describe('IDE commit sidebar actions', () => {
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 });
vm.$nextTick(() => {
......@@ -106,7 +106,7 @@ describe('IDE commit sidebar actions', () => {
expect(vm.$store.dispatch).not.toHaveBeenCalled();
});
it('calls again after staged changes', done => {
it('calls again after staged changes', (done) => {
createComponent({ currentBranchId: null });
vm.$store.state.currentBranchId = 'master';
......
......@@ -41,7 +41,7 @@ describe('Multi-file editor commit sidebar list item', () => {
expect(findPathText()).toContain(f.path);
});
it('correctly renders renamed entries', done => {
it('correctly renders renamed entries', (done) => {
Vue.set(vm.file, 'prevName', 'Old name');
vm.$nextTick()
......@@ -52,7 +52,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.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);
vm.$nextTick()
......@@ -63,7 +63,7 @@ describe('Multi-file editor commit sidebar list item', () => {
.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(router, 'push').mockImplementation(() => {});
......@@ -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, 'updateViewer');
jest.spyOn(router, 'push').mockImplementation(() => {});
......@@ -134,7 +134,7 @@ describe('Multi-file editor commit sidebar list item', () => {
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.$nextTick(() => {
......
......@@ -31,7 +31,7 @@ describe('Multi-file editor commit sidebar list', () => {
});
describe('with a list of files', () => {
beforeEach(done => {
beforeEach((done) => {
const f = file('file name');
f.changed = true;
vm.fileList.push(f);
......
......@@ -23,7 +23,7 @@ describe('IDE commit message field', () => {
vm.$destroy();
});
it('adds is-focused class on focus', done => {
it('adds is-focused class on focus', (done) => {
vm.$el.querySelector('textarea').focus();
vm.$nextTick(() => {
......@@ -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.$nextTick()
......@@ -66,7 +66,7 @@ describe('IDE commit message field', () => {
describe('highlights', () => {
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.$nextTick()
......@@ -81,7 +81,7 @@ describe('IDE commit message field', () => {
.catch(done.fail);
});
it('highlights characters over 50 length', done => {
it('highlights characters over 50 length', (done) => {
vm.text =
'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', () => {
});
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.$nextTick()
......@@ -114,7 +114,7 @@ describe('IDE commit message field', () => {
.catch(done.fail);
});
it('highlights body text more than 72 characters', done => {
it('highlights body text more than 72 characters', (done) => {
vm.text =
'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', () => {
.catch(done.fail);
});
it('highlights body text & subject line', done => {
it('highlights body text & subject line', (done) => {
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';
......@@ -147,7 +147,7 @@ describe('IDE commit message field', () => {
});
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.$nextTick()
......
......@@ -17,7 +17,7 @@ describe('create new MR checkbox', () => {
] = { foo: 'bar' };
};
const setPermissions = permissions => {
const setPermissions = (permissions) => {
store.state.projects[store.state.currentProjectId].userPermissions = permissions;
};
......@@ -33,7 +33,7 @@ describe('create new MR checkbox', () => {
vm.$store.state.currentBranchId = currentBranchId;
store.state.projects.abcproject.branches[currentBranchId] = branches.find(
branch => branch.name === currentBranchId,
(branch) => branch.name === currentBranchId,
);
return vm.$mount();
......@@ -69,7 +69,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe('');
});
it('has new MR', done => {
it('has new MR', (done) => {
setMR();
vm.$nextTick()
......@@ -93,7 +93,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).toBe('');
});
it('has new MR', done => {
it('has new MR', (done) => {
setMR();
vm.$nextTick()
......@@ -118,7 +118,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe('');
});
it('is rendered if MR exists', done => {
it('is rendered if MR exists', (done) => {
setMR();
vm.$nextTick()
......@@ -141,7 +141,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe('');
});
it('is hidden if MR exists', done => {
it('is hidden if MR exists', (done) => {
setMR();
vm.$nextTick()
......@@ -165,7 +165,7 @@ describe('create new MR checkbox', () => {
expect(vm.$el.textContent).not.toBe('');
});
it('is hidden if MR exists', done => {
it('is hidden if MR exists', (done) => {
setMR();
vm.$nextTick()
......
......@@ -7,7 +7,7 @@ describe('IDE commit sidebar radio group', () => {
let vm;
let store;
beforeEach(done => {
beforeEach((done) => {
store = createStore();
const Component = Vue.extend(radioGroup);
......@@ -33,7 +33,7 @@ describe('IDE commit sidebar radio group', () => {
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 = new Vue({
......@@ -41,7 +41,7 @@ describe('IDE commit sidebar radio group', () => {
radioGroup,
},
store,
render: createElement =>
render: (createElement) =>
createElement('radio-group', { props: { value: '1' } }, 'Testing slot'),
});
......@@ -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'));
Vue.nextTick(() => {
......@@ -65,7 +65,7 @@ describe('IDE commit sidebar radio group', () => {
});
describe('with input', () => {
beforeEach(done => {
beforeEach((done) => {
vm.$destroy();
const Component = Vue.extend(radioGroup);
......@@ -89,7 +89,7 @@ describe('IDE commit sidebar radio group', () => {
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';
Vue.nextTick(() => {
......@@ -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');
input.value = 'testing-123';
input.dispatchEvent(new Event('input'));
......
......@@ -23,7 +23,7 @@ describe('IDE commit panel successful commit state', () => {
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';
Vue.nextTick(() => {
......
......@@ -10,7 +10,7 @@ describe('IDE error message component', () => {
let wrapper;
const setErrorMessageMock = jest.fn();
const createComponent = messageProps => {
const createComponent = (messageProps) => {
const fakeStore = new Vuex.Store({
actions: { setErrorMessage: setErrorMessageMock },
});
......@@ -103,7 +103,7 @@ describe('IDE error message component', () => {
let resolveAction;
actionMock.mockImplementation(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolveAction = resolve;
}),
);
......
......@@ -70,7 +70,7 @@ describe('IDE extra file row component', () => {
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.opened = true;
changesCount = 1;
......@@ -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.opened = false;
changesCount = 1;
......@@ -100,7 +100,7 @@ describe('IDE extra file row component', () => {
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.$nextTick(() => {
......@@ -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.$nextTick(() => {
......@@ -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.$nextTick(() => {
......@@ -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.$nextTick(() => {
......@@ -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.type = 'tree';
......@@ -157,7 +157,7 @@ describe('IDE extra file row component', () => {
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.$nextTick(() => {
......
......@@ -46,7 +46,7 @@ describe('IDE file templates bar component', () => {
});
describe('template dropdown', () => {
beforeEach(done => {
beforeEach((done) => {
vm.$store.state.fileTemplates.templates = [
{
name: 'test',
......@@ -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.$nextTick(() => {
......@@ -93,7 +93,7 @@ describe('IDE file templates bar component', () => {
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';
jest.spyOn(vm, 'setSelectedTemplateType').mockImplementation(() => {});
......
......@@ -109,7 +109,7 @@ describe('IDE file templates dropdown component', () => {
});
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', () => {
......@@ -124,7 +124,7 @@ describe('IDE file templates dropdown component', () => {
const items = findItemButtons();
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', () => {
const items = findItemButtons();
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', () => {
......@@ -169,7 +169,7 @@ describe('IDE file templates dropdown component', () => {
const items = findItemButtons();
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', () => {
const findButtons = () => wrapper.findAll('li button');
const findButtonsData = () =>
findButtons().wrappers.map(button => {
findButtons().wrappers.map((button) => {
return {
title: button.attributes('title'),
ariaLabel: button.attributes('aria-label'),
......
......@@ -25,7 +25,7 @@ describe('WebIDE', () => {
tree: [],
loading: false,
};
Object.keys(state).forEach(key => {
Object.keys(state).forEach((key) => {
store.state[key] = state[key];
});
......
......@@ -73,7 +73,7 @@ describe('ideStatusBar', () => {
});
describe('pipeline status', () => {
it('opens right sidebar on clicking icon', done => {
it('opens right sidebar on clicking icon', (done) => {
jest.spyOn(vm, 'openRightPane').mockImplementation(() => {});
Vue.set(vm.$store.state.pipelines, 'latestPipeline', {
details: {
......
......@@ -9,7 +9,7 @@ const TEST_URL = `${TEST_HOST}merge-requests/9001`;
describe('ide/components/ide_status_mr', () => {
let wrapper;
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(IdeStatusMr, {
propsData: props,
});
......
......@@ -41,7 +41,7 @@ describe('IDE tree list', () => {
vm.$mount();
});
it('renders loading indicator', done => {
it('renders loading indicator', (done) => {
store.state.trees['abcproject/master'].loading = true;
vm.$nextTick(() => {
......
......@@ -5,7 +5,7 @@ import ScrollButton from '~/ide/components/jobs/detail/scroll_button.vue';
describe('IDE job log scroll button', () => {
let wrapper;
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(ScrollButton, {
propsData: {
direction: 'up',
......
......@@ -48,7 +48,7 @@ describe('IDE jobs detail view', () => {
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.$nextTick(() => {
......@@ -68,7 +68,7 @@ describe('IDE jobs detail view', () => {
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.$nextTick(() => {
......
......@@ -27,7 +27,7 @@ describe('IDE jobs item', () => {
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.$nextTick(() => {
......
......@@ -36,7 +36,7 @@ describe('IDE stages list', () => {
status: { icon: 'status_success' },
}));
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(StageList, {
propsData: {
...defaultProps,
......@@ -48,7 +48,7 @@ describe('IDE stages list', () => {
};
afterEach(() => {
Object.values(storeActions).forEach(actionMock => actionMock.mockClear());
Object.values(storeActions).forEach((actionMock) => actionMock.mockClear());
});
afterAll(() => {
......
......@@ -20,7 +20,7 @@ describe('IDE pipeline stage', () => {
const findHeader = () => wrapper.find({ ref: 'cardHeader' });
const findJobList = () => wrapper.find({ ref: 'jobList' });
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(Stage, {
propsData: {
...defaultProps,
......
......@@ -151,8 +151,8 @@ describe('IDE merge requests list', () => {
it('shows search types', () => {
const buttons = findSearchTypeButtons();
expect(buttons.wrappers.map(x => x.text().trim())).toEqual(
wrapper.vm.$options.searchTypes.map(x => x.label),
expect(buttons.wrappers.map((x) => x.text().trim())).toEqual(
wrapper.vm.$options.searchTypes.map((x) => x.label),
);
});
......
......@@ -23,7 +23,7 @@ describe('NavDropdown', () => {
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 findBranchIcon = () => findIcon('branch');
......@@ -36,7 +36,7 @@ describe('NavDropdown', () => {
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.$nextTick()
......@@ -47,7 +47,7 @@ describe('NavDropdown', () => {
.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.$nextTick()
......@@ -58,7 +58,7 @@ describe('NavDropdown', () => {
.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.currentMergeRequestId = TEST_MR_ID;
......
......@@ -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 findNavForm = () => wrapper.find('.ide-nav-form');
const showDropdown = () => {
......@@ -58,7 +58,7 @@ describe('IDE NavDropdown', () => {
expect(findNavForm().exists()).toBe(false);
});
it('renders nav form when show.bs.dropdown', done => {
it('renders nav form when show.bs.dropdown', (done) => {
showDropdown();
wrapper.vm
......@@ -70,7 +70,7 @@ describe('IDE NavDropdown', () => {
.catch(done.fail);
});
it('destroys nav form when closed', done => {
it('destroys nav form when closed', (done) => {
showDropdown();
hideDropdown();
......
......@@ -37,7 +37,7 @@ describe('IDE new entry dropdown button component', () => {
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.$nextTick(() => {
......@@ -52,7 +52,7 @@ describe('IDE new entry dropdown button component', () => {
expect(vm.tooltipTitle).toBe('');
});
it('returns label', done => {
it('returns label', (done) => {
vm.showLabel = false;
vm.$nextTick(() => {
......
......@@ -57,7 +57,7 @@ describe('new dropdown component', () => {
});
describe('isOpen', () => {
it('scrolls dropdown into view', done => {
it('scrolls dropdown into view', (done) => {
jest.spyOn(vm.$refs.dropdownMenu, 'scrollIntoView').mockImplementation(() => {});
vm.isOpen = true;
......
......@@ -19,7 +19,7 @@ describe('new file modal component', () => {
${'tree'} | ${'Create new directory'} | ${'Create directory'} | ${false}
${'blob'} | ${'Create new file'} | ${'Create file'} | ${true}
`('$entryType', ({ entryType, modalTitle, btnTitle, showsFileTemplates }) => {
beforeEach(done => {
beforeEach((done) => {
const store = createStore();
vm = createComponentWithStore(Component, store).$mount();
......
......@@ -69,8 +69,8 @@ describe('new dropdown upload', () => {
jest.spyOn(FileReader.prototype, 'readAsText');
});
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));
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));
vm.createFile(textTarget, textFile);
......
......@@ -15,7 +15,7 @@ describe('ide/components/panes/collapsible_sidebar.vue', () => {
const width = 350;
const fakeComponentName = 'fake-component';
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(CollapsibleSidebar, {
localVue,
store,
......
......@@ -14,7 +14,7 @@ describe('ide/components/panes/right.vue', () => {
let wrapper;
let store;
const createComponent = props => {
const createComponent = (props) => {
extendStore(store, document.createElement('div'));
wrapper = shallowMount(RightPane, {
......
......@@ -32,7 +32,7 @@ describe('RepoCommitSection', () => {
},
};
const files = [file('file1'), file('file2')].map(f =>
const files = [file('file1'), file('file2')].map((f) =>
Object.assign(f, {
type: 'blob',
content: 'orginal content',
......@@ -42,7 +42,7 @@ describe('RepoCommitSection', () => {
store.state.currentBranch = 'master';
store.state.changedFiles = [];
store.state.stagedFiles = [{ ...files[0] }, { ...files[1] }];
store.state.stagedFiles.forEach(f =>
store.state.stagedFiles.forEach((f) =>
Object.assign(f, {
changed: true,
staged: true,
......@@ -50,7 +50,7 @@ describe('RepoCommitSection', () => {
}),
);
files.forEach(f => {
files.forEach((f) => {
store.state.entries[f.path] = f;
});
}
......@@ -105,9 +105,9 @@ describe('RepoCommitSection', () => {
const allFiles = store.state.changedFiles.concat(store.state.stagedFiles);
const changedFileNames = wrapper
.findAll('.multi-file-commit-list > li')
.wrappers.map(x => x.text().trim());
.wrappers.map((x) => x.text().trim());
expect(changedFileNames).toEqual(allFiles.map(x => x.path));
expect(changedFileNames).toEqual(allFiles.map((x) => x.path));
});
it('does not show empty state', () => {
......@@ -141,7 +141,7 @@ describe('RepoCommitSection', () => {
beforeEach(() => {
setupDefaultState();
store.state.changedFiles = store.state.stagedFiles.map(x =>
store.state.changedFiles = store.state.stagedFiles.map((x) =>
Object.assign(x, { staged: false }),
);
store.state.stagedFiles = [];
......
......@@ -25,7 +25,7 @@ describe('RepoEditor', () => {
let store;
const waitForEditorSetup = () =>
new Promise(resolve => {
new Promise((resolve) => {
vm.$once('editorSetup', resolve);
});
......@@ -43,7 +43,7 @@ describe('RepoEditor', () => {
vm.$mount();
};
const createOpenFile = path => {
const createOpenFile = (path) => {
const origFile = store.state.openFiles[0];
const newFile = { ...origFile, path, key: path, name: 'myfile.txt', content: 'hello world' };
......@@ -91,7 +91,7 @@ describe('RepoEditor', () => {
});
const findEditor = () => vm.$el.querySelector('.multi-file-editor-holder');
const changeViewMode = viewMode =>
const changeViewMode = (viewMode) =>
store.dispatch('editor/updateFileEditor', { path: vm.file.path, data: { viewMode } });
describe('default', () => {
......@@ -119,7 +119,7 @@ describe('RepoEditor', () => {
expect(findEditor()).not.toHaveCss({ display: 'none' });
});
it('renders only an edit tab', done => {
it('renders only an edit tab', (done) => {
Vue.nextTick(() => {
const tabs = vm.$el.querySelectorAll('.ide-mode-tabs .nav-links li');
......@@ -157,7 +157,7 @@ describe('RepoEditor', () => {
mock.restore();
});
it('renders an Edit and a Preview Tab', done => {
it('renders an Edit and a Preview Tab', (done) => {
Vue.nextTick(() => {
const tabs = vm.$el.querySelectorAll('.ide-mode-tabs .nav-links li');
......@@ -169,7 +169,7 @@ describe('RepoEditor', () => {
});
});
it('renders markdown for tempFile', done => {
it('renders markdown for tempFile', (done) => {
vm.file.tempFile = true;
vm.$nextTick()
......@@ -202,7 +202,7 @@ describe('RepoEditor', () => {
});
describe('when open file is binary and not raw', () => {
beforeEach(done => {
beforeEach((done) => {
vm.file.name = 'file.dat';
vm.file.content = '🐱'; // non-ascii binary content
jest.spyOn(vm.editor, 'createInstance').mockImplementation();
......@@ -227,7 +227,7 @@ describe('RepoEditor', () => {
});
describe('createEditorInstance', () => {
it('calls createInstance when viewer is editor', done => {
it('calls createInstance when viewer is editor', (done) => {
jest.spyOn(vm.editor, 'createInstance').mockImplementation();
vm.createEditorInstance();
......@@ -239,7 +239,7 @@ describe('RepoEditor', () => {
});
});
it('calls createDiffInstance when viewer is diff', done => {
it('calls createDiffInstance when viewer is diff', (done) => {
vm.$store.state.viewer = 'diff';
jest.spyOn(vm.editor, 'createDiffInstance').mockImplementation();
......@@ -253,7 +253,7 @@ describe('RepoEditor', () => {
});
});
it('calls createDiffInstance when viewer is a merge request diff', done => {
it('calls createDiffInstance when viewer is a merge request diff', (done) => {
vm.$store.state.viewer = 'mrdiff';
jest.spyOn(vm.editor, 'createDiffInstance').mockImplementation();
......@@ -354,7 +354,7 @@ describe('RepoEditor', () => {
jest.spyOn(vm.editor, 'updateDiffView').mockImplementation();
});
it('calls updateDimensions when panelResizing is false', done => {
it('calls updateDimensions when panelResizing is false', (done) => {
vm.$store.state.panelResizing = true;
vm.$nextTick()
......@@ -370,7 +370,7 @@ describe('RepoEditor', () => {
.catch(done.fail);
});
it('does not call updateDimensions when panelResizing is true', done => {
it('does not call updateDimensions when panelResizing is true', (done) => {
vm.$store.state.panelResizing = true;
vm.$nextTick(() => {
......@@ -381,7 +381,7 @@ describe('RepoEditor', () => {
});
});
it('calls updateDimensions when rightPane is opened', done => {
it('calls updateDimensions when rightPane is opened', (done) => {
vm.$store.state.rightPane.isOpen = true;
vm.$nextTick(() => {
......@@ -398,7 +398,7 @@ describe('RepoEditor', () => {
expect(vm.$el.querySelector('.nav-links')).not.toBe(null);
});
it('hides tabs in review mode', done => {
it('hides tabs in review mode', (done) => {
vm.$store.state.currentActivityView = leftSidebarViews.review.name;
vm.$nextTick(() => {
......@@ -408,7 +408,7 @@ describe('RepoEditor', () => {
});
});
it('hides tabs in commit mode', done => {
it('hides tabs in commit mode', (done) => {
vm.$store.state.currentActivityView = leftSidebarViews.commit.name;
vm.$nextTick(() => {
......@@ -420,7 +420,7 @@ describe('RepoEditor', () => {
});
describe('when files view mode is preview', () => {
beforeEach(done => {
beforeEach((done) => {
jest.spyOn(vm.editor, 'updateDimensions').mockImplementation();
changeViewMode(FILE_VIEW_MODE_PREVIEW);
vm.file.name = 'myfile.md';
......@@ -452,7 +452,7 @@ describe('RepoEditor', () => {
jest.spyOn(vm, 'shouldHideEditor', 'get').mockReturnValue(true);
});
it('does not fetch file information for temp entries', done => {
it('does not fetch file information for temp entries', (done) => {
vm.file.tempFile = true;
vm.initEditor();
......@@ -464,7 +464,7 @@ describe('RepoEditor', () => {
.catch(done.fail);
});
it('is being initialised for files without content even if shouldHideEditor is `true`', done => {
it('is being initialised for files without content even if shouldHideEditor is `true`', (done) => {
vm.file.content = '';
vm.file.raw = '';
......@@ -479,7 +479,7 @@ describe('RepoEditor', () => {
.catch(done.fail);
});
it('does not initialize editor for files already with content', done => {
it('does not initialize editor for files already with content', (done) => {
vm.file.content = 'foo';
vm.initEditor();
......@@ -499,7 +499,7 @@ describe('RepoEditor', () => {
jest.spyOn(vm, 'initEditor').mockImplementation();
});
it('calls removePendingTab when old file is pending', done => {
it('calls removePendingTab when old file is pending', (done) => {
jest.spyOn(vm, 'shouldHideEditor', 'get').mockReturnValue(true);
jest.spyOn(vm, 'removePendingTab').mockImplementation();
......@@ -519,7 +519,7 @@ describe('RepoEditor', () => {
.catch(done.fail);
});
it('does not call initEditor if the file did not change', done => {
it('does not call initEditor if the file did not change', (done) => {
Vue.set(vm, 'file', vm.file);
vm.$nextTick()
......@@ -530,7 +530,7 @@ describe('RepoEditor', () => {
.catch(done.fail);
});
it('calls initEditor when file key is changed', done => {
it('calls initEditor when file key is changed', (done) => {
expect(vm.initEditor).not.toHaveBeenCalled();
Vue.set(vm, 'file', {
......@@ -552,7 +552,7 @@ describe('RepoEditor', () => {
vm.getRawFileData.mockRestore();
});
const createRemoteFile = name => ({
const createRemoteFile = (name) => ({
...file(name),
tmpFile: false,
});
......@@ -605,7 +605,7 @@ describe('RepoEditor', () => {
});
describe('onPaste', () => {
const setFileName = name => {
const setFileName = (name) => {
Vue.set(vm, 'file', {
...vm.file,
content: 'hello world\n',
......@@ -627,8 +627,8 @@ describe('RepoEditor', () => {
);
};
const watchState = watched =>
new Promise(resolve => {
const watchState = (watched) =>
new Promise((resolve) => {
const unwatch = vm.$store.watch(watched, () => {
unwatch();
resolve();
......@@ -638,7 +638,7 @@ describe('RepoEditor', () => {
// Pasting an image does a lot of things like using the FileReader API,
// so, waitForPromises isn't very reliable (and causes a flaky spec)
// Read more about state.watch: https://vuex.vuejs.org/api/#watch
const waitForFileContentChange = () => watchState(s => s.entries['foo/bar.md'].content);
const waitForFileContentChange = () => watchState((s) => s.entries['foo/bar.md'].content);
beforeEach(() => {
setFileName('bar.md');
......
......@@ -30,7 +30,7 @@ describe('RepoTabs', () => {
wrapper.destroy();
});
it('renders a list of tabs', done => {
it('renders a list of tabs', (done) => {
store.state.openFiles[0].active = true;
wrapper.vm.$nextTick(() => {
......
......@@ -38,7 +38,7 @@ describe('~/ide/components/resizable_panel', () => {
};
const findResizer = () => wrapper.find(PanelResizer);
const findInlineStyle = () => wrapper.element.style.cssText;
const createInlineStyle = width => `width: ${width}px;`;
const createInlineStyle = (width) => `width: ${width}px;`;
describe.each`
props | showResizer | resizerSide | expectedStyle
......
......@@ -44,9 +44,9 @@ describe('IDE shared/TokenedInput', () => {
});
it('renders tokens', () => {
const renderedTokens = getTokenElements(vm).map(x => x.textContent.trim());
const renderedTokens = getTokenElements(vm).map((x) => x.textContent.trim());
expect(renderedTokens).toEqual(TEST_TOKENS.map(x => x.label));
expect(renderedTokens).toEqual(TEST_TOKENS.map((x) => x.label));
});
it('renders input', () => {
......@@ -54,7 +54,7 @@ describe('IDE shared/TokenedInput', () => {
expect(vm.$refs.input).toHaveValue(TEST_VALUE);
});
it('renders placeholder, when tokens are empty', done => {
it('renders placeholder, when tokens are empty', (done) => {
vm.tokens = [];
vm.$nextTick()
......
......@@ -67,7 +67,7 @@ describe('IDE TerminalSession', () => {
});
});
[STARTING, PENDING, RUNNING].forEach(status => {
[STARTING, PENDING, RUNNING].forEach((status) => {
it(`show stop button when status is ${status}`, () => {
state.session = { status };
factory();
......@@ -82,7 +82,7 @@ describe('IDE TerminalSession', () => {
});
});
[STOPPING, STOPPED].forEach(status => {
[STOPPING, STOPPED].forEach((status) => {
it(`show stop button when status is ${status}`, () => {
state.session = { status };
factory();
......
......@@ -17,7 +17,7 @@ describe('IDE TerminalControls', () => {
it('shows an up and down scroll button', () => {
factory();
expect(buttons.wrappers.map(x => x.props())).toEqual([
expect(buttons.wrappers.map((x) => x.props())).toEqual([
expect.objectContaining({ direction: 'up', disabled: true }),
expect.objectContaining({ direction: 'down', disabled: true }),
]);
......
......@@ -31,7 +31,7 @@ describe('IDE Terminal', () => {
let wrapper;
let state;
const factory = propsData => {
const factory = (propsData) => {
const store = new Vuex.Store({
state,
mutations: {
......@@ -63,7 +63,7 @@ describe('IDE Terminal', () => {
});
describe('loading text', () => {
[STARTING, PENDING].forEach(status => {
[STARTING, PENDING].forEach((status) => {
it(`shows when starting (${status})`, () => {
factory({ status });
......@@ -79,7 +79,7 @@ describe('IDE Terminal', () => {
expect(wrapper.find('.top-bar').text()).toBe('Stopping...');
});
[RUNNING, STOPPED].forEach(status => {
[RUNNING, STOPPED].forEach((status) => {
it('hides when not loading', () => {
factory({ status });
......
......@@ -26,7 +26,7 @@ describe('ide/components/terminal_sync/terminal_sync_status', () => {
namespaced: true,
state: moduleState,
mutations: {
[START_LOADING]: state => {
[START_LOADING]: (state) => {
state.isLoading = true;
},
},
......
......@@ -26,7 +26,7 @@ export const createMovedFile = (path, prevPath, content) =>
prevPath,
});
export const createEntries = path =>
export const createEntries = (path) =>
path.split('/').reduce((acc, part, idx, parts) => {
const parentPath = parts.slice(0, idx).join('/');
const fullPath = parentPath ? `${parentPath}/${part}` : part;
......
......@@ -12,9 +12,9 @@ export const file = (name = 'name', id = name, type = '', parent = null) =>
parentPath: parent ? parent.path : '',
});
export const createEntriesFromPaths = paths =>
export const createEntriesFromPaths = (paths) =>
paths
.map(path => ({
.map((path) => ({
name: pathUtils.basename(path),
dir: pathUtils.dirname(path),
ext: pathUtils.extname(path),
......@@ -30,7 +30,7 @@ export const createEntriesFromPaths = paths =>
};
}, {});
export const createTriggerChangeAction = payload => ({
export const createTriggerChangeAction = (payload) => ({
type: 'triggerFilesChange',
...(payload ? { payload } : {}),
});
......
......@@ -4,7 +4,7 @@ import IdeRouter from '~/ide/ide_router_extension';
jest.mock('vue-router');
describe('IDE overrides of VueRouter', () => {
const paths = branch => [
const paths = (branch) => [
`${branch}`,
`/${branch}`,
`/${branch}/-/`,
......@@ -35,7 +35,7 @@ describe('IDE overrides of VueRouter', () => {
${'test-#-hash'} | ${'test-%23-hash'}
${'test/hash#123'} | ${'test/hash%23123'}
`('finds project path when route is $path', ({ path, expected }) => {
paths(path).forEach(route => {
paths(path).forEach((route) => {
const expectedPath = route.replace(path, expected);
router.push(route);
......
......@@ -32,7 +32,7 @@ describe('IDE router', () => {
`/project/${PROJECT_NAMESPACE}/${PROJECT_NAME}/tree/blob`,
`/project/${PROJECT_NAMESPACE}/${PROJECT_NAME}/edit`,
`/project/${PROJECT_NAMESPACE}/${PROJECT_NAME}`,
].forEach(route => {
].forEach((route) => {
it(`finds project path when route is "${route}"`, () => {
router.push(route);
......
......@@ -81,7 +81,7 @@ describe('Multi-file editor library model', () => {
});
describe('onChange', () => {
it('calls callback on change', done => {
it('calls callback on change', (done) => {
const spy = jest.fn();
model.onChange(spy);
......
......@@ -145,12 +145,12 @@ new file mode 100644
--- /dev/null
+++ b/${PATH_LOREM}
@@ -0,0 +1,${LINES.length} @@
${LINES.map(line => `+${line}`).join('\n')}
${LINES.map((line) => `+${line}`).join('\n')}
diff --git "a/${PATH_IPSUM}" "b/${PATH_IPSUM}"
--- a/${PATH_IPSUM}
+++ b/${PATH_IPSUM}
@@ -1,${LINES.length} +1,1 @@
${LINES.map(line => `-${line}`).join('\n')}
${LINES.map((line) => `-${line}`).join('\n')}
+That's all folks!
\\ No newline at end of file
`;
......@@ -167,10 +167,10 @@ ${LINES.map(line => `-${line}`).join('\n')}
const deletedFiles = ['foo/bar/zed/test.md', 'foo/bar/zed/test2.md'];
const entries = deletedFiles.reduce((acc, path) => Object.assign(acc, createEntries(path)), {});
const allDeleted = [...deletedFiles, 'foo/bar/zed', 'foo/bar'];
allDeleted.forEach(path => {
allDeleted.forEach((path) => {
entries[path].deleted = true;
});
const changedFiles = deletedFiles.map(x => entries[x]);
const changedFiles = deletedFiles.map((x) => entries[x]);
const result = createDiff({ changedFiles, entries });
......
......@@ -51,7 +51,7 @@ describe('IDE lib/create_file_diff', () => {
const expectedHead = `diff --git "a/${PATH}" "b/${PATH}"
new file mode 100644`;
const expectedChunkHead = lineCount => `--- /dev/null
const expectedChunkHead = (lineCount) => `--- /dev/null
+++ b/${PATH}
@@ -0,0 +1,${lineCount} @@`;
......@@ -86,7 +86,7 @@ ${expectedChunkHead(1)}
expect(result).toBe(`${expectedHead}
${expectedChunkHead(TEXT_LINE_COUNT)}
${mapLines(TEXT, line => `+${line}`)}
${mapLines(TEXT, (line) => `+${line}`)}
`);
});
});
......@@ -95,7 +95,7 @@ ${mapLines(TEXT, line => `+${line}`)}
const expectedHead = `diff --git "a/${PATH}" "b/${PATH}"
deleted file mode 100644`;
const expectedChunkHead = lineCount => `--- a/${PATH}
const expectedChunkHead = (lineCount) => `--- a/${PATH}
+++ /dev/null
@@ -1,${lineCount} +0,0 @@`;
......@@ -111,7 +111,7 @@ deleted file mode 100644`;
expect(result).toBe(`${expectedHead}
${expectedChunkHead(TEXT_LINE_COUNT)}
${mapLines(TEXT, line => `-${line}`)}
${mapLines(TEXT, (line) => `-${line}`)}
`);
});
});
......
......@@ -37,7 +37,7 @@ describe('Multi-file editor library dirty diff controller', () => {
});
describe('getDiffChangeType', () => {
['added', 'removed', 'modified'].forEach(type => {
['added', 'removed', 'modified'].forEach((type) => {
it(`returns ${type}`, () => {
const change = {
[type]: true,
......@@ -49,7 +49,7 @@ describe('Multi-file editor library dirty diff controller', () => {
});
describe('getDecorator', () => {
['added', 'removed', 'modified'].forEach(type => {
['added', 'removed', 'modified'].forEach((type) => {
it(`returns with linesDecorationsClassName for ${type}`, () => {
const change = {
[type]: true,
......
......@@ -15,7 +15,7 @@ describe('Multi-file editor library', () => {
let holder;
let store;
const setNodeOffsetWidth = val => {
const setNodeOffsetWidth = (val) => {
Object.defineProperty(instance.instance.getDomNode(), 'offsetWidth', {
get() {
return val;
......
......@@ -2,14 +2,14 @@ import { getRulesWithTraversal } from '~/ide/lib/editorconfig/parser';
import { exampleConfigs, exampleFiles } from './mock_data';
describe('~/ide/lib/editorconfig/parser', () => {
const getExampleConfigContent = path =>
Promise.resolve(exampleConfigs.find(x => x.path === path)?.content);
const getExampleConfigContent = (path) =>
Promise.resolve(exampleConfigs.find((x) => x.path === path)?.content);
describe('getRulesWithTraversal', () => {
it.each(exampleFiles)(
'traverses through all editorconfig files in parent directories (until root=true is hit) and finds rules for this file (case %#)',
({ path, rules }) => {
return getRulesWithTraversal(path, getExampleConfigContent).then(result => {
return getRulesWithTraversal(path, getExampleConfigContent).then((result) => {
expect(result).toEqual(rules);
});
},
......
......@@ -14,7 +14,7 @@ const CODEOWNERS_MESSAGE =
const CHANGED_MESSAGE = 'Things changed since you started editing';
describe('~/ide/lib/errors', () => {
const createResponseError = message => ({
const createResponseError = (message) => ({
response: {
data: {
message,
......
......@@ -3,7 +3,7 @@ import { decorateData } from '~/ide/stores/utils';
const TEST_BLOB_DATA = { mimeType: 'test/mime' };
const createEntries = paths => {
const createEntries = (paths) => {
const createEntry = (acc, { path, type, children }) => {
const { name, parent } = splitParent(path);
......@@ -15,7 +15,7 @@ const createEntries = paths => {
type,
parentPath: parent,
}),
tree: children.map(childName => expect.objectContaining({ name: childName })),
tree: children.map((childName) => expect.objectContaining({ name: childName })),
...(type === 'blob' ? TEST_BLOB_DATA : {}),
};
......@@ -53,7 +53,7 @@ describe('IDE lib decorate files', () => {
const entryKeys = Object.keys(entries);
expect(entryKeys).toEqual(Object.keys(expectedEntries));
entryKeys.forEach(key => {
entryKeys.forEach((key) => {
expect(entries[key]).toEqual(expectedEntries[key]);
});
......
......@@ -72,7 +72,7 @@ describe('ide/lib/mirror', () => {
});
const waitForConnection = (delay = SERVICE_DELAY) => {
const wait = new Promise(resolve => {
const wait = new Promise((resolve) => {
setTimeout(resolve, 10);
});
......@@ -82,7 +82,7 @@ describe('ide/lib/mirror', () => {
};
const connectPass = () => waitForConnection().then(() => mockWebSocket.onopen());
const connectFail = () => waitForConnection().then(() => mockWebSocket.onerror());
const sendResponse = msg => {
const sendResponse = (msg) => {
mockWebSocket.onmessage(msg);
};
......
......@@ -51,7 +51,7 @@ describe('IDE services', () => {
raw: 'raw content',
};
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(raw).toBe('content');
});
});
......@@ -65,7 +65,7 @@ describe('IDE services', () => {
raw: 'raw content',
};
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(raw).toBe('raw content');
});
});
......@@ -77,7 +77,7 @@ describe('IDE services', () => {
raw: 'raw content',
};
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(raw).toBe('raw content');
});
});
......@@ -89,7 +89,7 @@ describe('IDE services', () => {
raw: '',
};
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(raw).toBe('');
});
});
......@@ -116,7 +116,7 @@ describe('IDE services', () => {
});
it('sends a request to file.rawPath', () => {
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(axios.get).toHaveBeenCalledWith(file.rawPath, {
transformResponse: [expect.any(Function)],
});
......@@ -127,7 +127,7 @@ describe('IDE services', () => {
it('returns arraybuffer for binary files', () => {
file.binary = true;
return services.getRawFileData(file).then(raw => {
return services.getRawFileData(file).then((raw) => {
expect(axios.get).toHaveBeenCalledWith(file.rawPath, {
transformResponse: [expect.any(Function)],
responseType: 'arraybuffer',
......@@ -161,7 +161,7 @@ describe('IDE services', () => {
it('gives back file.baseRaw for files with that property present', () => {
file.baseRaw = TEST_FILE_CONTENTS;
return services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then(content => {
return services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then((content) => {
expect(content).toEqual(TEST_FILE_CONTENTS);
});
});
......@@ -170,7 +170,7 @@ describe('IDE services', () => {
file.tempFile = true;
file.baseRaw = TEST_FILE_CONTENTS;
return services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then(content => {
return services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then((content) => {
expect(content).toEqual(TEST_FILE_CONTENTS);
});
});
......@@ -207,7 +207,7 @@ describe('IDE services', () => {
});
it('fetches file content', () =>
services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then(content => {
services.getBaseRawFileData(file, TEST_PROJECT_ID, TEST_COMMIT_SHA).then((content) => {
expect(content).toEqual(TEST_FILE_CONTENTS);
}));
},
......@@ -224,7 +224,7 @@ describe('IDE services', () => {
Api.project.mockReturnValue(Promise.resolve({ data: { ...projectData } }));
query.mockReturnValue(Promise.resolve({ data: { project: gqlProjectData } }));
return services.getProjectData(TEST_NAMESPACE, TEST_PROJECT).then(response => {
return services.getProjectData(TEST_NAMESPACE, TEST_PROJECT).then((response) => {
expect(response).toEqual({ data: { ...projectData, ...gqlProjectData } });
expect(Api.project).toHaveBeenCalledWith(TEST_PROJECT_ID);
expect(query).toHaveBeenCalledWith({
......
......@@ -189,7 +189,7 @@ describe('IDE store file actions', () => {
});
describe('call to service', () => {
const callExpectation = serviceCalled => {
const callExpectation = (serviceCalled) => {
store.dispatch('getFileData', { path: localFile.path });
if (serviceCalled) {
......@@ -422,11 +422,11 @@ describe('IDE store file actions', () => {
loadingWhenGettingRawData = undefined;
loadingWhenGettingBaseRawData = undefined;
jest.spyOn(service, 'getRawFileData').mockImplementation(f => {
jest.spyOn(service, 'getRawFileData').mockImplementation((f) => {
loadingWhenGettingRawData = f.loading;
return Promise.resolve('raw');
});
jest.spyOn(service, 'getBaseRawFileData').mockImplementation(f => {
jest.spyOn(service, 'getBaseRawFileData').mockImplementation((f) => {
loadingWhenGettingBaseRawData = f.loading;
return Promise.resolve('rawBase');
});
......@@ -743,7 +743,7 @@ describe('IDE store file actions', () => {
});
it('returns true when opened', () => {
return store.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }).then(added => {
return store.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }).then((added) => {
expect(added).toBe(true);
});
});
......@@ -755,7 +755,7 @@ describe('IDE store file actions', () => {
key: `pending-${f.key}`,
});
return store.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }).then(added => {
return store.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }).then((added) => {
expect(added).toBe(false);
});
});
......
......@@ -49,7 +49,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests/).reply(200, mockData);
});
it('calls getProjectMergeRequests service method', done => {
it('calls getProjectMergeRequests service method', (done) => {
store
.dispatch('getMergeRequestsForBranch', { projectId: TEST_PROJECT, branchId: 'bar' })
.then(() => {
......@@ -66,7 +66,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('sets the "Merge Request" Object', done => {
it('sets the "Merge Request" Object', (done) => {
store
.dispatch('getMergeRequestsForBranch', { projectId: TEST_PROJECT, branchId: 'bar' })
.then(() => {
......@@ -78,7 +78,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('sets "Current Merge Request" object to the most recent MR', done => {
it('sets "Current Merge Request" object to the most recent MR', (done) => {
store
.dispatch('getMergeRequestsForBranch', { projectId: TEST_PROJECT, branchId: 'bar' })
.then(() => {
......@@ -88,7 +88,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('does nothing if user cannot read MRs', done => {
it('does nothing if user cannot read MRs', (done) => {
store.state.projects[TEST_PROJECT].userPermissions[PERMISSION_READ_MR] = false;
store
......@@ -108,7 +108,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests/).reply(200, []);
});
it('does not fail if there are no merge requests for current branch', done => {
it('does not fail if there are no merge requests for current branch', (done) => {
store
.dispatch('getMergeRequestsForBranch', { projectId: TEST_PROJECT, branchId: 'foo' })
.then(() => {
......@@ -126,7 +126,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests/).networkError();
});
it('flashes message, if error', done => {
it('flashes message, if error', (done) => {
store
.dispatch('getMergeRequestsForBranch', { projectId: TEST_PROJECT, branchId: 'bar' })
.catch(() => {
......@@ -149,7 +149,7 @@ describe('IDE store merge request actions', () => {
.reply(200, { title: 'mergerequest' });
});
it('calls getProjectMergeRequestData service method', done => {
it('calls getProjectMergeRequestData service method', (done) => {
store
.dispatch('getMergeRequestData', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -160,7 +160,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('sets the Merge Request Object', done => {
it('sets the Merge Request Object', (done) => {
store
.dispatch('getMergeRequestData', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -180,7 +180,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests\/1/).networkError();
});
it('dispatches error action', done => {
it('dispatches error action', (done) => {
const dispatch = jest.fn();
getMergeRequestData(
......@@ -224,7 +224,7 @@ describe('IDE store merge request actions', () => {
.reply(200, { title: 'mergerequest' });
});
it('calls getProjectMergeRequestChanges service method', done => {
it('calls getProjectMergeRequestChanges service method', (done) => {
store
.dispatch('getMergeRequestChanges', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -235,7 +235,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('sets the Merge Request Changes Object', done => {
it('sets the Merge Request Changes Object', (done) => {
store
.dispatch('getMergeRequestChanges', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -253,7 +253,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests\/1\/changes/).networkError();
});
it('dispatches error action', done => {
it('dispatches error action', (done) => {
const dispatch = jest.fn();
getMergeRequestChanges(
......@@ -296,7 +296,7 @@ describe('IDE store merge request actions', () => {
jest.spyOn(service, 'getProjectMergeRequestVersions');
});
it('calls getProjectMergeRequestVersions service method', done => {
it('calls getProjectMergeRequestVersions service method', (done) => {
store
.dispatch('getMergeRequestVersions', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -307,7 +307,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('sets the Merge Request Versions Object', done => {
it('sets the Merge Request Versions Object', (done) => {
store
.dispatch('getMergeRequestVersions', { projectId: TEST_PROJECT, mergeRequestId: 1 })
.then(() => {
......@@ -323,7 +323,7 @@ describe('IDE store merge request actions', () => {
mock.onGet(/api\/(.*)\/projects\/abcproject\/merge_requests\/1\/versions/).networkError();
});
it('dispatches error action', done => {
it('dispatches error action', (done) => {
const dispatch = jest.fn();
getMergeRequestVersions(
......@@ -422,7 +422,7 @@ describe('IDE store merge request actions', () => {
);
});
it('dispatches actions for merge request data', done => {
it('dispatches actions for merge request data', (done) => {
openMergeRequest({ state: store.state, dispatch: store.dispatch, getters: mockGetters }, mr)
.then(() => {
expect(store.dispatch.mock.calls).toEqual([
......@@ -451,7 +451,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('updates activity bar view and gets file data, if changes are found', done => {
it('updates activity bar view and gets file data, if changes are found', (done) => {
store.state.entries.foo = {
type: 'blob',
};
......@@ -490,7 +490,7 @@ describe('IDE store merge request actions', () => {
.catch(done.fail);
});
it('flashes message, if error', done => {
it('flashes message, if error', (done) => {
store.dispatch.mockRejectedValue();
openMergeRequest(store, mr)
......
......@@ -53,7 +53,7 @@ describe('IDE store project actions', () => {
});
});
it('calls the service', done => {
it('calls the service', (done) => {
store
.dispatch('refreshLastCommitData', {
projectId: store.state.currentProjectId,
......@@ -67,7 +67,7 @@ describe('IDE store project actions', () => {
.catch(done.fail);
});
it('commits getBranchData', done => {
it('commits getBranchData', (done) => {
testAction(
refreshLastCommitData,
{
......@@ -94,7 +94,7 @@ describe('IDE store project actions', () => {
});
describe('showBranchNotFoundError', () => {
it('dispatches setErrorMessage', done => {
it('dispatches setErrorMessage', (done) => {
testAction(
showBranchNotFoundError,
'master',
......@@ -123,7 +123,7 @@ describe('IDE store project actions', () => {
jest.spyOn(api, 'createBranch').mockResolvedValue();
});
it('calls API', done => {
it('calls API', (done) => {
createNewBranchFromDefault(
{
state: {
......@@ -148,7 +148,7 @@ describe('IDE store project actions', () => {
.catch(done.fail);
});
it('clears error message', done => {
it('clears error message', (done) => {
const dispatchSpy = jest.fn().mockName('dispatch');
createNewBranchFromDefault(
......@@ -172,7 +172,7 @@ describe('IDE store project actions', () => {
.catch(done.fail);
});
it('reloads window', done => {
it('reloads window', (done) => {
createNewBranchFromDefault(
{
state: {
......@@ -196,7 +196,7 @@ describe('IDE store project actions', () => {
});
describe('loadEmptyBranch', () => {
it('creates a blank tree and sets loading state to false', done => {
it('creates a blank tree and sets loading state to false', (done) => {
testAction(
loadEmptyBranch,
{ projectId: TEST_PROJECT_ID, branchId: 'master' },
......@@ -213,7 +213,7 @@ describe('IDE store project actions', () => {
);
});
it('does nothing, if tree already exists', done => {
it('does nothing, if tree already exists', (done) => {
const trees = { [`${TEST_PROJECT_ID}/master`]: [] };
testAction(
......@@ -279,7 +279,7 @@ describe('IDE store project actions', () => {
const branchId = '123-lorem';
const ref = 'abcd2322';
it('when empty repo, loads empty branch', done => {
it('when empty repo, loads empty branch', (done) => {
const mockGetters = { emptyRepo: true };
testAction(
......@@ -292,13 +292,13 @@ describe('IDE store project actions', () => {
);
});
it('when branch already exists, does nothing', done => {
it('when branch already exists, does nothing', (done) => {
store.state.projects[projectId].branches[branchId] = {};
testAction(loadBranch, { projectId, branchId }, store.state, [], [], done);
});
it('fetches branch data', done => {
it('fetches branch data', (done) => {
const mockGetters = { findBranch: () => ({ commit: { id: ref } }) };
jest.spyOn(store, 'dispatch').mockResolvedValue();
......@@ -317,7 +317,7 @@ describe('IDE store project actions', () => {
.catch(done.fail);
});
it('shows an error if branch can not be fetched', done => {
it('shows an error if branch can not be fetched', (done) => {
jest.spyOn(store, 'dispatch').mockReturnValue(Promise.reject());
loadBranch(store, { projectId, branchId })
......@@ -356,7 +356,7 @@ describe('IDE store project actions', () => {
jest.spyOn(store, 'dispatch').mockResolvedValue();
});
it('dispatches branch actions', done => {
it('dispatches branch actions', (done) => {
openBranch(store, branch)
.then(() => {
expect(store.dispatch.mock.calls).toEqual([
......@@ -375,9 +375,9 @@ describe('IDE store project actions', () => {
jest.spyOn(store, 'dispatch').mockReturnValue(Promise.reject());
});
it('dispatches correct branch actions', done => {
it('dispatches correct branch actions', (done) => {
openBranch(store, branch)
.then(val => {
.then((val) => {
expect(store.dispatch.mock.calls).toEqual([
['setCurrentBranchId', branchId],
['loadBranch', { projectId, branchId }],
......
......@@ -68,7 +68,7 @@ describe('Multi-file store tree actions', () => {
);
});
it('adds data into tree', done => {
it('adds data into tree', (done) => {
store
.dispatch('getFiles', basicCallParameters)
.then(() => {
......@@ -93,7 +93,7 @@ describe('Multi-file store tree actions', () => {
});
describe('error', () => {
it('dispatches error action', done => {
it('dispatches error action', (done) => {
const dispatch = jest.fn();
store.state.projects = {
......@@ -148,7 +148,7 @@ describe('Multi-file store tree actions', () => {
store.state.entries[tree.path] = tree;
});
it('toggles the tree open', done => {
it('toggles the tree open', (done) => {
store
.dispatch('toggleTreeOpen', tree.path)
.then(() => {
......@@ -174,7 +174,7 @@ describe('Multi-file store tree actions', () => {
Object.assign(store.state.entries, createEntriesFromPaths(paths));
});
it('opens the parents', done => {
it('opens the parents', (done) => {
testAction(
showTreeEntry,
'grandparent/parent/child.txt',
......@@ -187,7 +187,7 @@ describe('Multi-file store tree actions', () => {
});
describe('setDirectoryData', () => {
it('sets tree correctly if there are no opened files yet', done => {
it('sets tree correctly if there are no opened files yet', (done) => {
const treeFile = file({ name: 'README.md' });
store.state.trees['abcproject/master'] = {};
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ describe('ide/stores/extend', () => {
store = {};
el = {};
[terminalPlugin, terminalSyncPlugin].forEach(x => {
[terminalPlugin, terminalSyncPlugin].forEach((x) => {
const plugin = jest.fn();
x.mockImplementation(() => plugin);
......@@ -28,7 +28,7 @@ describe('ide/stores/extend', () => {
terminalSyncPlugin.mockClear();
});
const withGonFeatures = features => {
const withGonFeatures = (features) => {
global.gon = { ...global.gon, features };
};
......
......@@ -407,7 +407,7 @@ describe('IDE store getters', () => {
${'canCreateMergeRequests'} | ${'createMergeRequestIn'}
${'canPushCode'} | ${'pushCode'}
`('$getterName', ({ getterName, permissionKey }) => {
it.each([true, false])('finds permission for current project (%s)', val => {
it.each([true, false])('finds permission for current project (%s)', (val) => {
localState.projects[TEST_PROJECT_ID] = {
userPermissions: {
[permissionKey]: val,
......
......@@ -84,7 +84,7 @@ describe('IDE store integration', () => {
store.dispatch('commit/updateFilesAfterCommit', { data: {} });
expect(store.state.entries[TEST_PATH]).toEqual(expected);
expect(store.state.entries[TEST_PATH_DIR].tree.find(x => x.path === TEST_PATH)).toEqual(
expect(store.state.entries[TEST_PATH_DIR].tree.find((x) => x.path === TEST_PATH)).toEqual(
expected,
);
});
......
......@@ -42,7 +42,7 @@ describe('IDE branches actions', () => {
});
describe('requestBranches', () => {
it('should commit request', done => {
it('should commit request', (done) => {
testAction(
requestBranches,
null,
......@@ -55,7 +55,7 @@ describe('IDE branches actions', () => {
});
describe('receiveBranchesError', () => {
it('should commit error', done => {
it('should commit error', (done) => {
testAction(
receiveBranchesError,
{ search: TEST_SEARCH },
......@@ -78,7 +78,7 @@ describe('IDE branches actions', () => {
});
describe('receiveBranchesSuccess', () => {
it('should commit received data', done => {
it('should commit received data', (done) => {
testAction(
receiveBranchesSuccess,
branches,
......@@ -110,7 +110,7 @@ describe('IDE branches actions', () => {
});
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchBranches,
{ search: TEST_SEARCH },
......@@ -131,7 +131,7 @@ describe('IDE branches actions', () => {
mock.onGet(/\/api\/v4\/projects\/\d+\/repository\/branches(.*)$/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchBranches,
{ search: TEST_SEARCH },
......@@ -148,7 +148,7 @@ describe('IDE branches actions', () => {
});
describe('resetBranches', () => {
it('commits reset', done => {
it('commits reset', (done) => {
testAction(
resetBranches,
null,
......
......@@ -28,7 +28,7 @@ describe('IDE branches mutations', () => {
describe('RECEIVE_BRANCHES_SUCCESS', () => {
it('sets branches', () => {
const expectedBranches = branches.map(branch => ({
const expectedBranches = branches.map((branch) => ({
name: branch.name,
committedDate: branch.commit.committed_date,
}));
......
......@@ -25,7 +25,7 @@ describe('IDE store module clientside actions', () => {
});
describe('pingUsage', () => {
it('posts to usage endpoint', done => {
it('posts to usage endpoint', (done) => {
const usageSpy = jest.fn(() => [200]);
mock.onPost(TEST_USAGE_URL).reply(() => usageSpy());
......
......@@ -41,7 +41,7 @@ describe('IDE commit module actions', () => {
});
describe('updateCommitMessage', () => {
it('updates store with new commit message', done => {
it('updates store with new commit message', (done) => {
store
.dispatch('commit/updateCommitMessage', 'testing')
.then(() => {
......@@ -53,7 +53,7 @@ describe('IDE commit module actions', () => {
});
describe('discardDraft', () => {
it('resets commit message to blank', done => {
it('resets commit message to blank', (done) => {
store.state.commit.commitMessage = 'testing';
store
......@@ -67,7 +67,7 @@ describe('IDE commit module actions', () => {
});
describe('updateCommitAction', () => {
it('updates store with new commit action', done => {
it('updates store with new commit action', (done) => {
store
.dispatch('commit/updateCommitAction', '1')
.then(() => {
......@@ -123,7 +123,7 @@ describe('IDE commit module actions', () => {
});
});
it('updates commit message with short_id', done => {
it('updates commit message with short_id', (done) => {
store
.dispatch('commit/setLastCommitMessage', { short_id: '123' })
.then(() => {
......@@ -135,7 +135,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('updates commit message with stats', done => {
it('updates commit message with stats', (done) => {
store
.dispatch('commit/setLastCommitMessage', {
short_id: '123',
......@@ -200,12 +200,12 @@ describe('IDE commit module actions', () => {
});
store.state.openFiles = store.state.stagedFiles;
store.state.stagedFiles.forEach(stagedFile => {
store.state.stagedFiles.forEach((stagedFile) => {
store.state.entries[stagedFile.path] = stagedFile;
});
});
it('updates stores working reference', done => {
it('updates stores working reference', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -218,14 +218,14 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('resets all files changed status', done => {
it('resets all files changed status', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
branch,
})
.then(() => {
store.state.openFiles.forEach(entry => {
store.state.openFiles.forEach((entry) => {
expect(entry.changed).toBeFalsy();
});
})
......@@ -233,7 +233,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sets files commit data', done => {
it('sets files commit data', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -246,7 +246,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('updates raw content for changed file', done => {
it('updates raw content for changed file', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -259,7 +259,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('emits changed event for file', done => {
it('emits changed event for file', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -319,7 +319,7 @@ describe('IDE commit module actions', () => {
store.state.commit.commitAction = '2';
store.state.commit.commitMessage = 'testing 123';
store.state.openFiles.forEach(localF => {
store.state.openFiles.forEach((localF) => {
store.state.entries[localF.path] = localF;
});
});
......@@ -345,7 +345,7 @@ describe('IDE commit module actions', () => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
});
it('calls service', done => {
it('calls service', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -370,7 +370,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sends lastCommit ID when not creating new branch', done => {
it('sends lastCommit ID when not creating new branch', (done) => {
store.state.commit.commitAction = '1';
store
......@@ -397,7 +397,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sets last Commit Msg', done => {
it('sets last Commit Msg', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -410,7 +410,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('adds commit data to files', done => {
it('adds commit data to files', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -423,7 +423,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('resets stores commit actions', done => {
it('resets stores commit actions', (done) => {
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
store
......@@ -435,7 +435,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('removes all staged files', done => {
it('removes all staged files', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -446,7 +446,7 @@ describe('IDE commit module actions', () => {
});
describe('merge request', () => {
it('redirects to new merge request page', done => {
it('redirects to new merge request page', (done) => {
jest.spyOn(eventHub, '$on').mockImplementation();
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
......@@ -464,7 +464,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('does not redirect to new merge request page when shouldCreateMR is not checked', done => {
it('does not redirect to new merge request page when shouldCreateMR is not checked', (done) => {
jest.spyOn(eventHub, '$on').mockImplementation();
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
......@@ -510,7 +510,7 @@ describe('IDE commit module actions', () => {
});
});
it('shows failed message', done => {
it('shows failed message', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -556,7 +556,7 @@ describe('IDE commit module actions', () => {
},
};
it('commits TOGGLE_EMPTY_STATE mutation on empty repo', done => {
it('commits TOGGLE_EMPTY_STATE mutation on empty repo', (done) => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
jest.spyOn(store, 'commit');
......@@ -573,7 +573,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', done => {
it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', (done) => {
COMMIT_RESPONSE.parent_ids.push('1234');
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
jest.spyOn(store, 'commit');
......@@ -594,7 +594,7 @@ describe('IDE commit module actions', () => {
});
describe('toggleShouldCreateMR', () => {
it('commits both toggle and interacting with MR checkbox actions', done => {
it('commits both toggle and interacting with MR checkbox actions', (done) => {
testAction(
actions.toggleShouldCreateMR,
{},
......
......@@ -103,7 +103,7 @@ describe('IDE commit module getters', () => {
expect(getters.preBuiltCommitMessage(state, null, rootState)).toBe('test commit message');
});
['changedFiles', 'stagedFiles'].forEach(key => {
['changedFiles', 'stagedFiles'].forEach((key) => {
it('returns commitMessage with updated file', () => {
rootState[key].push({
path: 'test-file',
......
......@@ -20,7 +20,7 @@ describe('IDE file templates actions', () => {
});
describe('requestTemplateTypes', () => {
it('commits REQUEST_TEMPLATE_TYPES', done => {
it('commits REQUEST_TEMPLATE_TYPES', (done) => {
testAction(
actions.requestTemplateTypes,
null,
......@@ -33,7 +33,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateTypesError', () => {
it('commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage', done => {
it('commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage', (done) => {
testAction(
actions.receiveTemplateTypesError,
null,
......@@ -55,7 +55,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateTypesSuccess', () => {
it('commits RECEIVE_TEMPLATE_TYPES_SUCCESS', done => {
it('commits RECEIVE_TEMPLATE_TYPES_SUCCESS', (done) => {
testAction(
actions.receiveTemplateTypesSuccess,
'test',
......@@ -81,7 +81,7 @@ describe('IDE file templates actions', () => {
});
});
it('rejects if selectedTemplateType is empty', done => {
it('rejects if selectedTemplateType is empty', (done) => {
const dispatch = jest.fn().mockName('dispatch');
actions
......@@ -94,7 +94,7 @@ describe('IDE file templates actions', () => {
});
});
it('dispatches actions', done => {
it('dispatches actions', (done) => {
state.selectedTemplateType = { key: 'licenses' };
testAction(
......@@ -121,7 +121,7 @@ describe('IDE file templates actions', () => {
mock.onGet(/api\/(.*)\/templates\/licenses/).replyOnce(500);
});
it('dispatches actions', done => {
it('dispatches actions', (done) => {
state.selectedTemplateType = { key: 'licenses' };
testAction(
......@@ -184,7 +184,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateError', () => {
it('dispatches setErrorMessage', done => {
it('dispatches setErrorMessage', (done) => {
testAction(
actions.receiveTemplateError,
'test',
......@@ -217,7 +217,7 @@ describe('IDE file templates actions', () => {
.replyOnce(200, { content: 'testing content' });
});
it('dispatches setFileTemplate if template already has content', done => {
it('dispatches setFileTemplate if template already has content', (done) => {
const template = { content: 'already has content' };
testAction(
......@@ -230,7 +230,7 @@ describe('IDE file templates actions', () => {
);
});
it('dispatches success', done => {
it('dispatches success', (done) => {
const template = { key: 'mit' };
state.selectedTemplateType = { key: 'licenses' };
......@@ -245,7 +245,7 @@ describe('IDE file templates actions', () => {
);
});
it('dispatches success and uses name key for API call', done => {
it('dispatches success and uses name key for API call', (done) => {
const template = { name: 'testing' };
state.selectedTemplateType = { key: 'licenses' };
......@@ -266,7 +266,7 @@ describe('IDE file templates actions', () => {
mock.onGet(/api\/(.*)\/templates\/licenses\/mit/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
const template = { name: 'testing' };
state.selectedTemplateType = { key: 'licenses' };
......
......@@ -28,7 +28,7 @@ describe('IDE merge requests actions', () => {
});
describe('requestMergeRequests', () => {
it('should commit request', done => {
it('should commit request', (done) => {
testAction(
requestMergeRequests,
null,
......@@ -41,7 +41,7 @@ describe('IDE merge requests actions', () => {
});
describe('receiveMergeRequestsError', () => {
it('should commit error', done => {
it('should commit error', (done) => {
testAction(
receiveMergeRequestsError,
{ type: 'created', search: '' },
......@@ -64,7 +64,7 @@ describe('IDE merge requests actions', () => {
});
describe('receiveMergeRequestsSuccess', () => {
it('should commit received data', done => {
it('should commit received data', (done) => {
testAction(
receiveMergeRequestsSuccess,
mergeRequests,
......@@ -118,7 +118,7 @@ describe('IDE merge requests actions', () => {
});
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchMergeRequests,
{ type: 'created' },
......@@ -156,7 +156,7 @@ describe('IDE merge requests actions', () => {
);
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchMergeRequests,
{ type: null },
......@@ -177,7 +177,7 @@ describe('IDE merge requests actions', () => {
mock.onGet(/\/api\/v4\/merge_requests(.*)$/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchMergeRequests,
{ type: 'created', search: '' },
......@@ -195,7 +195,7 @@ describe('IDE merge requests actions', () => {
});
describe('resetMergeRequests', () => {
it('commits reset', done => {
it('commits reset', (done) => {
testAction(
resetMergeRequests,
null,
......
......@@ -7,18 +7,18 @@ describe('IDE pane module actions', () => {
const TEST_VIEW_KEEP_ALIVE = { name: 'test-keep-alive', keepAlive: true };
describe('toggleOpen', () => {
it('dispatches open if closed', done => {
it('dispatches open if closed', (done) => {
testAction(actions.toggleOpen, TEST_VIEW, { isOpen: false }, [], [{ type: 'open' }], done);
});
it('dispatches close if opened', done => {
it('dispatches close if opened', (done) => {
testAction(actions.toggleOpen, TEST_VIEW, { isOpen: true }, [], [{ type: 'close' }], done);
});
});
describe('open', () => {
describe('with a view specified', () => {
it('commits SET_OPEN and SET_CURRENT_VIEW', done => {
it('commits SET_OPEN and SET_CURRENT_VIEW', (done) => {
testAction(
actions.open,
TEST_VIEW,
......@@ -32,7 +32,7 @@ describe('IDE pane module actions', () => {
);
});
it('commits KEEP_ALIVE_VIEW if keepAlive is true', done => {
it('commits KEEP_ALIVE_VIEW if keepAlive is true', (done) => {
testAction(
actions.open,
TEST_VIEW_KEEP_ALIVE,
......@@ -49,7 +49,7 @@ describe('IDE pane module actions', () => {
});
describe('without a view specified', () => {
it('commits SET_OPEN', done => {
it('commits SET_OPEN', (done) => {
testAction(
actions.open,
undefined,
......@@ -63,7 +63,7 @@ describe('IDE pane module actions', () => {
});
describe('close', () => {
it('commits SET_OPEN', done => {
it('commits SET_OPEN', (done) => {
testAction(actions.close, null, {}, [{ type: types.SET_OPEN, payload: false }], [], done);
});
});
......
......@@ -44,7 +44,7 @@ describe('IDE pipelines actions', () => {
});
describe('requestLatestPipeline', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(
requestLatestPipeline,
null,
......@@ -57,7 +57,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveLatestPipelineError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveLatestPipelineError,
{ status: 404 },
......@@ -68,7 +68,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches setErrorMessage is not 404', done => {
it('dispatches setErrorMessage is not 404', (done) => {
testAction(
receiveLatestPipelineError,
{ status: 500 },
......@@ -123,7 +123,7 @@ describe('IDE pipelines actions', () => {
.reply(200, { data: { foo: 'bar' } }, { 'poll-interval': '10000' });
});
it('dispatches request', done => {
it('dispatches request', (done) => {
jest.spyOn(axios, 'get');
jest.spyOn(Visibility, 'hidden').mockReturnValue(false);
......@@ -139,7 +139,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(1000);
new Promise(resolve => requestAnimationFrame(resolve))
new Promise((resolve) => requestAnimationFrame(resolve))
.then(() => {
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalledTimes(1);
......@@ -150,7 +150,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(10000);
})
.then(() => new Promise(resolve => requestAnimationFrame(resolve)))
.then(() => new Promise((resolve) => requestAnimationFrame(resolve)))
.then(() => {
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalledTimes(2);
......@@ -169,7 +169,7 @@ describe('IDE pipelines actions', () => {
mock.onGet('/abc/def/commit/abc123def456ghi789jkl/pipelines').reply(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
const dispatch = jest.fn().mockName('dispatch');
const rootGetters = {
lastCommit: { id: 'abc123def456ghi789jkl' },
......@@ -180,7 +180,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(1500);
new Promise(resolve => requestAnimationFrame(resolve))
new Promise((resolve) => requestAnimationFrame(resolve))
.then(() => {
expect(dispatch).toHaveBeenCalledWith('receiveLatestPipelineError', expect.anything());
})
......@@ -191,13 +191,13 @@ describe('IDE pipelines actions', () => {
});
describe('requestJobs', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(requestJobs, 1, mockedState, [{ type: types.REQUEST_JOBS, payload: 1 }], [], done);
});
});
describe('receiveJobsError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveJobsError,
{ id: 1 },
......@@ -220,7 +220,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveJobsSuccess', () => {
it('commits data', done => {
it('commits data', (done) => {
testAction(
receiveJobsSuccess,
{ id: 1, data: jobs },
......@@ -240,7 +240,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(stage.dropdownPath).replyOnce(200, jobs);
});
it('dispatches request', done => {
it('dispatches request', (done) => {
testAction(
fetchJobs,
stage,
......@@ -260,7 +260,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(stage.dropdownPath).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchJobs,
stage,
......@@ -277,7 +277,7 @@ describe('IDE pipelines actions', () => {
});
describe('toggleStageCollapsed', () => {
it('commits collapse', done => {
it('commits collapse', (done) => {
testAction(
toggleStageCollapsed,
1,
......@@ -290,7 +290,7 @@ describe('IDE pipelines actions', () => {
});
describe('setDetailJob', () => {
it('commits job', done => {
it('commits job', (done) => {
testAction(
setDetailJob,
'job',
......@@ -301,7 +301,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches rightPane/open as pipeline when job is null', done => {
it('dispatches rightPane/open as pipeline when job is null', (done) => {
testAction(
setDetailJob,
null,
......@@ -312,7 +312,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches rightPane/open as job', done => {
it('dispatches rightPane/open as job', (done) => {
testAction(
setDetailJob,
'job',
......@@ -325,13 +325,13 @@ describe('IDE pipelines actions', () => {
});
describe('requestJobLogs', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(requestJobLogs, null, mockedState, [{ type: types.REQUEST_JOB_LOGS }], [], done);
});
});
describe('receiveJobLogsError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveJobLogsError,
null,
......@@ -354,7 +354,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveJobLogsSuccess', () => {
it('commits data', done => {
it('commits data', (done) => {
testAction(
receiveJobLogsSuccess,
'data',
......@@ -377,7 +377,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(`${TEST_HOST}/project/builds/trace`).replyOnce(200, { html: 'html' });
});
it('dispatches request', done => {
it('dispatches request', (done) => {
testAction(
fetchJobLogs,
null,
......@@ -408,7 +408,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(`${TEST_HOST}/project/builds/trace`).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchJobLogs,
null,
......@@ -422,7 +422,7 @@ describe('IDE pipelines actions', () => {
});
describe('resetLatestPipeline', () => {
it('commits reset mutations', done => {
it('commits reset mutations', (done) => {
testAction(
resetLatestPipeline,
null,
......
......@@ -137,7 +137,7 @@ describe('IDE pipelines mutations', () => {
mutations[types.RECEIVE_JOBS_SUCCESS](mockedState, { id: mockedState.stages[0].id, data });
expect(mockedState.stages[0].jobs.length).toBe(jobs.length);
expect(mockedState.stages[0].jobs).toEqual(
jobs.map(job => ({
jobs.map((job) => ({
id: job.id,
name: job.name,
status: job.status,
......
......@@ -102,7 +102,7 @@ describe('IDE store terminal check actions', () => {
);
});
[httpStatus.FORBIDDEN, httpStatus.NOT_FOUND].forEach(status => {
[httpStatus.FORBIDDEN, httpStatus.NOT_FOUND].forEach((status) => {
it(`hides tab, when status is ${status}`, () => {
const payload = { response: { status } };
......
......@@ -281,7 +281,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[httpStatus.NOT_FOUND, httpStatus.UNPROCESSABLE_ENTITY].forEach(status => {
[httpStatus.NOT_FOUND, httpStatus.UNPROCESSABLE_ENTITY].forEach((status) => {
it(`dispatches request and startSession on ${status}`, () => {
mock
.onPost(state.session.retryPath, { branch: rootState.currentBranchId, format: 'json' })
......
......@@ -98,7 +98,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[STOPPING, STOPPED, 'unexpected'].forEach(status => {
[STOPPING, STOPPED, 'unexpected'].forEach((status) => {
it(`kills session if status is ${status}`, () => {
return testAction(
actions.receiveSessionStatusSuccess,
......
......@@ -22,7 +22,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe('upload', () => {
it('uploads to mirror and sets success', done => {
it('uploads to mirror and sets success', (done) => {
mirror.upload.mockReturnValue(Promise.resolve());
testAction(
......@@ -38,7 +38,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
);
});
it('sets error when failed', done => {
it('sets error when failed', (done) => {
const err = { message: 'it failed!' };
mirror.upload.mockReturnValue(Promise.reject(err));
......@@ -54,7 +54,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe('stop', () => {
it('disconnects from mirror', done => {
it('disconnects from mirror', (done) => {
testAction(actions.stop, null, rootState, [{ type: types.STOP }], [], () => {
expect(mirror.disconnect).toHaveBeenCalled();
done();
......@@ -83,7 +83,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
};
});
it('connects to mirror and sets success', done => {
it('connects to mirror and sets success', (done) => {
mirror.connect.mockReturnValue(Promise.resolve());
testAction(
......
......@@ -128,7 +128,7 @@ describe('IDE store file mutations', () => {
localState.changedFiles[0],
localState.openFiles[0],
localFile,
].forEach(f => {
].forEach((f) => {
expect(f).toEqual(
expect.objectContaining({
path,
......@@ -142,7 +142,7 @@ describe('IDE store file mutations', () => {
});
describe('SET_FILE_RAW_DATA', () => {
const callMutationForFile = f => {
const callMutationForFile = (f) => {
mutations.SET_FILE_RAW_DATA(localState, {
file: f,
raw: 'testing',
......
......@@ -17,7 +17,7 @@ describe('~/ide/sync_router_and_store', () => {
const getRouterCurrentPath = () => router.currentRoute.fullPath;
const getStoreCurrentPath = () => store.state.router.fullPath;
const updateRouter = async path => {
const updateRouter = async (path) => {
if (getRouterCurrentPath() === path) {
return;
}
......@@ -25,7 +25,7 @@ describe('~/ide/sync_router_and_store', () => {
router.push(path);
await waitForPromises();
};
const updateStore = path => {
const updateStore = (path) => {
store.dispatch('router/push', path);
return waitForPromises();
};
......
......@@ -263,7 +263,7 @@ describe('WebIDE utils', () => {
it('reads a file and returns its output as a data url', () => {
const file = new File(['foo'], 'foo.png', { type: 'image/png' });
return readFileAsDataURL(file).then(contents => {
return readFileAsDataURL(file).then((contents) => {
expect(contents).toBe('data:image/png;base64,Zm9v');
});
});
......
......@@ -11,7 +11,7 @@ describe('initDiscussionTab', () => {
`);
});
it('should pass canCreateNote as false to initImageDiff', done => {
it('should pass canCreateNote as false to initImageDiff', (done) => {
jest
.spyOn(initImageDiffHelper, 'initImageDiff')
.mockImplementation((diffFileEl, canCreateNote) => {
......@@ -22,7 +22,7 @@ describe('initDiscussionTab', () => {
initDiscussionTab();
});
it('should pass renderCommentBadge as true to initImageDiff', done => {
it('should pass renderCommentBadge as true to initImageDiff', (done) => {
jest
.spyOn(initImageDiffHelper, 'initImageDiff')
.mockImplementation((diffFileEl, canCreateNote, renderCommentBadge) => {
......
......@@ -176,8 +176,8 @@ describe('ReplacedImageDiff', () => {
expect(ImageDiff.prototype.bindEvents).toHaveBeenCalled();
});
it('should register click eventlistener to 2-up view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to 2-up view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.TWO_UP);
done();
});
......@@ -186,8 +186,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.viewModesEls[viewTypes.TWO_UP].click();
});
it('should register click eventlistener to swipe view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to swipe view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.SWIPE);
done();
});
......@@ -196,8 +196,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.viewModesEls[viewTypes.SWIPE].click();
});
it('should register click eventlistener to onion skin view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to onion skin view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.SWIPE);
done();
});
......@@ -325,7 +325,7 @@ describe('ReplacedImageDiff', () => {
setupImageFrameEls();
});
it('should pass showCommentIndicator normalized indicator values', done => {
it('should pass showCommentIndicator normalized indicator values', (done) => {
jest.spyOn(imageDiffHelper, 'showCommentIndicator').mockImplementation(() => {});
jest
.spyOn(imageDiffHelper, 'resizeCoordinatesToImageElement')
......@@ -339,7 +339,7 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.renderNewView(indicator);
});
it('should call showCommentIndicator', done => {
it('should call showCommentIndicator', (done) => {
const normalized = {
normalized: true,
};
......
......@@ -5,7 +5,7 @@ import ImportTableRow from '~/import_entities/import_groups/components/import_ta
import { STATUSES } from '~/import_entities/constants';
import { availableNamespacesFixture } from '../graphql/fixtures';
const getFakeGroup = status => ({
const getFakeGroup = (status) => ({
web_url: 'https://fake.host/',
full_path: 'fake_group_1',
full_name: 'fake_name_1',
......@@ -22,13 +22,13 @@ describe('import table row', () => {
let group;
const findByText = (cmp, text) => {
return wrapper.findAll(cmp).wrappers.find(node => node.text().indexOf(text) === 0);
return wrapper.findAll(cmp).wrappers.find((node) => node.text().indexOf(text) === 0);
};
const findImportButton = () => findByText(GlButton, 'Import');
const findNameInput = () => wrapper.find(GlFormInput);
const findNamespaceDropdown = () => wrapper.find(Select2Select);
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(ImportTableRow, {
propsData: {
availableNamespaces: availableNamespacesFixture,
......
......@@ -63,7 +63,7 @@ describe('Bulk import resolvers', () => {
});
it('mirrors REST endpoint response fields', () => {
const extractRelevantFields = obj => ({ id: obj.id, full_path: obj.full_path });
const extractRelevantFields = (obj) => ({ id: obj.id, full_path: obj.full_path });
expect(results.map(extractRelevantFields)).toStrictEqual(
availableNamespacesFixture.map(extractRelevantFields),
......@@ -89,20 +89,20 @@ describe('Bulk import resolvers', () => {
expect(
results.every((r, idx) =>
MIRRORED_FIELDS.every(
field => r[field] === statusEndpointFixture.importable_data[idx][field],
(field) => r[field] === statusEndpointFixture.importable_data[idx][field],
),
),
).toBe(true);
});
it('populates each result instance with status field default to none', () => {
expect(results.every(r => r.status === STATUSES.NONE)).toBe(true);
expect(results.every((r) => r.status === STATUSES.NONE)).toBe(true);
});
it('populates each result instance with import_target defaulted to first available namespace', () => {
expect(
results.every(
r => r.import_target.target_namespace === availableNamespacesFixture[0].full_path,
(r) => r.import_target.target_namespace === availableNamespacesFixture[0].full_path,
),
).toBe(true);
});
......
......@@ -27,7 +27,7 @@ describe('ImportProjectsTable', () => {
const findImportAllButton = () =>
wrapper
.findAll(GlButton)
.filter(w => w.props().variant === 'success')
.filter((w) => w.props().variant === 'success')
.at(0);
const findImportAllModal = () => wrapper.find({ ref: 'importAllModal' });
......@@ -112,7 +112,7 @@ describe('ImportProjectsTable', () => {
expect(
wrapper
.findAll('th')
.filter(w => w.text() === `From ${providerTitle}`)
.filter((w) => w.text() === `From ${providerTitle}`)
.exists(),
).toBe(true);
......
......@@ -34,7 +34,7 @@ describe('ProviderRepoTableRow', () => {
}
const findImportButton = () => {
const buttons = wrapper.findAll('button').filter(node => node.text() === 'Import');
const buttons = wrapper.findAll('button').filter((node) => node.text() === 'Import');
return buttons.length ? buttons.at(0) : buttons;
};
......
......@@ -123,7 +123,7 @@ describe('import_projects store actions', () => {
it('includes page in url query params', async () => {
let requestedUrl;
mock.onGet().reply(config => {
mock.onGet().reply((config) => {
requestedUrl = config.url;
return [200, payload];
});
......
......@@ -39,7 +39,7 @@ describe('IncidentsSettingTabs', () => {
});
it('should render the tab for each active integration', () => {
const activeTabs = wrapper.vm.$options.tabs.filter(tab => tab.active);
const activeTabs = wrapper.vm.$options.tabs.filter((tab) => tab.active);
expect(findIntegrationTabs().length).toBe(activeTabs.length);
activeTabs.forEach((tab, index) => {
expect(findIntegrationTabs().at(index).attributes('title')).toBe(tab.title);
......
......@@ -12,7 +12,7 @@ describe('JiraIssuesFields', () => {
editProjectPath: '/edit',
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = mount(JiraIssuesFields, {
propsData: { ...defaultProps, ...props },
});
......
......@@ -104,11 +104,11 @@ describe('JiraTriggerFields', () => {
true,
);
wrapper.findAll('[type=checkbox]').wrappers.forEach(checkbox => {
wrapper.findAll('[type=checkbox]').wrappers.forEach((checkbox) => {
expect(checkbox.attributes('disabled')).toBe('disabled');
});
wrapper.findAll('[type=radio]').wrappers.forEach(radio => {
wrapper.findAll('[type=radio]').wrappers.forEach((radio) => {
expect(radio.attributes('disabled')).toBe('disabled');
});
});
......
......@@ -29,7 +29,7 @@ describe('TriggerFields', () => {
const findAllGlFormCheckboxes = () => wrapper.findAll(GlFormCheckbox);
const findAllGlFormInputs = () => wrapper.findAll(GlFormInput);
describe.each([true, false])('template, isInheriting = `%p`', isInheriting => {
describe.each([true, false])('template, isInheriting = `%p`', (isInheriting) => {
it('renders a label with text "Trigger"', () => {
createComponent();
......
......@@ -130,8 +130,8 @@ describe('RelatedIssuesBlock', () => {
describe('showCategorizedIssues prop', () => {
const issueList = () => wrapper.findAll('.js-related-issues-token-list-item');
const categorizedHeadings = () => wrapper.findAll('h4');
const headingTextAt = index => categorizedHeadings().at(index).text();
const mountComponent = showCategorizedIssues => {
const headingTextAt = (index) => categorizedHeadings().at(index).text();
const mountComponent = (showCategorizedIssues) => {
wrapper = mount(RelatedIssuesBlock, {
propsData: {
pathIdSeparator: PathIdSeparator.Issue,
......
......@@ -135,7 +135,7 @@ describe('IssuableBody', () => {
it.each(['keydown-title', 'keydown-description'])(
'component emits `%s` event with event object and issuableMeta params via issuable-edit-form',
async eventName => {
async (eventName) => {
const eventObj = {
preventDefault: jest.fn(),
stopPropagation: jest.fn(),
......
......@@ -28,7 +28,7 @@ const createComponent = ({ propsData = issuableEditFormProps } = {}) =>
describe('IssuableEditForm', () => {
let wrapper;
const assertEvent = eventSpy => {
const assertEvent = (eventSpy) => {
expect(eventSpy).toHaveBeenNthCalledWith(1, 'update.issuable', expect.any(Function));
expect(eventSpy).toHaveBeenNthCalledWith(2, 'close.form', expect.any(Function));
};
......
......@@ -24,7 +24,7 @@ const createComponent = (propsData = issuableHeaderProps) =>
describe('IssuableHeader', () => {
let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
beforeEach(() => {
wrapper = createComponent();
......
......@@ -121,7 +121,7 @@ describe('IssuableShowRoot', () => {
it.each(['keydown-title', 'keydown-description'])(
'component emits `%s` event with event object and issuableMeta params via issuable-body',
eventName => {
(eventName) => {
const eventObj = {
preventDefault: jest.fn(),
stopPropagation: jest.fn(),
......
......@@ -49,7 +49,7 @@ describe('Issuable', () => {
mock.restore();
});
it('should send request to reset email token', done => {
it('should send request to reset email token', (done) => {
jest.spyOn(axios, 'put');
document.querySelector('.incoming-email-token-reset').click();
......
......@@ -398,8 +398,8 @@ describe('Issuable output', () => {
wrapper.vm.poll.makeRequest();
return new Promise(resolve => {
wrapper.vm.$watch('formState.lockedWarningVisible', value => {
return new Promise((resolve) => {
wrapper.vm.$watch('formState.lockedWarningVisible', (value) => {
if (value) {
resolve();
}
......
......@@ -74,7 +74,7 @@ describe('Description component', () => {
let modal;
const recaptchaChild = vm.$children.find(
// eslint-disable-next-line no-underscore-dangle
child => child.$options._componentTag === 'recaptcha-modal',
(child) => child.$options._componentTag === 'recaptcha-modal',
);
recaptchaChild.scriptSrc = '//scriptsrc';
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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