Commit 157e117f authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 55 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 7cfe360c
......@@ -1706,39 +1706,6 @@ spec/frontend/behaviors/markdown/paste_markdown_table_spec.js
spec/frontend/behaviors/quick_submit_spec.js
spec/frontend/behaviors/secret_values_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
......
......@@ -15,7 +15,7 @@ describe('branches delete modal', () => {
</div>
`);
$deleteButton = $('.js-delete-branch');
submitSpy = jest.fn(event => event.preventDefault());
submitSpy = jest.fn((event) => event.preventDefault());
$('#modal-delete-branch form').on('submit', submitSpy);
// eslint-disable-next-line no-new
new DeleteModal();
......
......@@ -16,14 +16,14 @@ describe('TriggersList', () => {
};
const findTable = () => wrapper.find(GlTable);
const findHeaderAt = i => wrapper.findAll('thead th').at(i);
const findHeaderAt = (i) => wrapper.findAll('thead th').at(i);
const findRows = () => wrapper.findAll('tbody tr');
const findRowAt = i => findRows().at(i);
const findRowAt = (i) => findRows().at(i);
const findCell = (i, col) => findRowAt(i).findAll('td').at(col);
const findClipboardBtn = i => findCell(i, 0).find(ClipboardButton);
const findInvalidBadge = i => findCell(i, 0).find(GlBadge);
const findEditBtn = i => findRowAt(i).find('[data-testid="edit-btn"]');
const findRevokeBtn = i => findRowAt(i).find('[data-testid="trigger_revoke_button"]');
const findClipboardBtn = (i) => findCell(i, 0).find(ClipboardButton);
const findInvalidBadge = (i) => findCell(i, 0).find(GlBadge);
const findEditBtn = (i) => findRowAt(i).find('[data-testid="edit-btn"]');
const findRevokeBtn = (i) => findRowAt(i).find('[data-testid="trigger_revoke_button"]');
beforeEach(() => {
createComponent();
......
......@@ -10,7 +10,7 @@ describe('Ci environments dropdown', () => {
let wrapper;
let store;
const createComponent = term => {
const createComponent = (term) => {
store = new Vuex.Store({
getters: {
joinedEnvironments: () => ['dev', 'prod', 'staging'],
......@@ -27,8 +27,8 @@ describe('Ci environments dropdown', () => {
};
const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index);
const findActiveIconByIndex = index => findDropdownItemByIndex(index).find(GlIcon);
const findDropdownItemByIndex = (index) => wrapper.findAll(GlDropdownItem).at(index);
const findActiveIconByIndex = (index) => findDropdownItemByIndex(index).find(GlIcon);
afterEach(() => {
wrapper.destroy();
......@@ -78,7 +78,7 @@ describe('Ci environments dropdown', () => {
});
it('should not display create button', () => {
const environments = findAllDropdownItems().filter(env => env.text().startsWith('Create'));
const environments = findAllDropdownItems().filter((env) => env.text().startsWith('Create'));
expect(environments).toHaveLength(0);
expect(findAllDropdownItems()).toHaveLength(1);
});
......
......@@ -31,11 +31,11 @@ describe('Ci variable modal', () => {
const findAddorUpdateButton = () =>
findModal()
.findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'success');
.wrappers.find((button) => button.props('variant') === 'success');
const deleteVariableButton = () =>
findModal()
.findAll(GlButton)
.wrappers.find(button => button.props('variant') === 'danger');
.wrappers.find((button) => button.props('variant') === 'danger');
afterEach(() => {
wrapper.destroy();
......
......@@ -11,7 +11,7 @@ describe('Ci variable table', () => {
let store;
let isGroup;
const createComponent = groupState => {
const createComponent = (groupState) => {
store = createStore();
store.state.isGroup = groupState;
jest.spyOn(store, 'dispatch').mockImplementation();
......
......@@ -86,7 +86,7 @@ describe('CI variable list store actions', () => {
});
describe('deleteVariable', () => {
it('dispatch correct actions on successful deleted variable', done => {
it('dispatch correct actions on successful deleted variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -105,7 +105,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on delete failure', done => {
it('should show flash error and set error in state on delete failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -129,7 +129,7 @@ describe('CI variable list store actions', () => {
});
describe('updateVariable', () => {
it('dispatch correct actions on successful updated variable', done => {
it('dispatch correct actions on successful updated variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -148,7 +148,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on update failure', done => {
it('should show flash error and set error in state on update failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -172,7 +172,7 @@ describe('CI variable list store actions', () => {
});
describe('addVariable', () => {
it('dispatch correct actions on successful added variable', done => {
it('dispatch correct actions on successful added variable', (done) => {
mock.onPatch(state.endpoint).reply(200);
testAction(
......@@ -191,7 +191,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on add failure', done => {
it('should show flash error and set error in state on add failure', (done) => {
mock.onPatch(state.endpoint).reply(500, '');
testAction(
......@@ -215,7 +215,7 @@ describe('CI variable list store actions', () => {
});
describe('fetchVariables', () => {
it('dispatch correct actions on fetchVariables', done => {
it('dispatch correct actions on fetchVariables', (done) => {
mock.onGet(state.endpoint).reply(200, { variables: mockData.mockVariables });
testAction(
......@@ -236,7 +236,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on fetch variables failure', done => {
it('should show flash error and set error in state on fetch variables failure', (done) => {
mock.onGet(state.endpoint).reply(500);
testAction(actions.fetchVariables, {}, state, [], [{ type: 'requestVariables' }], () => {
......@@ -247,7 +247,7 @@ describe('CI variable list store actions', () => {
});
describe('fetchEnvironments', () => {
it('dispatch correct actions on fetchEnvironments', done => {
it('dispatch correct actions on fetchEnvironments', (done) => {
Api.environments = jest.fn().mockResolvedValue({ data: mockData.mockEnvironments });
testAction(
......@@ -268,7 +268,7 @@ describe('CI variable list store actions', () => {
);
});
it('should show flash error and set error in state on fetch environments failure', done => {
it('should show flash error and set error in state on fetch environments failure', (done) => {
Api.environments = jest.fn().mockRejectedValue();
testAction(
......
......@@ -279,7 +279,7 @@ describe('Clusters', () => {
});
describe('uninstallApplication', () => {
it.each(APPLICATIONS)('tries to uninstall %s', applicationId => {
it.each(APPLICATIONS)('tries to uninstall %s', (applicationId) => {
jest.spyOn(cluster.service, 'uninstallApplication').mockResolvedValueOnce();
cluster.store.state.applications[applicationId].status = INSTALLED;
......
......@@ -15,7 +15,7 @@ describe('Application Row', () => {
wrapper.destroy();
});
const mountComponent = data => {
const mountComponent = (data) => {
wrapper = shallowMount(ApplicationRow, {
stubs: { GlSprintf },
propsData: {
......
......@@ -29,8 +29,8 @@ describe('Applications', () => {
});
};
const createShallowApp = options => createApp(options, true);
const findByTestId = id => wrapper.find(`[data-testid="${id}"]`);
const createShallowApp = (options) => createApp(options, true);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
afterEach(() => {
wrapper.destroy();
});
......
......@@ -37,11 +37,11 @@ describe('FluentdOutputSettings', () => {
const findSaveButton = () => wrapper.find({ ref: 'saveBtn' });
const findCancelButton = () => wrapper.find({ ref: 'cancelBtn' });
const findProtocolDropdown = () => wrapper.find(GlDropdown);
const findCheckbox = name =>
wrapper.findAll(GlFormCheckbox).wrappers.find(x => x.text() === name);
const findCheckbox = (name) =>
wrapper.findAll(GlFormCheckbox).wrappers.find((x) => x.text() === name);
const findHost = () => wrapper.find('#fluentd-host');
const findPort = () => wrapper.find('#fluentd-port');
const changeCheckbox = checkbox => {
const changeCheckbox = (checkbox) => {
const currentValue = checkbox.attributes('checked')?.toString() === 'true';
checkbox.vm.$emit('input', !currentValue);
};
......@@ -49,9 +49,9 @@ describe('FluentdOutputSettings', () => {
element.value = val;
element.dispatchEvent(new Event('input'));
};
const changePort = val => changeInput(findPort(), val);
const changeHost = val => changeInput(findHost(), val);
const changeProtocol = idx => findProtocolDropdown().vm.$children[idx].$emit('click');
const changePort = (val) => changeInput(findPort(), val);
const changeHost = (val) => changeInput(findHost(), val);
const changeProtocol = (idx) => findProtocolDropdown().vm.$children[idx].$emit('click');
const toApplicationSettings = ({ wafLogEnabled, ciliumLogEnabled, ...settings }) => ({
...settings,
waf_log_enabled: wafLogEnabled,
......
......@@ -25,7 +25,7 @@ const {
const NO_EFFECTS = 'no effects';
describe('applicationStateMachine', () => {
const noEffectsToEmptyObject = effects => (typeof effects === 'string' ? {} : effects);
const noEffectsToEmptyObject = (effects) => (typeof effects === 'string' ? {} : effects);
describe(`current state is ${NO_STATUS}`, () => {
it.each`
......@@ -42,7 +42,7 @@ describe('applicationStateMachine', () => {
${UNINSTALLING} | ${UNINSTALLING} | ${NO_EFFECTS}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: NO_STATUS,
......@@ -59,7 +59,7 @@ describe('applicationStateMachine', () => {
it.each`
expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${NO_EFFECTS}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: NOT_INSTALLABLE,
......@@ -79,7 +79,7 @@ describe('applicationStateMachine', () => {
${INSTALLED} | ${INSTALLED} | ${{ installFailed: false }}
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${{ installFailed: false }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLABLE,
......@@ -97,7 +97,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLING,
......@@ -118,7 +118,7 @@ describe('applicationStateMachine', () => {
${NOT_INSTALLABLE} | ${NOT_INSTALLABLE} | ${NO_EFFECTS}
${UNINSTALLED} | ${UNINSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: INSTALLED,
......@@ -136,7 +136,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${UPDATED} | ${{ updateSuccessful: true }}
${INSTALLED} | ${UPDATE_ERRORED} | ${{ updateFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UPDATING,
......@@ -154,7 +154,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLABLE} | ${INSTALLABLE} | ${{ uninstallSuccessful: true }}
${INSTALLED} | ${UNINSTALL_ERRORED} | ${{ uninstallFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UNINSTALLING,
......@@ -172,7 +172,7 @@ describe('applicationStateMachine', () => {
expectedState | event | effects
${INSTALLED} | ${INSTALLED} | ${NO_EFFECTS}
${INSTALLABLE} | ${ERROR} | ${{ installFailed: true }}
`(`transitions to $expectedState on $event event and applies $effects`, data => {
`(`transitions to $expectedState on $event event and applies $effects`, (data) => {
const { expectedState, event, effects } = data;
const currentAppState = {
status: UNINSTALLED,
......
......@@ -5,7 +5,7 @@ import NodeErrorHelpText from '~/clusters_list/components/node_error_help_text.v
describe('NodeErrorHelpText', () => {
let wrapper;
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(NodeErrorHelpText, { propsData, stubs: { GlPopover } });
return wrapper.vm.$nextTick();
};
......
......@@ -24,7 +24,7 @@ describe('Clusters store actions', () => {
captureException.mockRestore();
});
it('should report sentry error', done => {
it('should report sentry error', (done) => {
const sentryError = new Error('New Sentry Error');
const tag = 'sentryErrorTag';
......@@ -62,7 +62,7 @@ describe('Clusters store actions', () => {
afterEach(() => mock.restore());
it('should commit SET_CLUSTERS_DATA with received response', done => {
it('should commit SET_CLUSTERS_DATA with received response', (done) => {
mock.onGet().reply(200, apiData, headers);
testAction(
......@@ -79,7 +79,7 @@ describe('Clusters store actions', () => {
);
});
it('should show flash on API error', done => {
it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found');
testAction(
......@@ -126,7 +126,7 @@ describe('Clusters store actions', () => {
pollStop.mockRestore();
});
it('should stop polling after MAX Requests', done => {
it('should stop polling after MAX Requests', (done) => {
testAction(
actions.fetchClusters,
{ endpoint: apiData.endpoint },
......@@ -173,7 +173,7 @@ describe('Clusters store actions', () => {
);
});
it('should stop polling and report to Sentry when data is invalid', done => {
it('should stop polling and report to Sentry when data is invalid', (done) => {
const badApiResponse = { clusters: {} };
mock.onGet().reply(200, badApiResponse, pollHeaders);
......
......@@ -8,7 +8,7 @@ jest.mock('~/code_navigation/utils');
describe('Code navigation actions', () => {
describe('setInitialData', () => {
it('commits SET_INITIAL_DATA', done => {
it('commits SET_INITIAL_DATA', (done) => {
testAction(
actions.setInitialData,
{ projectPath: 'test' },
......@@ -57,7 +57,7 @@ describe('Code navigation actions', () => {
]);
});
it('commits REQUEST_DATA_SUCCESS with normalized data', done => {
it('commits REQUEST_DATA_SUCCESS with normalized data', (done) => {
testAction(
actions.fetchData,
null,
......@@ -84,7 +84,7 @@ describe('Code navigation actions', () => {
);
});
it('calls addInteractionClass with data', done => {
it('calls addInteractionClass with data', (done) => {
testAction(
actions.fetchData,
null,
......@@ -125,7 +125,7 @@ describe('Code navigation actions', () => {
mock.onGet(codeNavigationPath).replyOnce(500);
});
it('dispatches requestDataError', done => {
it('dispatches requestDataError', (done) => {
testAction(
actions.fetchData,
null,
......@@ -175,15 +175,15 @@ describe('Code navigation actions', () => {
target = document.querySelector('.js-test');
});
it('returns early when no data exists', done => {
it('returns early when no data exists', (done) => {
testAction(actions.showDefinition, { target }, {}, [], [], done);
});
it('commits SET_CURRENT_DEFINITION when target is not code navitation element', done => {
it('commits SET_CURRENT_DEFINITION when target is not code navitation element', (done) => {
testAction(actions.showDefinition, { target }, { data: {} }, [], [], done);
});
it('commits SET_CURRENT_DEFINITION with LSIF data', done => {
it('commits SET_CURRENT_DEFINITION with LSIF data', (done) => {
target.classList.add('js-code-navigation');
target.setAttribute('data-line-index', '0');
target.setAttribute('data-char-index', '0');
......
......@@ -62,7 +62,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
).toBe('Add a to do');
});
it('toggle todo state', done => {
it('toggle todo state', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -80,7 +80,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('toggle todo state of expanded todo toggle', done => {
it('toggle todo state of expanded todo toggle', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -92,7 +92,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('toggles todo button tooltip', done => {
it('toggles todo button tooltip', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -106,7 +106,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('marks todo as done', done => {
it('marks todo as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises()
......@@ -131,7 +131,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
.catch(done.fail);
});
it('updates aria-label to Mark as done', done => {
it('updates aria-label to Mark as done', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
setImmediate(() => {
......@@ -145,7 +145,7 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
});
});
it('updates aria-label to add todo', done => {
it('updates aria-label to add todo', (done) => {
document.querySelector('.js-issuable-todo.sidebar-collapsed-icon').click();
waitForPromises()
......
......@@ -105,7 +105,7 @@ describe('Commit pipeline status component', () => {
describe('when polling', () => {
let pollConfig;
beforeEach(() => {
Poll.mockImplementation(config => {
Poll.mockImplementation((config) => {
pollConfig = config;
return { makeRequest: jest.fn(), restart: jest.fn(), stop: jest.fn() };
});
......
......@@ -31,7 +31,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const { pipelines } = getJSONFixture(jsonFixtureName);
PipelinesTable = Vue.extend(pipelinesTable);
pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
});
afterEach(() => {
......@@ -47,7 +47,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render the empty state', done => {
it('should render the empty state', (done) => {
setImmediate(() => {
expect(vm.$el.querySelector('.empty-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......@@ -63,7 +63,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render a table with the received pipelines', done => {
it('should render a table with the received pipelines', (done) => {
setImmediate(() => {
expect(vm.$el.querySelectorAll('.ci-table .commit').length).toEqual(1);
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......@@ -74,7 +74,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('with pagination', () => {
it('should make an API request when using pagination', done => {
it('should make an API request when using pagination', (done) => {
setImmediate(() => {
jest.spyOn(vm, 'updateContent').mockImplementation(() => {});
......@@ -102,11 +102,11 @@ describe('Pipelines table in Commits and Merge requests', () => {
mock.onGet('endpoint.json').reply(200, [pipeline]);
});
it('should receive update-pipelines-count event', done => {
it('should receive update-pipelines-count event', (done) => {
const element = document.createElement('div');
document.body.appendChild(element);
element.addEventListener('update-pipelines-count', event => {
element.addEventListener('update-pipelines-count', (event) => {
expect(event.detail.pipelines).toEqual([pipeline]);
done();
});
......@@ -126,7 +126,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('when latest pipeline has detached flag', () => {
it('renders the run pipeline button', done => {
it('renders the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
pipelineCopy.flags.merge_request_pipeline = true;
......@@ -143,7 +143,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
describe('when latest pipeline does not have detached flag', () => {
it('does not render the run pipeline button', done => {
it('does not render the run pipeline button', (done) => {
pipelineCopy.flags.detached_merge_request_pipeline = false;
pipelineCopy.flags.merge_request_pipeline = false;
......@@ -163,7 +163,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => {
beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
......@@ -182,7 +182,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on desktop, shows a loading button', done => {
it('on desktop, shows a loading button', (done) => {
findRunPipelineBtn().click();
vm.$nextTick(() => {
......@@ -200,7 +200,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on mobile, shows a loading button', done => {
it('on mobile, shows a loading button', (done) => {
findRunPipelineBtnMobile().click();
vm.$nextTick(() => {
......@@ -223,7 +223,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
const findModal = () =>
document.querySelector('#create-pipeline-for-fork-merge-request-modal');
beforeEach(done => {
beforeEach((done) => {
pipelineCopy.flags.detached_merge_request_pipeline = true;
mock.onGet('endpoint.json').reply(200, [pipelineCopy]);
......@@ -244,7 +244,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on desktop, shows a security warning modal', done => {
it('on desktop, shows a security warning modal', (done) => {
findRunPipelineBtn().click();
vm.$nextTick(() => {
......@@ -253,7 +253,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
});
});
it('on mobile, shows a security warning modal', done => {
it('on mobile, shows a security warning modal', (done) => {
findRunPipelineBtnMobile().click();
vm.$nextTick(() => {
......@@ -271,7 +271,7 @@ describe('Pipelines table in Commits and Merge requests', () => {
vm = mountComponent(PipelinesTable, props);
});
it('should render error state', done => {
it('should render error state', (done) => {
setImmediate(() => {
expect(vm.$el.querySelector('.js-pipelines-error-state')).toBeDefined();
expect(vm.$el.querySelector('.realtime-loading')).toBe(null);
......
......@@ -70,7 +70,7 @@ describe('Commits List', () => {
mock.restore();
});
it('should save the last search string', done => {
it('should save the last search string', (done) => {
commitsList.searchField.val('GitLab');
commitsList
.filterResults()
......@@ -83,7 +83,7 @@ describe('Commits List', () => {
.catch(done.fail);
});
it('should not make ajax call if the input does not change', done => {
it('should not make ajax call if the input does not change', (done) => {
commitsList
.filterResults()
.then(() => {
......
......@@ -29,7 +29,7 @@ describe('ConfirmModal', () => {
beforeEach(() => {
const buttonContainer = document.createElement('div');
buttons.forEach(x => {
buttons.forEach((x) => {
const button = document.createElement('button');
button.setAttribute('class', 'js-confirm-modal-button');
button.setAttribute('data-path', x.path);
......@@ -50,7 +50,7 @@ describe('ConfirmModal', () => {
const findModal = () => document.querySelector('.gl-modal');
const findModalOkButton = (modal, variant) =>
modal.querySelector(`.modal-footer .btn-${variant}`);
const findModalCancelButton = modal => modal.querySelector('.modal-footer .btn-secondary');
const findModalCancelButton = (modal) => modal.querySelector('.modal-footer .btn-secondary');
const modalIsHidden = () => findModal() === null;
const serializeModal = (modal, buttonIndex) => {
......@@ -63,7 +63,7 @@ describe('ConfirmModal', () => {
title: modal.querySelector('.modal-title').innerHTML,
message: modal.querySelector('.modal-body div').innerHTML,
okVariant: [...findModalOkButton(modal, modalAttributes.okVariant).classList]
.find(x => x.match('btn-'))
.find((x) => x.match('btn-'))
.replace('btn-', ''),
okTitle: findModalOkButton(modal, modalAttributes.okVariant).innerHTML,
},
......
......@@ -17,7 +17,7 @@ describe('Contributors store actions', () => {
mock = new MockAdapter(axios);
});
it('should commit SET_CHART_DATA with received response', done => {
it('should commit SET_CHART_DATA with received response', (done) => {
mock.onGet().reply(200, chartData);
testAction(
......@@ -37,7 +37,7 @@ describe('Contributors store actions', () => {
);
});
it('should show flash on API error', done => {
it('should show flash on API error', (done) => {
mock.onGet().reply(400, 'Not Found');
testAction(
......
......@@ -128,7 +128,7 @@ describe('EksClusterConfigurationForm', () => {
});
};
const createValidStateStore = initialState => {
const createValidStateStore = (initialState) => {
createStore({
initialState: {
clusterName: 'cluster name',
......
......@@ -94,7 +94,7 @@ describe('EKS Cluster Store Actions', () => {
${'setNodeCount'} | ${SET_NODE_COUNT} | ${{ nodeCount }} | ${'node count'}
${'setGitlabManagedCluster'} | ${SET_GITLAB_MANAGED_CLUSTER} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
${'setNamespacePerEnvironment'} | ${SET_NAMESPACE_PER_ENVIRONMENT} | ${namespacePerEnvironment} | ${'namespace per environment'}
`(`$action commits $mutation with $payloadDescription payload`, data => {
`(`$action commits $mutation with $payloadDescription payload`, (data) => {
const { action, mutation, payload } = data;
testAction(actions[action], payload, state, [{ type: mutation, payload }]);
......
......@@ -6,7 +6,7 @@ describe('EKS Cluster Store Getters', () => {
expect(subnetValid({ selectedSubnet: [1, 2] })).toBe(true);
});
it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', subnets => {
it.each([[[], [1]]])('returns false if there are 1 or less selected subnets', (subnets) => {
expect(subnetValid({ selectedSubnet: subnets })).toBe(false);
});
});
......
......@@ -66,7 +66,7 @@ describe('Create EKS cluster store mutations', () => {
${SET_INSTANCE_TYPE} | ${'selectedInstanceType'} | ${{ instanceType }} | ${instanceType} | ${'selected instance type payload'}
${SET_NODE_COUNT} | ${'nodeCount'} | ${{ nodeCount }} | ${nodeCount} | ${'node count payload'}
${SET_GITLAB_MANAGED_CLUSTER} | ${'gitlabManagedCluster'} | ${{ gitlabManagedCluster }} | ${gitlabManagedCluster} | ${'gitlab managed cluster'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => {
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload);
......
......@@ -8,7 +8,7 @@ const cloudbilling = {
projects: {
getBillingInfo: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { billingEnabled: true },
});
......@@ -21,7 +21,7 @@ const cloudresourcemanager = {
projects: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiProjectsResponseMock },
});
......@@ -34,7 +34,7 @@ const compute = {
zones: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiZonesResponseMock },
});
......@@ -44,7 +44,7 @@ const compute = {
machineTypes: {
list: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
resolve({
result: { ...gapiMachineTypesResponseMock },
});
......
......@@ -14,7 +14,7 @@ import {
describe('GCP Cluster Dropdown Store Actions', () => {
describe('setProject', () => {
it('should set project', done => {
it('should set project', (done) => {
testAction(
actions.setProject,
selectedProjectMock,
......@@ -27,7 +27,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setZone', () => {
it('should set zone', done => {
it('should set zone', (done) => {
testAction(
actions.setZone,
selectedZoneMock,
......@@ -40,7 +40,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setMachineType', () => {
it('should set machine type', done => {
it('should set machine type', (done) => {
testAction(
actions.setMachineType,
selectedMachineTypeMock,
......@@ -53,7 +53,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('setIsValidatingProjectBilling', () => {
it('should set machine type', done => {
it('should set machine type', (done) => {
testAction(
actions.setIsValidatingProjectBilling,
true,
......@@ -92,7 +92,7 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('validateProjectBilling', () => {
it('checks project billing status from Google API', done => {
it('checks project billing status from Google API', (done) => {
testAction(
actions.validateProjectBilling,
true,
......
......@@ -2,8 +2,8 @@ import initGkeNamespace from '~/create_cluster/gke_cluster_namespace';
describe('GKE cluster namespace', () => {
const changeEvent = new Event('change');
const isHidden = el => el.classList.contains('hidden');
const hasDisabledInput = el => el.querySelector('input').disabled;
const isHidden = (el) => el.classList.contains('hidden');
const hasDisabledInput = (el) => el.querySelector('input').disabled;
let glManagedCheckbox;
let selfManaged;
......
......@@ -27,7 +27,7 @@ describe('Cluster dropdown store mutations', () => {
${RECEIVE_ITEMS_SUCCESS} | ${'items'} | ${{ items }} | ${items} | ${'items payload'}
${RECEIVE_ITEMS_ERROR} | ${'isLoadingItems'} | ${{ error }} | ${false} | ${false}
${RECEIVE_ITEMS_ERROR} | ${'error'} | ${{ error }} | ${error} | ${'received error object'}
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, data => {
`(`$mutation sets $mutatedProperty to $expectedValueDescription`, (data) => {
const { mutation, mutatedProperty, payload, expectedValue } = data;
mutations[mutation](state, payload);
......
......@@ -162,7 +162,7 @@ describe('CreateItemDropdown', () => {
getData: (term, callback) => {
callback(DROPDOWN_ITEM_DATA);
},
createNewItemFromValue: newValue => ({
createNewItemFromValue: (newValue) => ({
title: `${newValue}-title`,
id: `${newValue}-id`,
text: `${newValue}-text`,
......
......@@ -36,7 +36,7 @@ describe('CreateMergeRequestDropdown', () => {
});
describe('getRef', () => {
it('escapes branch names correctly', done => {
it('escapes branch names correctly', (done) => {
const endpoint = `${dropdown.refsPath}contains%23hash`;
jest.spyOn(axios, 'get');
axiosMock.onGet(endpoint).replyOnce({});
......
......@@ -11,7 +11,7 @@ describe('custom metrics form fields component', () => {
let component;
let mockAxios;
const getNamedInput = name => component.element.querySelector(`input[name="${name}"]`);
const getNamedInput = (name) => component.element.querySelector(`input[name="${name}"]`);
const validateQueryPath = `${TEST_HOST}/mock/path`;
const validQueryResponse = { data: { success: true, query: { valid: true, error: '' } } };
const csrfToken = 'mockToken';
......@@ -50,7 +50,7 @@ describe('custom metrics form fields component', () => {
mockAxios.restore();
});
it('checks form validity', done => {
it('checks form validity', (done) => {
mountComponent({
metricPersisted: true,
...makeFormData({
......@@ -157,7 +157,7 @@ describe('custom metrics form fields component', () => {
{
requestValidation: jest.fn().mockImplementation(
() =>
new Promise(resolve =>
new Promise((resolve) =>
setTimeout(() => {
resolve(validQueryResponse);
}, 4000),
......@@ -171,7 +171,7 @@ describe('custom metrics form fields component', () => {
jest.clearAllTimers();
});
it('expect queryValidateInFlight is in flight', done => {
it('expect queryValidateInFlight is in flight', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -191,7 +191,7 @@ describe('custom metrics form fields component', () => {
});
});
it('expect loading message to display', done => {
it('expect loading message to display', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -202,7 +202,7 @@ describe('custom metrics form fields component', () => {
});
});
it('expect loading message to disappear', done => {
it('expect loading message to disappear', (done) => {
const queryInput = component.find(`input[name="${queryInputName}"]`);
queryInput.setValue('query');
queryInput.trigger('input');
......@@ -239,7 +239,7 @@ describe('custom metrics form fields component', () => {
);
});
it('sets queryIsValid to false', done => {
it('sets queryIsValid to false', (done) => {
component.vm.$nextTick(() => {
expect(component.vm.queryValidateInFlight).toBe(false);
expect(component.vm.queryIsValid).toBe(false);
......@@ -247,7 +247,7 @@ describe('custom metrics form fields component', () => {
});
});
it('shows invalid query message', done => {
it('shows invalid query message', (done) => {
component.vm.$nextTick(() => {
expect(component.text()).toContain(errorMessage);
done();
......@@ -267,7 +267,7 @@ describe('custom metrics form fields component', () => {
);
});
it('sets queryIsValid to true when query is valid', done => {
it('sets queryIsValid to true when query is valid', (done) => {
component.vm.$nextTick(() => {
expect(component.vm.queryIsValid).toBe(true);
done();
......
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