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