Commit 8675dcbc authored by Mike Greiling's avatar Mike Greiling

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

Format files with prettier arrowParens [12/15]

See merge request gitlab-org/gitlab!50540
parents 95805515 6456cf88
......@@ -880,187 +880,6 @@ ee/app/assets/javascripts/vulnerabilities/components/resolution_alert.vue
ee/app/assets/javascripts/vulnerabilities/helpers.js
ee/app/assets/javascripts/vulnerabilities/vulnerabilities_init.js
## eager-lamport
spec/frontend/behaviors/shortcuts/keybindings_spec.js
spec/frontend/behaviors/shortcuts/shortcuts_issuable_spec.js
spec/frontend/blob/components/blob_content_error_spec.js
spec/frontend/blob/components/blob_edit_content_spec.js
spec/frontend/blob/components/blob_edit_header_spec.js
spec/frontend/blob/components/blob_header_spec.js
spec/frontend/blob/sketch/index_spec.js
spec/frontend/blob/utils_spec.js
spec/frontend/blob/viewer/index_spec.js
spec/frontend/blob_edit/edit_blob_spec.js
spec/frontend/boards/board_list_new_spec.js
spec/frontend/boards/board_list_spec.js
spec/frontend/boards/boards_store_spec.js
spec/frontend/boards/components/board_assignee_dropdown_spec.js
spec/frontend/boards/components/board_card_layout_spec.js
spec/frontend/boards/components/board_card_spec.js
spec/frontend/boards/components/board_configuration_options_spec.js
spec/frontend/boards/components/board_list_header_new_spec.js
spec/frontend/boards/components/board_list_header_spec.js
spec/frontend/boards/components/boards_selector_spec.js
spec/frontend/boards/components/issue_count_spec.js
spec/frontend/boards/components/issue_due_date_spec.js
spec/frontend/boards/components/issue_time_estimate_deprecated_spec.js
spec/frontend/boards/components/issue_time_estimate_spec.js
spec/frontend/boards/components/sidebar/board_sidebar_subscription_spec.js
spec/frontend/boards/components/sidebar/remove_issue_spec.js
spec/frontend/boards/issue_card_deprecated_spec.js
spec/frontend/boards/issue_card_inner_spec.js
spec/frontend/boards/list_spec.js
spec/frontend/boards/mock_data.js
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/getters_spec.js
spec/frontend/boards/stores/mutations_spec.js
## busy-mayer
spec/frontend/branches/branches_delete_modal_spec.js
spec/frontend/ci_settings_pipeline_triggers/components/triggers_list_spec.js
spec/frontend/ci_variable_list/components/ci_environments_dropdown_spec.js
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
spec/frontend/ci_variable_list/components/ci_variable_settings_spec.js
spec/frontend/ci_variable_list/store/actions_spec.js
spec/frontend/clusters/clusters_bundle_spec.js
spec/frontend/clusters/components/application_row_spec.js
spec/frontend/clusters/components/applications_spec.js
spec/frontend/clusters/components/fluentd_output_settings_spec.js
spec/frontend/clusters/services/application_state_machine_spec.js
spec/frontend/clusters_list/components/node_error_help_text_spec.js
spec/frontend/clusters_list/store/actions_spec.js
spec/frontend/code_navigation/store/actions_spec.js
spec/frontend/collapsed_sidebar_todo_spec.js
spec/frontend/commit/commit_pipeline_status_component_spec.js
spec/frontend/commit/pipelines/pipelines_spec.js
spec/frontend/commits_spec.js
spec/frontend/confirm_modal_spec.js
spec/frontend/contributors/store/actions_spec.js
spec/frontend/create_cluster/eks_cluster/components/eks_cluster_configuration_form_spec.js
spec/frontend/create_cluster/eks_cluster/store/actions_spec.js
spec/frontend/create_cluster/eks_cluster/store/getters_spec.js
spec/frontend/create_cluster/eks_cluster/store/mutations_spec.js
spec/frontend/create_cluster/gke_cluster/helpers.js
spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js
spec/frontend/create_cluster/gke_cluster_namespace/gke_cluster_namespace_spec.js
spec/frontend/create_cluster/store/cluster_dropdown/mutations_spec.js
spec/frontend/create_item_dropdown_spec.js
spec/frontend/create_merge_request_dropdown_spec.js
spec/frontend/custom_metrics/components/custom_metrics_form_fields_spec.js
## eloquent-black
spec/frontend/cycle_analytics/limit_warning_component_spec.js
spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js
spec/frontend/deploy_keys/components/key_spec.js
spec/frontend/deploy_keys/components/keys_panel_spec.js
spec/frontend/deprecated_jquery_dropdown_spec.js
spec/frontend/design_management/components/design_notes/design_discussion_spec.js
spec/frontend/design_management/components/design_overlay_spec.js
spec/frontend/design_management/components/design_scaler_spec.js
spec/frontend/design_management/components/upload/design_version_dropdown_spec.js
spec/frontend/design_management/pages/index_spec.js
spec/frontend/design_management/router_spec.js
spec/frontend/design_management/utils/error_messages_spec.js
spec/frontend/diffs/components/app_spec.js
spec/frontend/diffs/components/compare_dropdown_layout_spec.js
spec/frontend/diffs/components/compare_versions_spec.js
spec/frontend/diffs/components/diff_content_spec.js
spec/frontend/diffs/components/diff_discussions_spec.js
spec/frontend/diffs/components/diff_expansion_cell_spec.js
spec/frontend/diffs/components/diff_file_spec.js
spec/frontend/diffs/components/diff_line_note_form_spec.js
spec/frontend/diffs/components/diff_stats_spec.js
spec/frontend/diffs/components/diff_view_spec.js
spec/frontend/diffs/components/image_diff_overlay_spec.js
spec/frontend/diffs/components/no_changes_spec.js
spec/frontend/diffs/components/parallel_diff_table_row_spec.js
spec/frontend/diffs/components/settings_dropdown_spec.js
spec/frontend/diffs/store/actions_spec.js
spec/frontend/diffs/store/getters_versions_dropdowns_spec.js
spec/frontend/diffs/store/utils_spec.js
spec/frontend/diffs/utils/uuids_spec.js
spec/frontend/dirty_submit/dirty_submit_collection_spec.js
spec/frontend/dirty_submit/dirty_submit_form_spec.js
## exciting-driscoll
spec/frontend/droplab/drop_down_spec.js
spec/frontend/droplab/plugins/ajax_filter_spec.js
spec/frontend/editor/editor_lite_extension_base_spec.js
spec/frontend/editor/editor_lite_spec.js
spec/frontend/editor/editor_markdown_ext_spec.js
spec/frontend/emoji/emoji_spec.js
spec/frontend/environment.js
spec/frontend/environments/environment_actions_spec.js
spec/frontend/environments/environment_table_spec.js
spec/frontend/environments/environment_terminal_button_spec.js
spec/frontend/environments/folder/environments_folder_view_spec.js
spec/frontend/error_tracking/components/error_details_spec.js
spec/frontend/error_tracking/components/error_tracking_list_spec.js
spec/frontend/error_tracking/store/actions_spec.js
spec/frontend/error_tracking/store/details/actions_spec.js
spec/frontend/error_tracking/store/list/actions_spec.js
spec/frontend/error_tracking_settings/store/actions_spec.js
spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
spec/frontend/feature_flags/components/edit_feature_flag_spec.js
spec/frontend/feature_flags/components/environments_dropdown_spec.js
spec/frontend/feature_flags/components/feature_flags_spec.js
spec/frontend/feature_flags/components/form_spec.js
spec/frontend/feature_flags/components/new_environments_dropdown_spec.js
spec/frontend/feature_flags/components/strategies/gitlab_user_list_spec.js
spec/frontend/feature_flags/components/user_lists_table_spec.js
spec/frontend/feature_flags/store/edit/actions_spec.js
spec/frontend/feature_flags/store/index/actions_spec.js
spec/frontend/feature_flags/store/index/mutations_spec.js
spec/frontend/feature_flags/store/new/actions_spec.js
spec/frontend/feature_highlight/feature_highlight_helper_spec.js
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
## determined-blackburn
spec/frontend/filtered_search/filtered_search_manager_spec.js
spec/frontend/filtered_search/filtered_search_token_keys_spec.js
spec/frontend/filtered_search/filtered_search_visual_tokens_spec.js
spec/frontend/filtered_search/issues_filtered_search_token_keys_spec.js
spec/frontend/filtered_search/recent_searches_root_spec.js
spec/frontend/filtered_search/services/recent_searches_service_spec.js
spec/frontend/filtered_search/visual_token_value_spec.js
spec/frontend/flash_spec.js
spec/frontend/frequent_items/components/app_spec.js
spec/frontend/frequent_items/components/frequent_items_list_item_spec.js
spec/frontend/frequent_items/components/frequent_items_search_input_spec.js
spec/frontend/frequent_items/store/actions_spec.js
spec/frontend/gfm_auto_complete_spec.js
spec/frontend/gl_field_errors_spec.js
spec/frontend/gl_form_spec.js
spec/frontend/gpg_badges_spec.js
spec/frontend/group_settings/components/shared_runners_form_spec.js
spec/frontend/groups/components/group_item_spec.js
spec/frontend/groups/components/visibility_level_dropdown_spec.js
spec/frontend/helpers/backoff_helper.js
spec/frontend/helpers/dom_events_helper.js
spec/frontend/helpers/dom_shims/size_properties.js
spec/frontend/helpers/emoji.js
spec/frontend/helpers/event_hub_factory_spec.js
spec/frontend/helpers/fake_date.js
spec/frontend/helpers/fake_request_animation_frame.js
spec/frontend/helpers/fixtures.js
spec/frontend/helpers/jest_helpers.js
spec/frontend/helpers/local_storage_helper.js
spec/frontend/helpers/locale_helper.js
spec/frontend/helpers/mock_window_location_helper.js
spec/frontend/helpers/set_timeout_promise_helper.js
spec/frontend/helpers/set_window_location_helper_spec.js
spec/frontend/helpers/startup_css_helper_spec.js
spec/frontend/helpers/stub_children.js
spec/frontend/helpers/text_helper.js
spec/frontend/helpers/timeout.js
spec/frontend/helpers/tracking_helper.js
spec/frontend/helpers/vue_mock_directive.js
spec/frontend/helpers/vue_test_utils_helper.js
spec/frontend/helpers/vuex_action_helper.js
spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.js
spec/frontend/helpers/wait_using_real_timer.js
## beautiful-benz
spec/frontend/monitoring/components/dashboard_actions_menu_spec.js
spec/frontend/monitoring/components/dashboard_header_spec.js
......
......@@ -9,7 +9,7 @@ describe('~/behaviors/shortcuts/keybindings.js', () => {
useLocalStorageSpy();
});
const setupCustomizations = async customizationsAsString => {
const setupCustomizations = async (customizationsAsString) => {
localStorage.clear();
if (customizationsAsString) {
......
......@@ -15,7 +15,7 @@ describe('ShortcutsIssuable', () => {
preloadFixtures(snippetShowFixtureName, mrShowFixtureName);
beforeAll(done => {
beforeAll((done) => {
initCopyAsGFM();
// Fake call to nodeToGfm so the import of lazy bundle happened
......@@ -81,7 +81,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<p>Selected text.</p>');
});
it('leaves existing input intact', done => {
it('leaves existing input intact', (done) => {
$(FORM_SELECTOR).val('This text was already here.');
expect($(FORM_SELECTOR).val()).toBe('This text was already here.');
......@@ -96,7 +96,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -110,7 +110,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -122,7 +122,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a one-line selection', () => {
it('quotes the selection', done => {
it('quotes the selection', (done) => {
stubSelection('<p>This text has been selected.</p>');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -134,7 +134,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a multi-line selection', () => {
it('quotes the selected lines as a group', done => {
it('quotes the selected lines as a group', (done) => {
stubSelection(
'<p>Selected line one.</p>\n<p>Selected line two.</p>\n<p>Selected line three.</p>',
);
......@@ -154,7 +154,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<p>Selected text.</p>', true);
});
it('does not add anything to the input', done => {
it('does not add anything to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -163,7 +163,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -179,7 +179,7 @@ describe('ShortcutsIssuable', () => {
stubSelection('<div class="md">Selected text.</div><p>Invalid selected text.</p>', true);
});
it('only adds the valid part to the input', done => {
it('only adds the valid part to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -188,7 +188,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -198,7 +198,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -233,7 +233,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('adds the quoted selection to the input', done => {
it('adds the quoted selection to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -242,7 +242,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -252,7 +252,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `input`', done => {
it('triggers `input`', (done) => {
let triggered = false;
$(FORM_SELECTOR).on('input', () => {
triggered = true;
......@@ -287,7 +287,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('does not add anything to the input', done => {
it('does not add anything to the input', (done) => {
ShortcutsIssuable.replyWithSelectedText(true);
setImmediate(() => {
......@@ -296,7 +296,7 @@ describe('ShortcutsIssuable', () => {
});
});
it('triggers `focus`', done => {
it('triggers `focus`', (done) => {
const spy = jest.spyOn(document.querySelector(FORM_SELECTOR), 'focus');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -308,7 +308,7 @@ describe('ShortcutsIssuable', () => {
});
describe('with a valid selection with no text content', () => {
it('returns the proper markdown', done => {
it('returns the proper markdown', (done) => {
stubSelection('<img src="https://gitlab.com/logo.png" alt="logo" />');
ShortcutsIssuable.replyWithSelectedText(true);
......@@ -334,7 +334,7 @@ describe('ShortcutsIssuable', () => {
'.sidebar-source-branch button',
);
[sidebarCollapsedBtn, sidebarExpandedBtn].forEach(btn => jest.spyOn(btn, 'click'));
[sidebarCollapsedBtn, sidebarExpandedBtn].forEach((btn) => jest.spyOn(btn, 'click'));
});
afterEach(() => {
......
......@@ -32,7 +32,7 @@ describe('Blob Content Error component', () => {
viewerError: error.id,
});
expect(wrapper.text()).toContain(reason);
options.forEach(option => {
options.forEach((option) => {
expect(wrapper.text()).toContain(option);
});
});
......@@ -52,7 +52,7 @@ describe('Blob Content Error component', () => {
},
});
expect(wrapper.text()).toContain(reason);
options.forEach(option => {
options.forEach((option) => {
expect(wrapper.text()).toContain(option);
});
});
......
......@@ -40,7 +40,7 @@ describe('Blob Header Editing', () => {
wrapper.destroy();
});
const triggerChangeContent = val => {
const triggerChangeContent = (val) => {
getValue.mockReturnValue(val);
const [cb] = onDidChangeModelContent.mock.calls[0];
......
......@@ -15,7 +15,7 @@ describe('Blob Header Editing', () => {
});
};
const findDeleteButton = () =>
wrapper.findAll(GlButton).wrappers.find(x => x.text() === 'Delete file');
wrapper.findAll(GlButton).wrappers.find((x) => x.text() === 'Delete file');
beforeEach(() => {
createComponent();
......
......@@ -75,7 +75,7 @@ describe('Blob Header Default Actions', () => {
expect(wrapper.find(DefaultActions).exists()).toBe(false);
});
Object.keys(slots).forEach(slot => {
Object.keys(slots).forEach((slot) => {
it('renders the slots', () => {
const slotContent = slots[slot];
createComponent(
......
......@@ -11,7 +11,7 @@ describe('Sketch viewer', () => {
});
describe('with error message', () => {
beforeEach(done => {
beforeEach((done) => {
jest.spyOn(SketchLoader.prototype, 'getZipFile').mockImplementation(
() =>
new Promise((resolve, reject) => {
......@@ -37,7 +37,7 @@ describe('Sketch viewer', () => {
});
describe('success', () => {
beforeEach(done => {
beforeEach((done) => {
const loadAsyncMock = {
files: {
'previews/preview.png': {
......@@ -48,7 +48,7 @@ describe('Sketch viewer', () => {
loadAsyncMock.files['previews/preview.png'].async.mockImplementation(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve('foo');
done();
}),
......
......@@ -26,7 +26,7 @@ describe('Blob utilities', () => {
it.each([[{}], [{ blobPath, blobContent, blobGlobalId }]])(
'creates the instance with the passed parameters %s',
extraParams => {
(extraParams) => {
const params = {
el: editorEl,
...extraParams,
......
......@@ -37,7 +37,7 @@ describe('Blob viewer', () => {
window.location.hash = '';
});
it('loads source file after switching views', done => {
it('loads source file after switching views', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -51,7 +51,7 @@ describe('Blob viewer', () => {
});
});
it('loads source file when line number is in hash', done => {
it('loads source file when line number is in hash', (done) => {
window.location.hash = '#L1';
new BlobViewer();
......@@ -117,7 +117,7 @@ describe('Blob viewer', () => {
expect(copyButton.blur).not.toHaveBeenCalled();
});
it('enables after switching to simple view', done => {
it('enables after switching to simple view', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -127,7 +127,7 @@ describe('Blob viewer', () => {
});
});
it('updates tooltip after switching to simple view', done => {
it('updates tooltip after switching to simple view', (done) => {
document.querySelector('.js-blob-viewer-switch-btn[data-viewer="simple"]').click();
setImmediate(() => {
......@@ -171,7 +171,7 @@ describe('Blob viewer', () => {
${['simple', 'rich']}
`('when view switches to $views', ({ views }) => {
beforeEach(async () => {
views.forEach(view => blob.switchToViewer(view));
views.forEach((view) => blob.switchToViewer(view));
await axios.waitForAll();
});
......
......@@ -31,7 +31,7 @@ describe('Blob Editing', () => {
FileTemplateExtension.mockClear();
});
const editorInst = isMarkdown => {
const editorInst = (isMarkdown) => {
return new EditBlob({
isMarkdown,
});
......
......@@ -82,7 +82,7 @@ const createComponent = ({
describe('Board list component', () => {
let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
useFakeRequestAnimationFrame();
afterEach(() => {
......
......@@ -72,7 +72,7 @@ describe('Board list component', () => {
}
describe('When Expanded', () => {
beforeEach(done => {
beforeEach((done) => {
getIssues = jest.spyOn(List.prototype, 'getIssues').mockReturnValue(new Promise(() => {}));
({ mock, component } = createComponent({ done }));
});
......@@ -204,7 +204,7 @@ describe('Board list component', () => {
});
describe('When Collapsed', () => {
beforeEach(done => {
beforeEach((done) => {
getIssues = jest.spyOn(List.prototype, 'getIssues').mockReturnValue(new Promise(() => {}));
({ mock, component } = createComponent({
done,
......@@ -228,7 +228,7 @@ describe('Board list component', () => {
});
describe('max issue count warning', () => {
beforeEach(done => {
beforeEach((done) => {
({ mock, component } = createComponent({
done,
listProps: { type: 'closed', collapsed: true, issuesSize: 50 },
......
......@@ -77,7 +77,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(endpoints.listsEndpoint).replyOnce(config => requestSpy(config));
axiosMock.onPost(endpoints.listsEndpoint).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a list', () => {
......@@ -114,7 +114,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPut(`${endpoints.listsEndpoint}/${id}`).replyOnce(config => requestSpy(config));
axiosMock.onPut(`${endpoints.listsEndpoint}/${id}`).replyOnce((config) => requestSpy(config));
});
it('makes a request to update a list position', () => {
......@@ -148,7 +148,7 @@ describe('boardsStore', () => {
requestSpy = jest.fn();
axiosMock
.onDelete(`${endpoints.listsEndpoint}/${id}`)
.replyOnce(config => requestSpy(config));
.replyOnce((config) => requestSpy(config));
});
it('makes a request to delete a list', () => {
......@@ -269,7 +269,7 @@ describe('boardsStore', () => {
requestSpy = jest.fn();
axiosMock
.onPut(`${urlRoot}/-/boards/${boardId}/issues/${id}`)
.replyOnce(config => requestSpy(config));
.replyOnce((config) => requestSpy(config));
});
it('makes a request to move an issue between lists', () => {
......@@ -308,7 +308,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(url).replyOnce(config => requestSpy(config));
axiosMock.onPost(url).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a new issue', () => {
......@@ -378,7 +378,7 @@ describe('boardsStore', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPost(endpoints.bulkUpdatePath).replyOnce(config => requestSpy(config));
axiosMock.onPost(endpoints.bulkUpdatePath).replyOnce((config) => requestSpy(config));
});
it('makes a request to create a list', () => {
......
......@@ -93,8 +93,8 @@ describe('BoardCardAssigneeDropdown', () => {
await wrapper.vm.$nextTick();
};
const findByText = text => {
return wrapper.findAll(GlDropdownItem).wrappers.find(node => node.text().indexOf(text) === 0);
const findByText = (text) => {
return wrapper.findAll(GlDropdownItem).wrappers.find((node) => node.text().indexOf(text) === 0);
};
const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
......
......@@ -22,7 +22,7 @@ describe('Board card layout', () => {
let list;
// this particular mount component needs to be used after the root beforeEach because it depends on list being initialized
const mountComponent = propsData => {
const mountComponent = (propsData) => {
wrapper = shallowMount(BoardCardLayout, {
stubs: {
issueCardInner,
......
......@@ -29,7 +29,7 @@ describe('BoardCard', () => {
const findUserAvatarLink = () => wrapper.find(userAvatarLink);
// this particular mount component needs to be used after the root beforeEach because it depends on list being initialized
const mountComponent = propsData => {
const mountComponent = (propsData) => {
wrapper = mount(BoardCard, {
stubs: {
issueCardInner,
......
......@@ -80,13 +80,13 @@ describe('Board List Header Component', () => {
const hasNoAddButton = [ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
it.each(hasNoAddButton)('does not render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(false);
});
it.each(hasAddButton)('does render when List Type is `%s`', listType => {
it.each(hasAddButton)('does render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(true);
......@@ -95,7 +95,7 @@ describe('Board List Header Component', () => {
it('has a test for each list type', () => {
createComponent();
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasAddButton, ...hasNoAddButton]).toContain(value);
});
});
......@@ -171,14 +171,14 @@ describe('Board List Header Component', () => {
it.each(cannotDragList)(
'does not have user-can-drag-class so user cannot drag list',
listType => {
(listType) => {
createComponent({ listType });
expect(findTitle().classes()).not.toContain('user-can-drag');
},
);
it.each(canDragList)('has user-can-drag-class so user can drag list', listType => {
it.each(canDragList)('has user-can-drag-class so user can drag list', (listType) => {
createComponent({ listType });
expect(findTitle().classes()).toContain('user-can-drag');
......
......@@ -76,20 +76,20 @@ describe('Board List Header Component', () => {
const hasNoAddButton = [ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
it.each(hasNoAddButton)('does not render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(false);
});
it.each(hasAddButton)('does render when List Type is `%s`', listType => {
it.each(hasAddButton)('does render when List Type is `%s`', (listType) => {
createComponent({ listType });
expect(findAddIssueButton().exists()).toBe(true);
});
it('has a test for each list type', () => {
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasAddButton, ...hasNoAddButton]).toContain(value);
});
});
......
......@@ -26,7 +26,7 @@ describe('BoardsSelector', () => {
const boards = boardGenerator(20);
const recentBoards = boardGenerator(5);
const fillSearchBox = filterTerm => {
const fillSearchBox = (filterTerm) => {
const searchBox = wrapper.find({ ref: 'searchBox' });
const searchBoxInput = searchBox.find('input');
searchBoxInput.setValue(filterTerm);
......@@ -59,7 +59,7 @@ describe('BoardsSelector', () => {
data: {
group: {
boards: {
edges: boards.map(board => ({ node: board })),
edges: boards.map((board) => ({ node: board })),
},
},
},
......@@ -152,7 +152,7 @@ describe('BoardsSelector', () => {
it('shows only matching boards when filtering', () => {
const filterTerm = 'board1';
const expectedCount = boards.filter(board => board.name.includes(filterTerm)).length;
const expectedCount = boards.filter((board) => board.name.includes(filterTerm)).length;
fillSearchBox(filterTerm);
......
......@@ -6,7 +6,7 @@ describe('IssueCount', () => {
let maxIssueCount;
let issuesSize;
const createComponent = props => {
const createComponent = (props) => {
vm = shallowMount(IssueCount, { propsData: props });
};
......
......@@ -10,7 +10,7 @@ const createComponent = (dueDate = new Date(), closed = false) =>
},
});
const findTime = wrapper => wrapper.find('time');
const findTime = (wrapper) => wrapper.find('time');
describe('Issue Due Date component', () => {
let wrapper;
......
......@@ -31,7 +31,7 @@ describe('Issue Time Estimate component', () => {
expect(wrapper.find('.js-issue-time-estimate').text()).toContain('2 weeks 3 days 1 minute');
});
it('prevents tooltip xss', done => {
it('prevents tooltip xss', (done) => {
const alertSpy = jest.spyOn(window, 'alert');
wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' });
wrapper.vm.$nextTick(() => {
......
......@@ -28,7 +28,7 @@ describe('Issue Time Estimate component', () => {
expect(wrapper.find('.js-issue-time-estimate').text()).toContain('2 weeks 3 days 1 minute');
});
it('prevents tooltip xss', done => {
it('prevents tooltip xss', (done) => {
const alertSpy = jest.spyOn(window, 'alert');
wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' });
wrapper.vm.$nextTick(() => {
......
......@@ -83,7 +83,7 @@ describe('~/boards/components/sidebar/board_sidebar_subscription_spec.vue', () =
});
describe('Board sidebar subscription component `behavior`', () => {
const mockSetActiveIssueSubscribed = subscribedState => {
const mockSetActiveIssueSubscribed = (subscribedState) => {
jest.spyOn(wrapper.vm, 'setActiveIssueSubscribed').mockImplementation(async () => {
store.commit(types.UPDATE_ISSUE_BY_ID, {
issueId: mockActiveIssue.id,
......
......@@ -8,7 +8,7 @@ describe('boards sidebar remove issue', () => {
const findButton = () => wrapper.find(GlButton);
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(RemoveIssue, {
propsData: {
issue: {},
......
......@@ -79,7 +79,7 @@ describe('Issue card component', () => {
expect(wrapper.find('.issue-blocked-icon').exists()).toBe(false);
});
it('renders confidential icon', done => {
it('renders confidential icon', (done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -102,7 +102,7 @@ describe('Issue card component', () => {
});
describe('exists', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -132,7 +132,7 @@ describe('Issue card component', () => {
expect(wrapper.find('.board-card-assignee img').exists()).toBe(true);
});
it('renders the avatar using avatar_url property', done => {
it('renders the avatar using avatar_url property', (done) => {
wrapper.props('issue').updateData({
...wrapper.props('issue'),
assignees: [
......@@ -156,7 +156,7 @@ describe('Issue card component', () => {
});
describe('assignee default avatar', () => {
beforeEach(done => {
beforeEach((done) => {
global.gon.default_avatar_url = 'default_avatar';
wrapper.setProps({
......@@ -189,7 +189,7 @@ describe('Issue card component', () => {
});
describe('multiple assignees', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......@@ -224,7 +224,7 @@ describe('Issue card component', () => {
});
describe('more than three assignees', () => {
beforeEach(done => {
beforeEach((done) => {
const { assignees } = wrapper.props('issue');
assignees.push(
new ListAssignee({
......@@ -252,11 +252,11 @@ describe('Issue card component', () => {
expect(wrapper.findAll('.board-card-assignee .avatar').length).toEqual(2);
});
it('renders 99+ avatar counter', done => {
it('renders 99+ avatar counter', (done) => {
const assignees = [
...wrapper.props('issue').assignees,
...range(5, 103).map(
i =>
(i) =>
new ListAssignee({
id: i,
name: 'name',
......@@ -281,7 +281,7 @@ describe('Issue card component', () => {
});
describe('labels', () => {
beforeEach(done => {
beforeEach((done) => {
issue.addLabel(label1);
wrapper.setProps({ issue: { ...issue } });
......@@ -296,7 +296,7 @@ describe('Issue card component', () => {
expect(label.props('backgroundColor')).toEqual(label1.color);
});
it('does not render label if label does not have an ID', done => {
it('does not render label if label does not have an ID', (done) => {
issue.addLabel(
new ListLabel({
title: 'closed',
......@@ -315,7 +315,7 @@ describe('Issue card component', () => {
});
describe('blocked', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.setProps({
issue: {
...wrapper.props('issue'),
......
......@@ -260,7 +260,7 @@ describe('Issue card component', () => {
it('renders 99+ avatar counter', async () => {
const assignees = [
...wrapper.props('issue').assignees,
...range(5, 103).map(i => ({
...range(5, 103).map((i) => ({
id: i,
name: 'name',
username: 'username',
......
......@@ -37,7 +37,7 @@ describe('List model', () => {
describe('list type', () => {
const notExpandableList = ['blank'];
const table = Object.keys(ListType).map(k => {
const table = Object.keys(ListType).map((k) => {
const value = ListType[k];
return [value, !notExpandableList.includes(value)];
});
......@@ -186,7 +186,7 @@ describe('List model', () => {
list.issues = [];
});
it('adds new issue to top of list', done => {
it('adds new issue to top of list', (done) => {
const user = new ListAssignee({
id: 1,
name: 'testing 123',
......
......@@ -263,7 +263,7 @@ export const BoardsMockData = {
},
};
export const boardsMockInterceptor = config => {
export const boardsMockInterceptor = (config) => {
const body = BoardsMockData[config.method.toUpperCase()][config.url];
return [200, body];
};
......@@ -318,7 +318,7 @@ export const mockLists = [mockList, mockLabelList];
export const mockListsById = keyBy(mockLists, 'id');
export const mockListsWithModel = mockLists.map(listMock =>
export const mockListsWithModel = mockLists.map((listMock) =>
Vue.observable(new List({ ...listMock, doNotFetchIssues: true })),
);
......
......@@ -21,7 +21,7 @@ import createFlash from '~/flash';
jest.mock('~/flash');
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......@@ -29,7 +29,7 @@ const expectNotImplemented = action => {
// We need this helper to make sure projectPath is including
// subgroups when the movIssue action is called.
const getProjectPath = path => path.split('#')[0];
const getProjectPath = (path) => path.split('#')[0];
beforeEach(() => {
window.gon = { features: {} };
......@@ -53,7 +53,7 @@ describe('setInitialBoardData', () => {
});
describe('setFilters', () => {
it('should commit mutation SET_FILTERS', done => {
it('should commit mutation SET_FILTERS', (done) => {
const state = {
filters: {},
};
......@@ -72,11 +72,11 @@ describe('setFilters', () => {
});
describe('performSearch', () => {
it('should dispatch setFilters action', done => {
it('should dispatch setFilters action', (done) => {
testAction(actions.performSearch, {}, {}, [], [{ type: 'setFilters', payload: {} }], done);
});
it('should dispatch setFilters, fetchLists and resetIssues action when graphqlBoardLists FF is on', done => {
it('should dispatch setFilters, fetchLists and resetIssues action when graphqlBoardLists FF is on', (done) => {
window.gon = { features: { graphqlBoardLists: true } };
testAction(
actions.performSearch,
......@@ -90,7 +90,7 @@ describe('performSearch', () => {
});
describe('setActiveId', () => {
it('should commit mutation SET_ACTIVE_ID', done => {
it('should commit mutation SET_ACTIVE_ID', (done) => {
const state = {
activeId: inactiveId,
};
......@@ -129,7 +129,7 @@ describe('fetchLists', () => {
const formattedLists = formatBoardLists(queryResponse.data.group.board.lists);
it('should commit mutations RECEIVE_BOARD_LISTS_SUCCESS on success', done => {
it('should commit mutations RECEIVE_BOARD_LISTS_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -147,7 +147,7 @@ describe('fetchLists', () => {
);
});
it('dispatch createList action when backlog list does not exist and is not hidden', done => {
it('dispatch createList action when backlog list does not exist and is not hidden', (done) => {
queryResponse = {
data: {
group: {
......@@ -179,7 +179,7 @@ describe('fetchLists', () => {
});
describe('createList', () => {
it('should dispatch addList action when creating backlog list', done => {
it('should dispatch addList action when creating backlog list', (done) => {
const backlogList = {
id: 'gid://gitlab/List/1',
listType: 'backlog',
......@@ -216,7 +216,7 @@ describe('createList', () => {
);
});
it('should commit CREATE_LIST_FAILURE mutation when API returns an error', done => {
it('should commit CREATE_LIST_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockReturnValue(
Promise.resolve({
data: {
......@@ -248,7 +248,7 @@ describe('createList', () => {
});
describe('moveList', () => {
it('should commit MOVE_LIST mutation and dispatch updateList action', done => {
it('should commit MOVE_LIST mutation and dispatch updateList action', (done) => {
const initialBoardListsState = {
'gid://gitlab/List/1': mockLists[0],
'gid://gitlab/List/2': mockLists[1],
......@@ -321,7 +321,7 @@ describe('moveList', () => {
});
describe('updateList', () => {
it('should commit UPDATE_LIST_FAILURE mutation when API returns an error', done => {
it('should commit UPDATE_LIST_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateBoardList: {
......@@ -438,7 +438,7 @@ describe('fetchIssuesForList', () => {
boardType: 'group',
};
const mockIssuesNodes = mockIssues.map(issue => ({ node: issue }));
const mockIssuesNodes = mockIssues.map((issue) => ({ node: issue }));
const pageInfo = {
endCursor: '',
......@@ -471,7 +471,7 @@ describe('fetchIssuesForList', () => {
[listId]: pageInfo,
};
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', done => {
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -493,7 +493,7 @@ describe('fetchIssuesForList', () => {
);
});
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', done => {
it('should commit mutations REQUEST_ISSUES_FOR_LIST and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction(
......@@ -540,7 +540,7 @@ describe('moveIssue', () => {
issues,
};
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......@@ -615,7 +615,7 @@ describe('moveIssue', () => {
expect(gqlClient.mutate).toHaveBeenCalledWith(mutationVariables);
});
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......@@ -686,7 +686,7 @@ describe('setAssignees', () => {
});
});
it('calls the correct mutation with the correct values', done => {
it('calls the correct mutation with the correct values', (done) => {
testAction(
actions.setAssignees,
{},
......@@ -743,7 +743,7 @@ describe('createNewIssue', () => {
expect(result).toEqual(mockIssue);
});
it('should commit CREATE_ISSUE_FAILURE mutation when API returns an error', done => {
it('should commit CREATE_ISSUE_FAILURE mutation when API returns an error', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
createIssue: {
......@@ -767,7 +767,7 @@ describe('createNewIssue', () => {
});
describe('addListIssue', () => {
it('should commit ADD_ISSUE_TO_LIST mutation', done => {
it('should commit ADD_ISSUE_TO_LIST mutation', (done) => {
const payload = {
list: mockLists[0],
issue: mockIssue,
......@@ -788,14 +788,14 @@ describe('addListIssue', () => {
describe('setActiveIssueLabels', () => {
const state = { issues: { [mockIssue.id]: mockIssue } };
const getters = { activeIssue: mockIssue };
const testLabelIds = labels.map(label => label.id);
const testLabelIds = labels.map((label) => label.id);
const input = {
addLabelIds: testLabelIds,
removeLabelIds: [],
projectPath: 'h/b',
};
it('should assign labels on success', done => {
it('should assign labels on success', (done) => {
jest
.spyOn(gqlClient, 'mutate')
.mockResolvedValue({ data: { updateIssue: { issue: { labels: { nodes: labels } } } } });
......@@ -839,7 +839,7 @@ describe('setActiveIssueDueDate', () => {
projectPath: 'h/b',
};
it('should commit due date after setting the issue', done => {
it('should commit due date after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateIssue: {
......@@ -890,7 +890,7 @@ describe('setActiveIssueSubscribed', () => {
projectPath: 'gitlab-org/gitlab-test',
};
it('should commit subscribed status', done => {
it('should commit subscribed status', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueSetSubscription: {
......@@ -944,7 +944,7 @@ describe('setActiveIssueMilestone', () => {
projectPath: 'h/b',
};
it('should commit milestone after setting the issue', done => {
it('should commit milestone after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
updateIssue: {
......
......@@ -84,7 +84,7 @@ describe('Boards - Getters', () => {
issues,
};
it('returns issues for a given listId', () => {
const getIssueById = issueId => [mockIssue, mockIssue2].find(({ id }) => id === issueId);
const getIssueById = (issueId) => [mockIssue, mockIssue2].find(({ id }) => id === issueId);
expect(getters.getIssuesByList(boardsState, { getIssueById })('gid://gitlab/List/2')).toEqual(
mockIssues,
......
......@@ -3,7 +3,7 @@ import * as types from '~/boards/stores/mutation_types';
import defaultState from '~/boards/stores/state';
import { mockLists, rawIssue, mockIssue, mockIssue2 } from '../mock_data';
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......
......@@ -15,7 +15,7 @@ describe('branches delete modal', () => {
</div>
`);
$deleteButton = $('.js-delete-branch');
submitSpy = jest.fn(event => event.preventDefault());
submitSpy = jest.fn((event) => event.preventDefault());
$('#modal-delete-branch form').on('submit', submitSpy);
// eslint-disable-next-line no-new
new DeleteModal();
......
......@@ -16,14 +16,14 @@ describe('TriggersList', () => {
};
const findTable = () => wrapper.find(GlTable);
const findHeaderAt = i => wrapper.findAll('thead th').at(i);
const findHeaderAt = (i) => wrapper.findAll('thead th').at(i);
const findRows = () => wrapper.findAll('tbody tr');
const findRowAt = i => findRows().at(i);
const findRowAt = (i) => findRows().at(i);
const findCell = (i, col) => findRowAt(i).findAll('td').at(col);
const findClipboardBtn = i => findCell(i, 0).find(ClipboardButton);
const findInvalidBadge = i => findCell(i, 0).find(GlBadge);
const findEditBtn = i => findRowAt(i).find('[data-testid="edit-btn"]');
const findRevokeBtn = i => findRowAt(i).find('[data-testid="trigger_revoke_button"]');
const findClipboardBtn = (i) => findCell(i, 0).find(ClipboardButton);
const findInvalidBadge = (i) => findCell(i, 0).find(GlBadge);
const findEditBtn = (i) => findRowAt(i).find('[data-testid="edit-btn"]');
const findRevokeBtn = (i) => findRowAt(i).find('[data-testid="trigger_revoke_button"]');
beforeEach(() => {
createComponent();
......
......@@ -10,7 +10,7 @@ describe('Ci environments dropdown', () => {
let wrapper;
let store;
const createComponent = term => {
const createComponent = (term) => {
store = new Vuex.Store({
getters: {
joinedEnvironments: () => ['dev', 'prod', 'staging'],
......@@ -27,8 +27,8 @@ describe('Ci environments dropdown', () => {
};
const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index);
const findActiveIconByIndex = index => findDropdownItemByIndex(index).find(GlIcon);
const findDropdownItemByIndex = (index) => wrapper.findAll(GlDropdownItem).at(index);
const findActiveIconByIndex = (index) => findDropdownItemByIndex(index).find(GlIcon);
afterEach(() => {
wrapper.destroy();
......@@ -78,7 +78,7 @@ describe('Ci environments dropdown', () => {
});
it('should not display create button', () => {
const environments = findAllDropdownItems().filter(env => env.text().startsWith('Create'));
const environments = findAllDropdownItems().filter((env) => env.text().startsWith('Create'));
expect(environments).toHaveLength(0);
expect(findAllDropdownItems()).toHaveLength(1);
});
......
......@@ -31,11 +31,11 @@ describe('Ci variable modal', () => {
const findAddorUpdateButton = () =>
findModal()
.findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'success');
.wrappers.find((button) => button.props('variant') === 'success');
const deleteVariableButton = () =>
findModal()
.findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'danger');
.wrappers.find((button) => button.props('variant') === 'danger');
afterEach(() => {
wrapper.destroy();
......
......@@ -11,7 +11,7 @@ describe('Ci variable table', () => {
let store;
let isGroup;
const createComponent = groupState => {
const createComponent = (groupState) => {
store = createStore();
store.state.isGroup = groupState;
jest.spyOn(store, 'dispatch').mockImplementation();
......
......@@ -86,7 +86,7 @@ describe('CI variable list store actions', () => {
});
describe('deleteVariable', () => {
it('dispatch correct actions on successful deleted variable', done => {
it('dispatch correct actions on successful deleted variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -105,7 +105,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on delete failure', done => {
it('should show flash error and set error in state on delete failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -129,7 +129,7 @@ describe('CI variable list store actions', () => {
});
describe('updateVariable', () => {
it('dispatch correct actions on successful updated variable', done => {
it('dispatch correct actions on successful updated variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -148,7 +148,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on update failure', done => {
it('should show flash error and set error in state on update failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -172,7 +172,7 @@ describe('CI variable list store actions', () => {
});
describe('addVariable', () => {
it('dispatch correct actions on successful added variable', done => {
it('dispatch correct actions on successful added variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -191,7 +191,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on add failure', done => {
it('should show flash error and set error in state on add failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -215,7 +215,7 @@ describe('CI variable list store actions', () => {
});
describe('fetchVariables', () => {
it('dispatch correct actions on fetchVariables', done => {
it('dispatch correct actions on fetchVariables', (done) => {
mock.onGet(state.endpoint).reply(200, { variables: mockData.mockVariables });
testAction(
......@@ -236,7 +236,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on fetch variables failure', done => {
it('should show flash error and set error in state on fetch variables failure', (done) => {
mock.onGet(state.endpoint).reply(500);
testAction(actions.fetchVariables, {}, state, [], [{ type: 'requestVariables' }], () => {
......@@ -247,7 +247,7 @@ describe('CI variable list store actions', () => {
});
describe('fetchEnvironments', () => {
it('dispatch correct actions on fetchEnvironments', done => {
it('dispatch correct actions on fetchEnvironments', (done) => {
Api.environments = jest.fn().mockResolvedValue({ data: mockData.mockEnvironments });
testAction(
......@@ -268,7 +268,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on fetch environments failure', done => {
it('should show flash error and set error in state on fetch environments failure', (done) => {
Api.environments = jest.fn().mockRejectedValue();
testAction(
......
......@@ -279,7 +279,7 @@ describe('Clusters', () => {
});
describe('uninstallApplication', () => {
it.each(APPLICATIONS)('tries to uninstall %s', applicationId => {
it.each(APPLICATIONS)('tries to uninstall %s', (applicationId) => {
jest.spyOn(cluster.service, 'uninstallApplication').mockResolvedValueOnce();
cluster.store.state.applications[applicationId].status = INSTALLED;
......
......@@ -15,7 +15,7 @@ describe('Application Row', () => {
wrapper.destroy();
});
const mountComponent = data => {
const mountComponent = (data) => {
wrapper = shallowMount(ApplicationRow, {
stubs: { GlSprintf },
propsData: {
......
......@@ -29,8 +29,8 @@ describe('Applications', () => {
});
};
const createShallowApp = options => createApp(options, true);
const findByTestId = id => wrapper.find(`[data-testid="${id}"]`);
const createShallowApp = (options) => createApp(options, true);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
afterEach(() => {
wrapper.destroy();
});
......
......@@ -37,11 +37,11 @@ describe('FluentdOutputSettings', () => {
const findSaveButton = () => wrapper.find({ ref: 'saveBtn' });
const findCancelButton = () => wrapper.find({ ref: 'cancelBtn' });
const findProtocolDropdown = () => wrapper.find(GlDropdown);
const findCheckbox = name =>
wrapper.findAll(GlFormCheckbox).wrappers.find(x => x.text() === name);
const findCheckbox = (name) =>
wrapper.findAll(GlFormCheckbox).wrappers.find((x) => x.text() === name);
const findHost = () => wrapper.find('#fluentd-host');
const findPort = () => wrapper.find('#fluentd-port');
const changeCheckbox = checkbox => {
const changeCheckbox = (checkbox) => {
const currentValue = checkbox.attributes('checked')?.toString() === 'true';
checkbox.vm.$emit('input', !currentValue);
};
......@@ -49,9 +49,9 @@ describe('FluentdOutputSettings', () => {
element.value = val;
element.dispatchEvent(new Event('input'));
};
const changePort = val => changeInput(findPort(), val);
const changeHost = val => changeInput(findHost(), val);
const changeProtocol = idx => findProtocolDropdown().vm.$children[idx].$emit('click');
const changePort = (val) => changeInput(findPort(), val);
const changeHost = (val) => changeInput(findHost(), val);
const changeProtocol = (idx) => findProtocolDropdown().vm.$children[idx].$emit('click');
const toApplicationSettings = ({ wafLogEnabled, ciliumLogEnabled, ...settings }) => ({
...settings,
waf_log_enabled: wafLogEnabled,
......
......@@ -25,7 +25,7 @@ const {
const NO_EFFECTS = 'no effects';
describe('applicationStateMachine', () => {
const noEffectsToEmptyObject = effects => (typeof effects === 'string' ? {} : effects);
const noEffectsToEmptyObject = (effects) => (typeof effects === 'string' ? {} : effects);
describe(`current state is ${NO_STATUS}`, () => {
it.each`
......@@ -42,7 +42,7 @@ describe('applicationStateMachine', () => {
${UNINSTALLING} | ${UNINSTALLING} | ${NO_EFFECTS}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: NO_STATUS,
......@@ -59,7 +59,7 @@ describe('applicationStateMachine', () => {
it.each`
expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: NOT_INSTALLABLE,
......@@ -79,7 +79,7 @@ describe('applicationStateMachine', () => {
${INSTALLED} | ${INSTALLED} | ${{ installFailed: false }}
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${{ installFailed: false }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLABLE,
......@@ -97,7 +97,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLING,
......@@ -118,7 +118,7 @@ describe('applicationStateMachine', () => {
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLED,
......@@ -136,7 +136,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${UPDATED} | ${{ updateSuccessful: true }}
${INSTALLED} | ${UPDATE_ERRORED} | ${{ updateFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UPDATING,
......@@ -154,7 +154,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${{ uninstallSuccessful: true }}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UNINSTALLING,
......@@ -172,7 +172,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UNINSTALLED,
......
......@@ -5,7 +5,7 @@ import NodeErrorHelpText from '~/clusters_list/components/node_error_help_text.v
describe('NodeErrorHelpText', () => {
let wrapper;
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(NodeErrorHelpText, { propsData, stubs: { GlPopover } });
return wrapper.vm.$nextTick();
};
......
......@@ -24,7 +24,7 @@ describe('Clusters store actions', () => {
captureException.mockRestore();
});
it('should report sentry error', done => {
it('should report sentry error', (done) => {
const sentryError = new Error('New Sentry Error');
const tag = 'sentryErrorTag';
......@@ -62,7 +62,7 @@ describe('Clusters store actions', () => {
afterEach(() => mock.restore());
it('should commit SET_CLUSTERS_DATA with received response', done => {
it('should commit SET_CLUSTERS_DATA with received response', (done) => {
mock.onGet().reply(200, apiData, headers);
testAction(
......@@ -79,7 +79,7 @@ describe('Clusters store actions', () => {
);
});
it('should show flash on API error', done => {
it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found');
testAction(
......@@ -126,7 +126,7 @@ describe('Clusters store actions', () => {
pollStop.mockRestore();
});
it('should stop polling after MAX Requests', done => {
it('should stop polling after MAX Requests', (done) => {
testAction(
actions.fetchClusters,
{ endpoint: apiData.endpoint },
......@@ -173,7 +173,7 @@ describe('Clusters store actions', () => {
);
});
it('should stop polling and report to Sentry when data is invalid', done => {
it('should stop polling and report to Sentry when data is invalid', (done) => {
const badApiResponse = { clusters: {} };
mock.onGet().reply(200, badApiResponse, pollHeaders);
......
......@@ -8,7 +8,7 @@ jest.mock('~/code_navigation/utils');
describe('Code navigation actions', () => {
describe('setInitialData', () => {
it('commits SET_INITIAL_DATA', done => {
it('commits SET_INITIAL_DATA', (done) => {
testAction(
actions.setInitialData,
{ projectPath: 'test' },
......@@ -57,7 +57,7 @@ describe('Code navigation actions', () => {
]);
});
it('commits REQUEST_DATA_SUCCESS with normalized data', done => {
it('commits REQUEST_DATA_SUCCESS with normalized data', (done) => {
testAction(
actions.fetchData,
null,
......@@ -84,7 +84,7 @@ describe('Code navigation actions', () => {
);
});
it('calls addInteractionClass with data', done => {
it('calls addInteractionClass with data', (done) => {
testAction(
actions.fetchData,
null,
......@@ -125,7 +125,7 @@ describe('Code navigation actions', () => {
mock.onGet(codeNavigationPath).replyOnce(500);
});
it('dispatches requestDataError', done => {
it('dispatches requestDataError', (done) => {
testAction(
actions.fetchData,
null,
......@@ -175,15 +175,15 @@ describe('Code navigation actions', () => {
target = document.querySelector('.js-test');
});
it('returns early when no data exists', done => {
it('returns early when no data exists', (done) => {
testAction(actions.showDefinition, { target }, {}, [], [], done);
});
it('commits SET_CURRENT_DEFINITION when target is not code navitation element', done => {
it('commits SET_CURRENT_DEFINITION when target is not code navitation element', (done) => {
testAction(actions.showDefinition, { target }, { data: {} }, [], [], done);
});
it('commits SET_CURRENT_DEFINITION with LSIF data', done => {
it('commits SET_CURRENT_DEFINITION with LSIF data', (done) => {
target.classList.add('js-code-navigation');
target.setAttribute('data-line-index', '0');
target.setAttribute('data-char-index', '0');
......
......@@ -62,7 +62,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
).toBe('Add a to do');
});
it('toggle todo state', done => {
it('toggle todo state', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -80,7 +80,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('toggle todo state of expanded todo toggle', done => {
it('toggle todo state of expanded todo toggle', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -92,7 +92,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('toggles todo button tooltip', done => {
it('toggles todo button tooltip', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -106,7 +106,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('marks todo as done', done => {
it('marks todo as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises()
......@@ -131,7 +131,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
.catch(done.fail);
});
it('updates aria-label to Mark as done', done => {
it('updates aria-label to Mark as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -145,7 +145,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('updates aria-label to add todo', done => {
it('updates aria-label to add todo', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises()
......
......@@ -105,7 +105,7 @@ describe('Commit pipeline status component', () => {
describe('when polling', () => {
let pollConfig;
beforeEach(() => {
Poll.mockImplementation(config => {
Poll.mockImplementation((config) => {
pollConfig = config;
return { makeRequest: jest.fn(), restart: jest.fn(), stop: jest.fn() };
});
......
......@@ -31,7 +31,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const { pipelines } = getJSONFixture(jsonFixtureName);
PipelinesTable = Vue.extend(pipelinesTable);
pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
});
afterEach(() => {
......@@ -47,7 +47,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render the empty state', done => {
it('should render the empty state', (done) => {
setImmediate(() => {
expect(vm.$el.querySelector('.empty-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......@@ -63,7 +63,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render a table with the received pipelines', done => {
it('should render a table with the received pipelines', (done) => {
setImmediate(() => {
expect(vm.$el.querySelectorAll('.ci-table .commit').length).toEqual(1);
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......@@ -74,7 +74,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('with pagination', () => {
it('should make an API request when using pagination', done => {
it('should make an API request when using pagination', (done) => {
setImmediate(() => {
jest.spyOn(vm, 'updateContent').mockImplementation(() => {});
......@@ -102,11 +102,11 @@ describe('Pipelines table in Commits and Merge requests', () => {
mock.onGet('endpoint.json').reply(200, [pipeline]);
});
it('should receive update-pipelines-count event', done => {
it('should receive update-pipelines-count event', (done) => {
const element = document.createElement('div');
document.body.appendChild(element);
element.addEventListener('update-pipelines-count', event => {
element.addEventListener('update-pipelines-count', (event) => {
expect(event.detail.pipelines).toEqual([pipeline]);
done();
});
......@@ -126,7 +126,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('when latest pipeline has detached flag', () => {
it('renders the run pipeline button', done => {
it('renders the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
pipelineCopy.flags.merge_request_pipeline = true;
......@@ -143,7 +143,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('when latest pipeline does not have detached flag', () => {
it('does not render the run pipeline button', done => {
it('does not render the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = false;
pipelineCopy.flags.merge_request_pipeline = false;
......@@ -163,7 +163,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => {
beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
......@@ -182,7 +182,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on desktop, shows a loading button', done => {
it('on desktop, shows a loading button', (done) => {
findRunPipelineBtn().click();
vm.$nextTick(() => {
......@@ -200,7 +200,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on mobile, shows a loading button', done => {
it('on mobile, shows a loading button', (done) => {
findRunPipelineBtnMobile().click();
vm.$nextTick(() => {
......@@ -223,7 +223,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => {
beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
......@@ -244,7 +244,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on desktop, shows a security warning modal', done => {
it('on desktop, shows a security warning modal', (done) => {
findRunPipelineBtn().click();
vm.$nextTick(() => {
......@@ -253,7 +253,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on mobile, shows a security warning modal', done => {
it('on mobile, shows a security warning modal', (done) => {
findRunPipelineBtnMobile().click();
vm.$nextTick(() => {
......@@ -271,7 +271,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render error state', done => {
it('should render error state', (done) => {
setImmediate(() => {
expect(vm.$el.querySelector('.js-pipelines-error-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......
......@@ -70,7 +70,7 @@ describe('Commits List', () => {
mock.restore();
});
it('should save the last search string', done => {
it('should save the last search string', (done) => {
commitsList.searchField.val('GitLab');
commitsList
.filterResults()
......@@ -83,7 +83,7 @@ describe('Commits List', () => {
.catch(done.fail);
});
it('should not make ajax call if the input does not change', done => {
it('should not make ajax call if the input does not change', (done) => {
commitsList
.filterResults()
.then(() => {
......
......@@ -29,7 +29,7 @@ describe('ConfirmModal', () => {
beforeEach(() => {
const buttonContainer = document.createElement('div');
buttons.forEach(x => {
buttons.forEach((x) => {
const button = document.createElement('button');
button.setAttribute('class', 'js-confirm-modal-button');
button.setAttribute('data-path', x.path);
......@@ -50,7 +50,7 @@ describe('ConfirmModal', () => {
const findModal = () => document.querySelector('.gl-modal');
const findModalOkButton = (modal, variant) =>
modal.querySelector(`.modal-footer .btn-${variant}`);
const findModalCancelButton = modal => modal.querySelector('.modal-footer .btn-secondary');
const findModalCancelButton = (modal) => modal.querySelector('.modal-footer .btn-secondary');
const modalIsHidden = () => findModal() === null;
const serializeModal = (modal, buttonIndex) => {
......@@ -63,7 +63,7 @@ describe('ConfirmModal', () => {
title: modal.querySelector('.modal-title').innerHTML,
message: modal.querySelector('.modal-body div').innerHTML,
okVariant: [...findModalOkButton(modal, modalAttributes.okVariant).classList]
.find(x => x.match('btn-'))
.find((x) => x.match('btn-'))
.replace('btn-', ''),
okTitle: findModalOkButton(modal, modalAttributes.okVariant).innerHTML,
},
......
......@@ -17,7 +17,7 @@ describe('Contributors store actions', () => {
mock = new MockAdapter(axios);
});
it('should commit SET_CHART_DATA with received response', done => {
it('should commit SET_CHART_DATA with received response', (done) => {
mock.onGet().reply(200, chartData);
testAction(
......@@ -37,7 +37,7 @@ describe('Contributors store actions', () => {
);
});
it('should show flash on API error', done => {
it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found');
testAction(
......
......@@ -128,7 +128,7 @@ describe('EksClusterConfigurationForm', () => {
});
};
const createValidStateStore = initialState => {
const createValidStateStore = (initialState) => {
createStore({
initialState: {
clusterName: 'cluster name',
......
......@@ -94,7 +94,7 @@ describe('EKS Cluster Store Actions', () => {
${'setNodeCount'} | ${SET_NODE_COUNT} | ${{ nodeCount }} | ${'node count'}
${'setGitlabManagedCluster'} | ${SET_GITLAB_MANAGED_CLUSTER} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
${'setNamespacePerEnvironment'} | ${SET_NAMESPACE_PER_ENVIRONMENT} | ${namespacePerEnvironment} | ${'namespace per environment'}
`(`$action commits $mutation with $payloadDescription payload`, data => {
`(`$action commits $mutation with $payloadDescription payload`, (data) => {
const { action, mutation, payload } = data;
testAction(actions[action], payload, state, [{ type: mutation, payload }]);
......
......@@ -6,7 +6,7 @@ describe('EKS Cluster Store Getters', () => {
expect(subnetValid({ selectedSubnet: [1, 2] })).toBe(true);
});
it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', subnets => {
it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', (subnets) => {
expect(subnetValid({ selectedSubnet: subnets })).toBe(false);
});
});
......
......@@ -66,7 +66,7 @@ describe('Create EKS cluster store mutations', () => {
${SET_INSTANCE_TYPE} | ${'selectedInstanceType'} | ${{ instanceType }} | ${instanceType} | ${'selected instance type payload'}
${SET_NODE_COUNT} | ${'nodeCount'} | ${{ nodeCount }} | ${nodeCount} | ${'node count payload'}
${SET_GITLAB_MANAGED_CLUSTER} | ${'gitlabManagedCluster'} | ${{ gitlabManagedCluster }} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => {
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload);
......
......@@ -8,7 +8,7 @@ const cloudbilling = {
projects: {
getBillingInfo: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { billingEnabled: true },
});
......@@ -21,7 +21,7 @@ const cloudresourcemanager = {
projects: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiProjectsResponseMock },
});
......@@ -34,7 +34,7 @@ const compute = {
zones: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiZonesResponseMock },
});
......@@ -44,7 +44,7 @@ const compute = {
machineTypes: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiMachineTypesResponseMock },
});
......
......@@ -14,7 +14,7 @@ import {
describe('GCP Cluster Dropdown Store Actions', () => {
describe('setProject', () => {
it('should set project', done => {
it('should set project', (done) => {
testAction(
actions.setProject,
selectedProjectMock,
......@@ -27,7 +27,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setZone', () => {
it('should set zone', done => {
it('should set zone', (done) => {
testAction(
actions.setZone,
selectedZoneMock,
......@@ -40,7 +40,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setMachineType', () => {
it('should set machine type', done => {
it('should set machine type', (done) => {
testAction(
actions.setMachineType,
selectedMachineTypeMock,
......@@ -53,7 +53,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setIsValidatingProjectBilling', () => {
it('should set machine type', done => {
it('should set machine type', (done) => {
testAction(
actions.setIsValidatingProjectBilling,
true,
......@@ -92,7 +92,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('validateProjectBilling', () => {
it('checks project billing status from Google API', done => {
it('checks project billing status from Google API', (done) => {
testAction(
actions.validateProjectBilling,
true,
......
......@@ -2,8 +2,8 @@ import initGkeNamespace from '~/create_cluster/gke_cluster_namespace';
describe('GKE cluster namespace', () => {
const changeEvent = new Event('change');
const isHidden = el => el.classList.contains('hidden');
const hasDisabledInput = el => el.querySelector('input').disabled;
const isHidden = (el) => el.classList.contains('hidden');
const hasDisabledInput = (el) => el.querySelector('input').disabled;
let glManagedCheckbox;
let selfManaged;
......
......@@ -27,7 +27,7 @@ describe('Cluster dropdown store mutations', () => {
${RECEIVE_ITEMS_SUCCESS} | ${'items'} | ${{ items }} | ${items} | ${'items payload'}
${RECEIVE_ITEMS_ERROR} | ${'isLoadingItems'} | ${{ error }} | ${false} | ${false}
${RECEIVE_ITEMS_ERROR} | ${'error'} | ${{ error }} | ${error} | ${'received error object'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => {
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload);
......
......@@ -162,7 +162,7 @@ describe('CreateItemDropdown', () => {
getData: (term, callback) => {
callback(DROPDOWN_ITEM_DATA);
},
createNewItemFromValue: newValue => ({
createNewItemFromValue: (newValue) => ({
title: `${newValue}-title`,
id: `${newValue}-id`,
text: `${newValue}-text`,
......
......@@ -36,7 +36,7 @@ describe('CreateMergeRequestDropdown', () => {
});
describe('getRef', () => {
it('escapes branch names correctly', done => {
it('escapes branch names correctly', (done) => {
const endpoint = `${dropdown.refsPath}contains%23hash`;
jest.spyOn(axios, 'get');
axiosMock.onGet(endpoint).replyOnce({});
......
......@@ -11,7 +11,7 @@ describe('custom metrics form fields component', () => {
let component;
let mockAxios;
const getNamedInput = name => component.element.querySelector(`input[name="${name}"]`);
const getNamedInput = (name) => component.element.querySelector(`input[name="${name}"]`);
const validateQueryPath = `${TEST_HOST}/mock/path`;
const validQueryResponse = { data: { success: true, query: { valid: true, error: '' } } };
const csrfToken = 'mockToken';
......@@ -50,7 +50,7 @@ describe('custom metrics form fields component', () => {
mockAxios.restore();
});
it('checks form validity', done => {
it('checks form validity', (done) => {
mountComponent({
metricPersisted: true,
...makeFormData({
......@@ -157,7 +157,7 @@ describe('custom metrics form fields component', () => {
{
requestValidation: jest.fn().mockImplementation(
() =>
new Promise(resolve =>
new Promise((resolve) =>
setTimeout(() => {
resolve(validQueryResponse);
}, 4000),
......@@ -171,7 +171,7 @@ describe('custom metrics form fields component', () => {
jest.clearAllTimers();
});
it('expect queryValidateInFlight is in flight', done => {
it('expect queryValidateInFlight is in flight', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -191,7 +191,7 @@ describe('custom metrics form fields component', () => {
});
});
it('expect loading message to display', done => {
it('expect loading message to display', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -202,7 +202,7 @@ describe('custom metrics form fields component', () => {
});
});
it('expect loading message to disappear', done => {
it('expect loading message to disappear', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -239,7 +239,7 @@ describe('custom metrics form fields component', () => {
);
});
it('sets queryIsValid to false', done => {
it('sets queryIsValid to false', (done) => {
component.vm.$nextTick(() => {
expect(component.vm.queryValidateInFlight).toBe(false);
expect(component.vm.queryIsValid).toBe(false);
......@@ -247,7 +247,7 @@ describe('custom metrics form fields component', () => {
});
});
it('shows invalid query message', done => {
it('shows invalid query message', (done) => {
component.vm.$nextTick(() => {
expect(component.text()).toContain(errorMessage);
done();
......@@ -267,7 +267,7 @@ describe('custom metrics form fields component', () => {
);
});
it('sets queryIsValid to true when query is valid', done => {
it('sets queryIsValid to true when query is valid', (done) => {
component.vm.$nextTick(() => {
expect(component.vm.queryIsValid).toBe(true);
done();
......
......@@ -5,7 +5,7 @@ import LimitWarningComponent from '~/cycle_analytics/components/limit_warning_co
Vue.use(Translate);
const createComponent = props =>
const createComponent = (props) =>
shallowMount(LimitWarningComponent, {
propsData: {
...props,
......
......@@ -30,7 +30,7 @@ describe('Deploy freeze timezone dropdown', () => {
};
const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index);
const findDropdownItemByIndex = (index) => wrapper.findAll(GlDropdownItem).at(index);
afterEach(() => {
wrapper.destroy();
......
......@@ -9,9 +9,9 @@ describe('Deploy keys key', () => {
const data = getJSONFixture('deploy_keys/keys.json');
const findTextAndTrim = selector => wrapper.find(selector).text().trim();
const findTextAndTrim = (selector) => wrapper.find(selector).text().trim();
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = mount(key, {
propsData: {
store,
......
......@@ -8,7 +8,7 @@ describe('Deploy keys panel', () => {
const findTableRowHeader = () => wrapper.find('.table-row-header');
const mountComponent = props => {
const mountComponent = (props) => {
const store = new DeployKeysStore();
store.keys = data;
wrapper = mount(deployKeysPanel, {
......
......@@ -56,8 +56,8 @@ describe('deprecatedJQueryDropdown', () => {
search: {
fields: ['name'],
},
text: project => project.name_with_namespace || project.name,
id: project => project.id,
text: (project) => project.name_with_namespace || project.name,
id: (project) => project.id,
...extraOpts,
};
test.dropdownButtonElement = $('#js-project-dropdown', test.dropdownContainerElement);
......
......@@ -108,7 +108,7 @@ describe('Design discussions component', () => {
it('renders correct amount of discussion notes', () => {
expect(findDesignNotes()).toHaveLength(2);
expect(findDesignNotes().wrappers.every(w => w.isVisible())).toBe(true);
expect(findDesignNotes().wrappers.every((w) => w.isVisible())).toBe(true);
});
it('renders reply placeholder', () => {
......@@ -251,7 +251,7 @@ describe('Design discussions component', () => {
describe('when any note from a discussion is active', () => {
it.each([notes[0], notes[0].discussion.notes.nodes[1]])(
'applies correct class to all notes in the active discussion',
note => {
(note) => {
createComponent(
{ discussion: mockDiscussion },
{
......@@ -265,7 +265,7 @@ describe('Design discussions component', () => {
expect(
wrapper
.findAll(DesignNote)
.wrappers.every(designNote => designNote.classes('gl-bg-blue-50')),
.wrappers.every((designNote) => designNote.classes('gl-bg-blue-50')),
).toBe(true);
},
);
......
......@@ -13,7 +13,7 @@ describe('Design overlay component', () => {
const findAllNotes = () => wrapper.findAll('.js-image-badge');
const findCommentBadge = () => wrapper.find('.comment-indicator');
const findBadgeAtIndex = noteIndex => findAllNotes().at(noteIndex);
const findBadgeAtIndex = (noteIndex) => findAllNotes().at(noteIndex);
const findFirstBadge = () => findBadgeAtIndex(0);
const findSecondBadge = () => findBadgeAtIndex(1);
......@@ -108,7 +108,7 @@ describe('Design overlay component', () => {
describe('when no discussion is active', () => {
it('should not apply inactive class to any pins', () => {
expect(
findAllNotes(0).wrappers.every(designNote => designNote.classes('gl-bg-blue-50')),
findAllNotes(0).wrappers.every((designNote) => designNote.classes('gl-bg-blue-50')),
).toBe(false);
});
});
......@@ -116,7 +116,7 @@ describe('Design overlay component', () => {
describe('when a discussion is active', () => {
it.each([notes[0].discussion.notes.nodes[1], notes[0].discussion.notes.nodes[0]])(
'should not apply inactive class to the pin for the active discussion',
note => {
(note) => {
wrapper.setData({
activeDiscussion: {
id: note.id,
......
......@@ -10,7 +10,7 @@ describe('Design management design scaler component', () => {
const getResetScaleButton = () => getButtons().at(1);
const getIncreaseScaleButton = () => getButtons().at(2);
const setScale = scale => wrapper.vm.setScale(scale);
const setScale = (scale) => wrapper.vm.setScale(scale);
const createComponent = () => {
wrapper = shallowMount(DesignScaler);
......
......@@ -6,7 +6,7 @@ import mockAllVersions from './mock_data/all_versions';
const LATEST_VERSION_ID = 3;
const PREVIOUS_VERSION_ID = 2;
const designRouteFactory = versionId => ({
const designRouteFactory = (versionId) => ({
path: `/designs?version=${versionId}`,
query: {
version: `${versionId}`,
......@@ -42,7 +42,7 @@ describe('Design management design version dropdown component', () => {
wrapper.destroy();
});
const findVersionLink = index => wrapper.findAll(GlDropdownItem).at(index);
const findVersionLink = (index) => wrapper.findAll(GlDropdownItem).at(index);
it('renders design version dropdown button', () => {
createComponent();
......
......@@ -572,7 +572,7 @@ describe('Design management index page', () => {
return wrapper.vm.$nextTick().then(() => {
expect(findDeleteButton().props().hasSelectedDesigns).toBe(true);
expect(findSelectAllButton().text()).toBe('Deselect all');
expect(wrapper.vm.selectedDesigns).toEqual(mockDesigns.map(design => design.filename));
expect(wrapper.vm.selectedDesigns).toEqual(mockDesigns.map((design) => design.filename));
});
});
......
......@@ -40,7 +40,7 @@ describe('Design management router', () => {
window.location.hash = '';
});
describe.each([['/'], [{ name: DESIGNS_ROUTE_NAME }]])('root route', routeArg => {
describe.each([['/'], [{ name: DESIGNS_ROUTE_NAME }]])('root route', (routeArg) => {
it('pushes home component', () => {
const wrapper = factory(routeArg);
......@@ -50,7 +50,7 @@ describe('Design management router', () => {
describe.each([['/designs/1'], [{ name: DESIGN_ROUTE_NAME, params: { id: '1' } }]])(
'designs detail route',
routeArg => {
(routeArg) => {
it('pushes designs detail component', () => {
const wrapper = factory(routeArg);
......
......@@ -3,7 +3,7 @@ import {
designUploadSkippedWarning,
} from '~/design_management/utils/error_messages';
const mockFilenames = n =>
const mockFilenames = (n) =>
Array(n)
.fill(0)
.map((_, i) => ({ filename: `${i + 1}.jpg` }));
......@@ -14,7 +14,7 @@ describe('Error message', () => {
const pluralMsg = 'Could not archive designs. Please try again.';
describe('when [singular=true]', () => {
it.each([[undefined], [true]])('uses singular grammar', singularOption => {
it.each([[undefined], [true]])('uses singular grammar', (singularOption) => {
expect(designDeletionError({ singular: singularOption })).toEqual(singularMsg);
});
});
......
......@@ -102,13 +102,13 @@ describe('diffs/components/app', () => {
});
describe('fetch diff methods', () => {
beforeEach(done => {
beforeEach((done) => {
const fetchResolver = () => {
store.state.diffs.retrievingBatches = false;
store.state.notes.discussions = 'test';
return Promise.resolve({ real_size: 100 });
};
jest.spyOn(window, 'requestIdleCallback').mockImplementation(fn => fn());
jest.spyOn(window, 'requestIdleCallback').mockImplementation((fn) => fn());
createComponent();
jest.spyOn(wrapper.vm, 'fetchDiffFilesMeta').mockImplementation(fetchResolver);
jest.spyOn(wrapper.vm, 'fetchDiffFilesBatch').mockImplementation(fetchResolver);
......@@ -122,7 +122,7 @@ describe('diffs/components/app', () => {
wrapper.vm.$nextTick(done);
});
it('calls batch methods if diffsBatchLoad is enabled, and not latest version', done => {
it('calls batch methods if diffsBatchLoad is enabled, and not latest version', (done) => {
expect(wrapper.vm.diffFilesLength).toEqual(0);
wrapper.vm.isLatestVersion = () => false;
wrapper.vm.fetchData(false);
......@@ -139,7 +139,7 @@ describe('diffs/components/app', () => {
});
});
it('calls batch methods if diffsBatchLoad is enabled, and latest version', done => {
it('calls batch methods if diffsBatchLoad is enabled, and latest version', (done) => {
expect(wrapper.vm.diffFilesLength).toEqual(0);
wrapper.vm.fetchData(false);
......@@ -216,7 +216,7 @@ describe('diffs/components/app', () => {
window.location.hash = 'ABC_123';
});
it('sets highlighted row if hash exists in location object', done => {
it('sets highlighted row if hash exists in location object', (done) => {
createComponent({
shouldShow: true,
});
......@@ -267,7 +267,7 @@ describe('diffs/components/app', () => {
});
});
it('marks current diff file based on currently highlighted row', done => {
it('marks current diff file based on currently highlighted row', (done) => {
createComponent({
shouldShow: true,
});
......@@ -439,7 +439,7 @@ describe('diffs/components/app', () => {
wrapper.destroy();
});
it('jumps to next and previous files in the list', done => {
it('jumps to next and previous files in the list', (done) => {
wrapper.vm
.$nextTick()
.then(() => {
......@@ -459,7 +459,7 @@ describe('diffs/components/app', () => {
.catch(done.fail);
});
it('does not jump to previous file from the first one', done => {
it('does not jump to previous file from the first one', (done) => {
wrapper.vm
.$nextTick()
.then(() => {
......@@ -476,7 +476,7 @@ describe('diffs/components/app', () => {
.catch(done.fail);
});
it('does not jump to next file from the last one', done => {
it('does not jump to next file from the last one', (done) => {
wrapper.vm
.$nextTick()
.then(() => {
......
......@@ -31,7 +31,7 @@ describe('CompareDropdownLayout', () => {
const findListItems = () => wrapper.findAll('li');
const findListItemsData = () =>
findListItems().wrappers.map(listItem => ({
findListItems().wrappers.map((listItem) => ({
href: listItem.find('a').attributes('href'),
text: trimText(listItem.text()),
createdAt: listItem.findAll(TimeAgo).wrappers[0]?.props('time'),
......
......@@ -13,7 +13,7 @@ describe('CompareVersions', () => {
let wrapper;
const targetBranchName = 'tmp-wine-dev';
const createWrapper = props => {
const createWrapper = (props) => {
const store = createStore();
const mergeRequestDiff = diffsMockData[0];
......@@ -121,7 +121,7 @@ describe('CompareVersions', () => {
});
describe('commit', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper.vm.$store.state.diffs.commit = getDiffWithCommit().commit;
wrapper.mergeRequestDiffs = [];
......
......@@ -102,7 +102,7 @@ describe('DiffContent', () => {
describe('with text based files', () => {
afterEach(() => {
[isParallelViewGetterMock, isInlineViewGetterMock].forEach(m => m.mockRestore());
[isParallelViewGetterMock, isInlineViewGetterMock].forEach((m) => m.mockRestore());
});
const textDiffFile = { ...defaultProps.diffFile, viewer: { name: diffViewerModes.text } };
......
......@@ -15,7 +15,7 @@ describe('DiffDiscussions', () => {
let wrapper;
const getDiscussionsMockData = () => [{ ...discussionsMockData }];
const createComponent = props => {
const createComponent = (props) => {
store = createStore();
wrapper = mount(localVue.extend(DiffDiscussions), {
store,
......
......@@ -14,7 +14,7 @@ const lineSources = {
[INLINE_DIFF_VIEW_TYPE]: 'highlighted_diff_lines',
};
const lineHandlers = {
[INLINE_DIFF_VIEW_TYPE]: line => line,
[INLINE_DIFF_VIEW_TYPE]: (line) => line,
};
function makeLoadMoreLinesPayload({
......
......@@ -96,13 +96,13 @@ function createComponent({ file, first = false, last = false }) {
};
}
const findDiffHeader = wrapper => wrapper.find(DiffFileHeaderComponent);
const findDiffContentArea = wrapper => wrapper.find('[data-testid="content-area"]');
const findLoader = wrapper => wrapper.find('[data-testid="loader-icon"]');
const findToggleButton = wrapper => wrapper.find('[data-testid="expand-button"]');
const findDiffHeader = (wrapper) => wrapper.find(DiffFileHeaderComponent);
const findDiffContentArea = (wrapper) => wrapper.find('[data-testid="content-area"]');
const findLoader = (wrapper) => wrapper.find('[data-testid="loader-icon"]');
const findToggleButton = (wrapper) => wrapper.find('[data-testid="expand-button"]');
const toggleFile = wrapper => findDiffHeader(wrapper).vm.$emit('toggleFile');
const isDisplayNone = element => element.style.display === 'none';
const toggleFile = (wrapper) => findDiffHeader(wrapper).vm.$emit('toggleFile');
const isDisplayNone = (element) => element.style.display === 'none';
const getReadableFile = () => JSON.parse(JSON.stringify(diffFileMockDataReadable));
const getUnreadableFile = () => JSON.parse(JSON.stringify(diffFileMockDataUnreadable));
......@@ -157,7 +157,7 @@ describe('DiffFile', () => {
await wrapper.vm.$nextTick();
expect(eventHub.$emit).toHaveBeenCalledTimes(events.length);
events.forEach(event => {
events.forEach((event) => {
expect(eventHub.$emit).toHaveBeenCalledWith(event);
});
},
......@@ -174,7 +174,7 @@ describe('DiffFile', () => {
}));
jest.spyOn(wrapper.vm, 'loadCollapsedDiff').mockResolvedValue(getReadableFile());
jest.spyOn(window, 'requestIdleCallback').mockImplementation(fn => fn());
jest.spyOn(window, 'requestIdleCallback').mockImplementation((fn) => fn());
makeFileAutomaticallyCollapsed(store);
......@@ -247,7 +247,7 @@ describe('DiffFile', () => {
it('should not have any content at all', async () => {
await wrapper.vm.$nextTick();
Array.from(findDiffContentArea(wrapper).element.children).forEach(child => {
Array.from(findDiffContentArea(wrapper).element.children).forEach((child) => {
expect(isDisplayNone(child)).toBe(true);
});
});
......
......@@ -51,7 +51,7 @@ describe('DiffLineNoteForm', () => {
expect(window.confirm).not.toHaveBeenCalled();
});
it('should call cancelCommentForm with lineCode', done => {
it('should call cancelCommentForm with lineCode', (done) => {
jest.spyOn(window, 'confirm').mockImplementation(() => {});
jest.spyOn(wrapper.vm, 'cancelCommentForm').mockImplementation(() => {});
jest.spyOn(wrapper.vm, 'resetAutoSave').mockImplementation(() => {});
......@@ -72,7 +72,7 @@ describe('DiffLineNoteForm', () => {
});
describe('saveNoteForm', () => {
it('should call saveNote action with proper params', done => {
it('should call saveNote action with proper params', (done) => {
const saveDiffDiscussionSpy = jest
.spyOn(wrapper.vm, 'saveDiffDiscussion')
.mockReturnValue(Promise.resolve());
......
......@@ -39,7 +39,7 @@ describe('diff_stats', () => {
});
describe('line changes', () => {
const findFileLine = name => wrapper.find(name);
const findFileLine = (name) => wrapper.find(name);
it('shows the amount of lines added', () => {
expect(findFileLine('.js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString());
......@@ -51,10 +51,10 @@ describe('diff_stats', () => {
});
describe('files changes', () => {
const findIcon = name =>
const findIcon = (name) =>
wrapper
.findAll(GlIcon)
.filter(c => c.attributes('name') === name)
.filter((c) => c.attributes('name') === name)
.at(0).element.parentNode;
it('shows amount of file changed with plural "files" when 0 files has changed', () => {
......
......@@ -11,7 +11,7 @@ describe('DiffView', () => {
const DiffRow = { template: `<div/>` };
const DiffCommentCell = { template: `<div/>` };
const DraftNote = { template: `<div/>` };
const createWrapper = props => {
const createWrapper = (props) => {
const localVue = createLocalVue();
localVue.use(Vuex);
......
......@@ -114,7 +114,7 @@ describe('Diffs image diff overlay component', () => {
describe('comment form', () => {
const getCommentIndicator = () => wrapper.find('.comment-indicator');
beforeEach(() => {
createComponent({ canComment: true }, store => {
createComponent({ canComment: true }, (store) => {
store.state.diffs.commentForms.push({
fileHash: 'ABC',
x: 20,
......
......@@ -28,7 +28,7 @@ describe('Diff no changes empty state', () => {
});
it('prevents XSS', () => {
createComponent(store => {
createComponent((store) => {
// eslint-disable-next-line no-param-reassign
store.state.notes.noteableData = {
source_branch: '<script>alert("test");</script>',
......
......@@ -40,7 +40,7 @@ describe('ParallelDiffTableRow', () => {
vm = wrapper.vm;
});
it('does not highlight non empty line content when line does not match highlighted row', done => {
it('does not highlight non empty line content when line does not match highlighted row', (done) => {
vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.line_content.right-side').classList).not.toContain('hll');
......@@ -49,7 +49,7 @@ describe('ParallelDiffTableRow', () => {
.catch(done.fail);
});
it('highlights nonempty line content when line is the highlighted row', done => {
it('highlights nonempty line content when line is the highlighted row', (done) => {
vm.$nextTick()
.then(() => {
vm.$store.state.diffs.highlightedRow = rightLine.line_code;
......@@ -86,7 +86,7 @@ describe('ParallelDiffTableRow', () => {
}).$mount();
});
it('does not highlight either line when line does not match highlighted row', done => {
it('does not highlight either line when line does not match highlighted row', (done) => {
vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.line_content.right-side').classList).not.toContain('hll');
......@@ -96,7 +96,7 @@ describe('ParallelDiffTableRow', () => {
.catch(done.fail);
});
it('adds hll class to lineContent when line is the highlighted row', done => {
it('adds hll class to lineContent when line is the highlighted row', (done) => {
vm.$nextTick()
.then(() => {
vm.$store.state.diffs.highlightedRow = rightLine.line_code;
......@@ -112,7 +112,7 @@ describe('ParallelDiffTableRow', () => {
});
describe('sets coverage title and class', () => {
it('for lines with coverage', done => {
it('for lines with coverage', (done) => {
vm.$nextTick()
.then(() => {
const name = diffFileMockData.file_path;
......@@ -132,7 +132,7 @@ describe('ParallelDiffTableRow', () => {
.catch(done.fail);
});
it('for lines without coverage', done => {
it('for lines without coverage', (done) => {
vm.$nextTick()
.then(() => {
const name = diffFileMockData.file_path;
......@@ -152,7 +152,7 @@ describe('ParallelDiffTableRow', () => {
.catch(done.fail);
});
it('for unknown lines', done => {
it('for unknown lines', (done) => {
vm.$nextTick()
.then(() => {
vm.$store.state.diffs.coverageFiles = {};
......
......@@ -73,7 +73,7 @@ describe('Diff settings dropdown component', () => {
});
it('sets list button as selected when renderTreeList is false', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
renderTreeList: false,
});
......@@ -84,7 +84,7 @@ describe('Diff settings dropdown component', () => {
});
it('sets tree button as selected when renderTreeList is true', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
renderTreeList: true,
});
......@@ -97,7 +97,7 @@ describe('Diff settings dropdown component', () => {
describe('compare changes', () => {
it('sets inline button as selected', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
diffViewType: INLINE_DIFF_VIEW_TYPE,
});
......@@ -108,7 +108,7 @@ describe('Diff settings dropdown component', () => {
});
it('sets parallel button as selected', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
diffViewType: PARALLEL_DIFF_VIEW_TYPE,
});
......@@ -137,7 +137,7 @@ describe('Diff settings dropdown component', () => {
describe('whitespace toggle', () => {
it('does not set as checked when showWhitespace is false', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
showWhitespace: false,
});
......@@ -147,7 +147,7 @@ describe('Diff settings dropdown component', () => {
});
it('sets as checked when showWhitespace is true', () => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
showWhitespace: true,
});
......@@ -183,7 +183,7 @@ describe('Diff settings dropdown component', () => {
`(
'sets the checkbox to { checked: $checked } if the fileByFile setting is $fileByFile',
async ({ fileByFile, checked }) => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
viewDiffsFileByFile: fileByFile,
});
......@@ -202,7 +202,7 @@ describe('Diff settings dropdown component', () => {
`(
'when the file by file setting starts as $start, toggling the checkbox should emit an event set to $emit',
async ({ start, emit }) => {
createComponent(store => {
createComponent((store) => {
Object.assign(store.state.diffs, {
viewDiffsFileByFile: start,
});
......
This diff is collapsed.
......@@ -49,7 +49,7 @@ describe('Compare diff version dropdowns', () => {
let expectedHeadVersion;
const originalLocation = window.location;
const setupTest = includeDiffHeadParam => {
const setupTest = (includeDiffHeadParam) => {
const diffHeadParam = includeDiffHeadParam ? '?diff_head=true' : '';
Object.defineProperty(window, 'location', {
......@@ -81,7 +81,7 @@ describe('Compare diff version dropdowns', () => {
};
};
const assertVersions = targetVersions => {
const assertVersions = (targetVersions) => {
// base and head should be the last two versions in that order
const targetBaseVersion = targetVersions[targetVersions.length - 2];
const targetHeadVersion = targetVersions[targetVersions.length - 1];
......
......@@ -481,7 +481,7 @@ describe('DiffsStoreUtils', () => {
});
it('adds the `.brokenSymlink` property to each diff file', () => {
preparedDiff.diff_files.forEach(file => {
preparedDiff.diff_files.forEach((file) => {
expect(file).toEqual(expect.objectContaining({ brokenSymlink: false }));
});
});
......@@ -492,9 +492,9 @@ describe('DiffsStoreUtils', () => {
...splitInlineDiff.diff_files,
...splitParallelDiff.diff_files,
...completedDiff.diff_files,
].flatMap(file => [...file[INLINE_DIFF_LINES_KEY]]);
].flatMap((file) => [...file[INLINE_DIFF_LINES_KEY]]);
lines.forEach(line => {
lines.forEach((line) => {
expect(line.commentsDisabled).toBe(false);
});
});
......@@ -560,7 +560,7 @@ describe('DiffsStoreUtils', () => {
});
it('adds the `.brokenSymlink` property to each meta diff file', () => {
preparedDiffFiles.forEach(file => {
preparedDiffFiles.forEach((file) => {
expect(file).toMatchObject({ brokenSymlink: false });
});
});
......
......@@ -32,7 +32,7 @@ describe('UUIDs Util', () => {
const ids = uuids({ count: 11 });
expect(ids.length).toEqual(11);
expect(ids.every(id => UUIDV4.test(id))).toEqual(true);
expect(ids.every((id) => UUIDV4.test(id))).toEqual(true);
});
it.each`
......
import DirtySubmitCollection from '~/dirty_submit/dirty_submit_collection';
import { setInputValue, createForm } from './helper';
jest.mock('lodash/throttle', () => jest.fn(fn => fn));
jest.mock('lodash/throttle', () => jest.fn((fn) => fn));
describe('DirtySubmitCollection', () => {
const testElementsCollection = [createForm(), createForm()];
const forms = testElementsCollection.map(testElements => testElements.form);
const forms = testElementsCollection.map((testElements) => testElements.form);
new DirtySubmitCollection(forms); // eslint-disable-line no-new
it.each(testElementsCollection)('disables submits until there are changes', testElements => {
it.each(testElementsCollection)('disables submits until there are changes', (testElements) => {
const { input, submit } = testElements;
const originalValue = input.value;
......
......@@ -2,7 +2,7 @@ import { range as rge, throttle } from 'lodash';
import DirtySubmitForm from '~/dirty_submit/dirty_submit_form';
import { getInputValue, setInputValue, createForm } from './helper';
jest.mock('lodash/throttle', () => jest.fn(fn => fn));
jest.mock('lodash/throttle', () => jest.fn((fn) => fn));
const lodash = jest.requireActual('lodash');
function expectToToggleDisableOnDirtyUpdate(submit, input) {
......@@ -66,7 +66,7 @@ describe('DirtySubmitForm', () => {
const { form, input } = createForm();
const updateDirtyInputSpy = jest.spyOn(new DirtySubmitForm(form), 'updateDirtyInput');
rge(10).forEach(i => {
rge(10).forEach((i) => {
setInputValue(input, `change ${i}`, false);
});
......@@ -78,13 +78,13 @@ describe('DirtySubmitForm', () => {
it('does not throttle updates when rapid changes are made to different form elements', () => {
const form = document.createElement('form');
const range = rge(10);
range.forEach(i => {
range.forEach((i) => {
form.innerHTML += `<input type="text" name="input-${i}" class="js-input-${i}"/>`;
});
const updateDirtyInputSpy = jest.spyOn(new DirtySubmitForm(form), 'updateDirtyInput');
range.forEach(i => {
range.forEach((i) => {
const input = form.querySelector(`.js-input-${i}`);
setInputValue(input, `change`, false);
});
......
......@@ -151,7 +151,7 @@ describe('DropLab DropDown', () => {
};
testContext.dummyListItem = document.createElement('li');
jest.spyOn(testContext.event.target, 'closest').mockImplementation(selector => {
jest.spyOn(testContext.event.target, 'closest').mockImplementation((selector) => {
if (selector === 'li') {
return testContext.dummyListItem;
}
......@@ -402,7 +402,7 @@ describe('DropLab DropDown', () => {
beforeEach(() => {
testContext.renderableList = {};
testContext.list = {
querySelector: q => {
querySelector: (q) => {
if (q === '.filter-dropdown-loading') {
return false;
}
......@@ -414,7 +414,7 @@ describe('DropLab DropDown', () => {
testContext.data = [0, 1];
testContext.customEvent = {};
jest.spyOn(testContext.dropdown, 'renderChildren').mockImplementation(data => data);
jest.spyOn(testContext.dropdown, 'renderChildren').mockImplementation((data) => data);
jest.spyOn(testContext.list, 'dispatchEvent').mockImplementation(() => {});
jest.spyOn(testContext.data, 'map');
jest.spyOn(window, 'CustomEvent').mockReturnValue(testContext.customEvent);
......@@ -465,7 +465,7 @@ describe('DropLab DropDown', () => {
testContext.dropdown = { renderChildren: () => {}, list: testContext.list };
testContext.data = [0, 1];
jest.spyOn(testContext.dropdown, 'renderChildren').mockImplementation(data => data);
jest.spyOn(testContext.dropdown, 'renderChildren').mockImplementation((data) => data);
jest.spyOn(testContext.list, 'querySelector').mockImplementation(() => {});
jest.spyOn(testContext.data, 'map');
......
......@@ -28,7 +28,7 @@ describe('AjaxFilter', () => {
let ajaxSpy;
beforeEach(() => {
jest.spyOn(AjaxCache, 'retrieve').mockImplementation(url => ajaxSpy(url));
jest.spyOn(AjaxCache, 'retrieve').mockImplementation((url) => ajaxSpy(url));
jest.spyOn(AjaxFilter, '_loadData').mockImplementation(() => {});
dummyConfig.onLoadingFinished = jest.fn();
......@@ -38,8 +38,8 @@ describe('AjaxFilter', () => {
dummyList.list.appendChild(dynamicList);
});
it('calls onLoadingFinished after loading data', done => {
ajaxSpy = url => {
it('calls onLoadingFinished after loading data', (done) => {
ajaxSpy = (url) => {
expect(url).toBe('dummy endpoint?dummy search key=');
return Promise.resolve(dummyData);
};
......@@ -52,16 +52,16 @@ describe('AjaxFilter', () => {
.catch(done.fail);
});
it('does not call onLoadingFinished if Ajax call fails', done => {
it('does not call onLoadingFinished if Ajax call fails', (done) => {
const dummyError = new Error('My dummy is sick! :-(');
ajaxSpy = url => {
ajaxSpy = (url) => {
expect(url).toBe('dummy endpoint?dummy search key=');
return Promise.reject(dummyError);
};
AjaxFilter.trigger()
.then(done.fail)
.catch(error => {
.catch((error) => {
expect(error).toBe(dummyError);
expect(dummyConfig.onLoadingFinished.mock.calls.length).toBe(0);
})
......
......@@ -16,7 +16,7 @@ describe('The basis for an Editor Lite extension', () => {
if (instance) {
if (options) {
Object.entries(options).forEach(prop => {
Object.entries(options).forEach((prop) => {
expect(instance[prop]).toBeUndefined();
});
// Both instance and options are passed
......
......@@ -324,13 +324,13 @@ describe('Base editor', () => {
${'multiple simple objects'} | ${[FooObjExt, BarObjExt]} | ${['foo', 'bar']} | ${[fooRes, barRes]}
${'combination of ES6 classes and objects'} | ${[AlphaExt, BarObjExt]} | ${['alpha', 'bar']} | ${[alphaRes, barRes]}
`('is extensible with $type', ({ extensions, methods, expectations } = {}) => {
methods.forEach(method => {
methods.forEach((method) => {
expect(instance[method]).toBeUndefined();
});
instance.use(extensions);
methods.forEach(method => {
methods.forEach((method) => {
expect(instance[method]).toBeDefined();
});
......@@ -359,7 +359,7 @@ describe('Base editor', () => {
it.each([WithStaticMethod, WithStaticMethodExtended])(
'properly resolves data for an extension with private data',
ExtClass => {
(ExtClass) => {
const base = 1;
expect(instance.base).toBeUndefined();
expect(instance.boo).toBeUndefined();
......@@ -408,7 +408,7 @@ describe('Base editor', () => {
};
beforeEach(() => {
editorExtensionSpy = jest.spyOn(Editor, 'pushToImportsArray').mockImplementation(arr => {
editorExtensionSpy = jest.spyOn(Editor, 'pushToImportsArray').mockImplementation((arr) => {
arr.push(
Promise.resolve({
default: {},
......@@ -524,7 +524,7 @@ describe('Base editor', () => {
});
it('sets default syntax highlighting theme', () => {
const expectedTheme = themes.find(t => t.name === DEFAULT_THEME);
const expectedTheme = themes.find((t) => t.name === DEFAULT_THEME);
editor = new Editor();
......@@ -533,7 +533,7 @@ describe('Base editor', () => {
});
it('sets correct theme if it is set in users preferences', () => {
const expectedTheme = themes.find(t => t.name !== DEFAULT_THEME);
const expectedTheme = themes.find((t) => t.name !== DEFAULT_THEME);
expect(expectedTheme.name).not.toBe(DEFAULT_THEME);
......
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