Commit c35cc92c authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 33 files - 61 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 280a79c0
......@@ -1887,41 +1887,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.js
spec/frontend/helpers/wait_using_real_timer.js
## angry-bhabha
spec/frontend/ide/stores/modules/branches/actions_spec.js
spec/frontend/ide/stores/modules/branches/mutations_spec.js
spec/frontend/ide/stores/modules/clientside/actions_spec.js
spec/frontend/ide/stores/modules/commit/actions_spec.js
spec/frontend/ide/stores/modules/commit/getters_spec.js
spec/frontend/ide/stores/modules/file_templates/actions_spec.js
spec/frontend/ide/stores/modules/merge_requests/actions_spec.js
spec/frontend/ide/stores/modules/pane/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
spec/frontend/ide/stores/modules/terminal/actions/checks_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_controls_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_status_spec.js
spec/frontend/ide/stores/modules/terminal_sync/actions_spec.js
spec/frontend/ide/stores/mutations/file_spec.js
spec/frontend/ide/sync_router_and_store_spec.js
spec/frontend/ide/utils_spec.js
spec/frontend/image_diff/init_discussion_tab_spec.js
spec/frontend/image_diff/replaced_image_diff_spec.js
spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
spec/frontend/import_entities/import_projects/store/actions_spec.js
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
spec/frontend/integrations/edit/components/trigger_fields_spec.js
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
spec/frontend/issuable_show/components/issuable_body_spec.js
spec/frontend/issuable_show/components/issuable_edit_form_spec.js
spec/frontend/issuable_show/components/issuable_header_spec.js
spec/frontend/issuable_show/components/issuable_show_root_spec.js
## practical-murdock
spec/frontend/issuable_spec.js
spec/frontend/issue_show/components/app_spec.js
......
......@@ -42,7 +42,7 @@ describe('IDE branches actions', () => {
});
describe('requestBranches', () => {
it('should commit request', done => {
it('should commit request', (done) => {
testAction(
requestBranches,
null,
......@@ -55,7 +55,7 @@ describe('IDE branches actions', () => {
});
describe('receiveBranchesError', () => {
it('should commit error', done => {
it('should commit error', (done) => {
testAction(
receiveBranchesError,
{ search: TEST_SEARCH },
......@@ -78,7 +78,7 @@ describe('IDE branches actions', () => {
});
describe('receiveBranchesSuccess', () => {
it('should commit received data', done => {
it('should commit received data', (done) => {
testAction(
receiveBranchesSuccess,
branches,
......@@ -110,7 +110,7 @@ describe('IDE branches actions', () => {
});
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchBranches,
{ search: TEST_SEARCH },
......@@ -131,7 +131,7 @@ describe('IDE branches actions', () => {
mock.onGet(/\/api\/v4\/projects\/\d+\/repository\/branches(.*)$/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchBranches,
{ search: TEST_SEARCH },
......@@ -148,7 +148,7 @@ describe('IDE branches actions', () => {
});
describe('resetBranches', () => {
it('commits reset', done => {
it('commits reset', (done) => {
testAction(
resetBranches,
null,
......
......@@ -28,7 +28,7 @@ describe('IDE branches mutations', () => {
describe('RECEIVE_BRANCHES_SUCCESS', () => {
it('sets branches', () => {
const expectedBranches = branches.map(branch => ({
const expectedBranches = branches.map((branch) => ({
name: branch.name,
committedDate: branch.commit.committed_date,
}));
......
......@@ -25,7 +25,7 @@ describe('IDE store module clientside actions', () => {
});
describe('pingUsage', () => {
it('posts to usage endpoint', done => {
it('posts to usage endpoint', (done) => {
const usageSpy = jest.fn(() => [200]);
mock.onPost(TEST_USAGE_URL).reply(() => usageSpy());
......
......@@ -41,7 +41,7 @@ describe('IDE commit module actions', () => {
});
describe('updateCommitMessage', () => {
it('updates store with new commit message', done => {
it('updates store with new commit message', (done) => {
store
.dispatch('commit/updateCommitMessage', 'testing')
.then(() => {
......@@ -53,7 +53,7 @@ describe('IDE commit module actions', () => {
});
describe('discardDraft', () => {
it('resets commit message to blank', done => {
it('resets commit message to blank', (done) => {
store.state.commit.commitMessage = 'testing';
store
......@@ -67,7 +67,7 @@ describe('IDE commit module actions', () => {
});
describe('updateCommitAction', () => {
it('updates store with new commit action', done => {
it('updates store with new commit action', (done) => {
store
.dispatch('commit/updateCommitAction', '1')
.then(() => {
......@@ -123,7 +123,7 @@ describe('IDE commit module actions', () => {
});
});
it('updates commit message with short_id', done => {
it('updates commit message with short_id', (done) => {
store
.dispatch('commit/setLastCommitMessage', { short_id: '123' })
.then(() => {
......@@ -135,7 +135,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('updates commit message with stats', done => {
it('updates commit message with stats', (done) => {
store
.dispatch('commit/setLastCommitMessage', {
short_id: '123',
......@@ -200,12 +200,12 @@ describe('IDE commit module actions', () => {
});
store.state.openFiles = store.state.stagedFiles;
store.state.stagedFiles.forEach(stagedFile => {
store.state.stagedFiles.forEach((stagedFile) => {
store.state.entries[stagedFile.path] = stagedFile;
});
});
it('updates stores working reference', done => {
it('updates stores working reference', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -218,14 +218,14 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('resets all files changed status', done => {
it('resets all files changed status', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
branch,
})
.then(() => {
store.state.openFiles.forEach(entry => {
store.state.openFiles.forEach((entry) => {
expect(entry.changed).toBeFalsy();
});
})
......@@ -233,7 +233,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sets files commit data', done => {
it('sets files commit data', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -246,7 +246,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('updates raw content for changed file', done => {
it('updates raw content for changed file', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -259,7 +259,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('emits changed event for file', done => {
it('emits changed event for file', (done) => {
store
.dispatch('commit/updateFilesAfterCommit', {
data,
......@@ -319,7 +319,7 @@ describe('IDE commit module actions', () => {
store.state.commit.commitAction = '2';
store.state.commit.commitMessage = 'testing 123';
store.state.openFiles.forEach(localF => {
store.state.openFiles.forEach((localF) => {
store.state.entries[localF.path] = localF;
});
});
......@@ -345,7 +345,7 @@ describe('IDE commit module actions', () => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
});
it('calls service', done => {
it('calls service', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -370,7 +370,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sends lastCommit ID when not creating new branch', done => {
it('sends lastCommit ID when not creating new branch', (done) => {
store.state.commit.commitAction = '1';
store
......@@ -397,7 +397,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('sets last Commit Msg', done => {
it('sets last Commit Msg', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -410,7 +410,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('adds commit data to files', done => {
it('adds commit data to files', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -423,7 +423,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('resets stores commit actions', done => {
it('resets stores commit actions', (done) => {
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
store
......@@ -435,7 +435,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('removes all staged files', done => {
it('removes all staged files', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -446,7 +446,7 @@ describe('IDE commit module actions', () => {
});
describe('merge request', () => {
it('redirects to new merge request page', done => {
it('redirects to new merge request page', (done) => {
jest.spyOn(eventHub, '$on').mockImplementation();
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
......@@ -464,7 +464,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('does not redirect to new merge request page when shouldCreateMR is not checked', done => {
it('does not redirect to new merge request page when shouldCreateMR is not checked', (done) => {
jest.spyOn(eventHub, '$on').mockImplementation();
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
......@@ -510,7 +510,7 @@ describe('IDE commit module actions', () => {
});
});
it('shows failed message', done => {
it('shows failed message', (done) => {
store
.dispatch('commit/commitChanges')
.then(() => {
......@@ -556,7 +556,7 @@ describe('IDE commit module actions', () => {
},
};
it('commits TOGGLE_EMPTY_STATE mutation on empty repo', done => {
it('commits TOGGLE_EMPTY_STATE mutation on empty repo', (done) => {
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
jest.spyOn(store, 'commit');
......@@ -573,7 +573,7 @@ describe('IDE commit module actions', () => {
.catch(done.fail);
});
it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', done => {
it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', (done) => {
COMMIT_RESPONSE.parent_ids.push('1234');
jest.spyOn(service, 'commit').mockResolvedValue({ data: COMMIT_RESPONSE });
jest.spyOn(store, 'commit');
......@@ -594,7 +594,7 @@ describe('IDE commit module actions', () => {
});
describe('toggleShouldCreateMR', () => {
it('commits both toggle and interacting with MR checkbox actions', done => {
it('commits both toggle and interacting with MR checkbox actions', (done) => {
testAction(
actions.toggleShouldCreateMR,
{},
......
......@@ -103,7 +103,7 @@ describe('IDE commit module getters', () => {
expect(getters.preBuiltCommitMessage(state, null, rootState)).toBe('test commit message');
});
['changedFiles', 'stagedFiles'].forEach(key => {
['changedFiles', 'stagedFiles'].forEach((key) => {
it('returns commitMessage with updated file', () => {
rootState[key].push({
path: 'test-file',
......
......@@ -20,7 +20,7 @@ describe('IDE file templates actions', () => {
});
describe('requestTemplateTypes', () => {
it('commits REQUEST_TEMPLATE_TYPES', done => {
it('commits REQUEST_TEMPLATE_TYPES', (done) => {
testAction(
actions.requestTemplateTypes,
null,
......@@ -33,7 +33,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateTypesError', () => {
it('commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage', done => {
it('commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage', (done) => {
testAction(
actions.receiveTemplateTypesError,
null,
......@@ -55,7 +55,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateTypesSuccess', () => {
it('commits RECEIVE_TEMPLATE_TYPES_SUCCESS', done => {
it('commits RECEIVE_TEMPLATE_TYPES_SUCCESS', (done) => {
testAction(
actions.receiveTemplateTypesSuccess,
'test',
......@@ -81,7 +81,7 @@ describe('IDE file templates actions', () => {
});
});
it('rejects if selectedTemplateType is empty', done => {
it('rejects if selectedTemplateType is empty', (done) => {
const dispatch = jest.fn().mockName('dispatch');
actions
......@@ -94,7 +94,7 @@ describe('IDE file templates actions', () => {
});
});
it('dispatches actions', done => {
it('dispatches actions', (done) => {
state.selectedTemplateType = { key: 'licenses' };
testAction(
......@@ -121,7 +121,7 @@ describe('IDE file templates actions', () => {
mock.onGet(/api\/(.*)\/templates\/licenses/).replyOnce(500);
});
it('dispatches actions', done => {
it('dispatches actions', (done) => {
state.selectedTemplateType = { key: 'licenses' };
testAction(
......@@ -184,7 +184,7 @@ describe('IDE file templates actions', () => {
});
describe('receiveTemplateError', () => {
it('dispatches setErrorMessage', done => {
it('dispatches setErrorMessage', (done) => {
testAction(
actions.receiveTemplateError,
'test',
......@@ -217,7 +217,7 @@ describe('IDE file templates actions', () => {
.replyOnce(200, { content: 'testing content' });
});
it('dispatches setFileTemplate if template already has content', done => {
it('dispatches setFileTemplate if template already has content', (done) => {
const template = { content: 'already has content' };
testAction(
......@@ -230,7 +230,7 @@ describe('IDE file templates actions', () => {
);
});
it('dispatches success', done => {
it('dispatches success', (done) => {
const template = { key: 'mit' };
state.selectedTemplateType = { key: 'licenses' };
......@@ -245,7 +245,7 @@ describe('IDE file templates actions', () => {
);
});
it('dispatches success and uses name key for API call', done => {
it('dispatches success and uses name key for API call', (done) => {
const template = { name: 'testing' };
state.selectedTemplateType = { key: 'licenses' };
......@@ -266,7 +266,7 @@ describe('IDE file templates actions', () => {
mock.onGet(/api\/(.*)\/templates\/licenses\/mit/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
const template = { name: 'testing' };
state.selectedTemplateType = { key: 'licenses' };
......
......@@ -28,7 +28,7 @@ describe('IDE merge requests actions', () => {
});
describe('requestMergeRequests', () => {
it('should commit request', done => {
it('should commit request', (done) => {
testAction(
requestMergeRequests,
null,
......@@ -41,7 +41,7 @@ describe('IDE merge requests actions', () => {
});
describe('receiveMergeRequestsError', () => {
it('should commit error', done => {
it('should commit error', (done) => {
testAction(
receiveMergeRequestsError,
{ type: 'created', search: '' },
......@@ -64,7 +64,7 @@ describe('IDE merge requests actions', () => {
});
describe('receiveMergeRequestsSuccess', () => {
it('should commit received data', done => {
it('should commit received data', (done) => {
testAction(
receiveMergeRequestsSuccess,
mergeRequests,
......@@ -118,7 +118,7 @@ describe('IDE merge requests actions', () => {
});
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchMergeRequests,
{ type: 'created' },
......@@ -156,7 +156,7 @@ describe('IDE merge requests actions', () => {
);
});
it('dispatches success with received data', done => {
it('dispatches success with received data', (done) => {
testAction(
fetchMergeRequests,
{ type: null },
......@@ -177,7 +177,7 @@ describe('IDE merge requests actions', () => {
mock.onGet(/\/api\/v4\/merge_requests(.*)$/).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchMergeRequests,
{ type: 'created', search: '' },
......@@ -195,7 +195,7 @@ describe('IDE merge requests actions', () => {
});
describe('resetMergeRequests', () => {
it('commits reset', done => {
it('commits reset', (done) => {
testAction(
resetMergeRequests,
null,
......
......@@ -7,18 +7,18 @@ describe('IDE pane module actions', () => {
const TEST_VIEW_KEEP_ALIVE = { name: 'test-keep-alive', keepAlive: true };
describe('toggleOpen', () => {
it('dispatches open if closed', done => {
it('dispatches open if closed', (done) => {
testAction(actions.toggleOpen, TEST_VIEW, { isOpen: false }, [], [{ type: 'open' }], done);
});
it('dispatches close if opened', done => {
it('dispatches close if opened', (done) => {
testAction(actions.toggleOpen, TEST_VIEW, { isOpen: true }, [], [{ type: 'close' }], done);
});
});
describe('open', () => {
describe('with a view specified', () => {
it('commits SET_OPEN and SET_CURRENT_VIEW', done => {
it('commits SET_OPEN and SET_CURRENT_VIEW', (done) => {
testAction(
actions.open,
TEST_VIEW,
......@@ -32,7 +32,7 @@ describe('IDE pane module actions', () => {
);
});
it('commits KEEP_ALIVE_VIEW if keepAlive is true', done => {
it('commits KEEP_ALIVE_VIEW if keepAlive is true', (done) => {
testAction(
actions.open,
TEST_VIEW_KEEP_ALIVE,
......@@ -49,7 +49,7 @@ describe('IDE pane module actions', () => {
});
describe('without a view specified', () => {
it('commits SET_OPEN', done => {
it('commits SET_OPEN', (done) => {
testAction(
actions.open,
undefined,
......@@ -63,7 +63,7 @@ describe('IDE pane module actions', () => {
});
describe('close', () => {
it('commits SET_OPEN', done => {
it('commits SET_OPEN', (done) => {
testAction(actions.close, null, {}, [{ type: types.SET_OPEN, payload: false }], [], done);
});
});
......
......@@ -44,7 +44,7 @@ describe('IDE pipelines actions', () => {
});
describe('requestLatestPipeline', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(
requestLatestPipeline,
null,
......@@ -57,7 +57,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveLatestPipelineError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveLatestPipelineError,
{ status: 404 },
......@@ -68,7 +68,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches setErrorMessage is not 404', done => {
it('dispatches setErrorMessage is not 404', (done) => {
testAction(
receiveLatestPipelineError,
{ status: 500 },
......@@ -123,7 +123,7 @@ describe('IDE pipelines actions', () => {
.reply(200, { data: { foo: 'bar' } }, { 'poll-interval': '10000' });
});
it('dispatches request', done => {
it('dispatches request', (done) => {
jest.spyOn(axios, 'get');
jest.spyOn(Visibility, 'hidden').mockReturnValue(false);
......@@ -139,7 +139,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(1000);
new Promise(resolve => requestAnimationFrame(resolve))
new Promise((resolve) => requestAnimationFrame(resolve))
.then(() => {
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalledTimes(1);
......@@ -150,7 +150,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(10000);
})
.then(() => new Promise(resolve => requestAnimationFrame(resolve)))
.then(() => new Promise((resolve) => requestAnimationFrame(resolve)))
.then(() => {
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalledTimes(2);
......@@ -169,7 +169,7 @@ describe('IDE pipelines actions', () => {
mock.onGet('/abc/def/commit/abc123def456ghi789jkl/pipelines').reply(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
const dispatch = jest.fn().mockName('dispatch');
const rootGetters = {
lastCommit: { id: 'abc123def456ghi789jkl' },
......@@ -180,7 +180,7 @@ describe('IDE pipelines actions', () => {
jest.advanceTimersByTime(1500);
new Promise(resolve => requestAnimationFrame(resolve))
new Promise((resolve) => requestAnimationFrame(resolve))
.then(() => {
expect(dispatch).toHaveBeenCalledWith('receiveLatestPipelineError', expect.anything());
})
......@@ -191,13 +191,13 @@ describe('IDE pipelines actions', () => {
});
describe('requestJobs', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(requestJobs, 1, mockedState, [{ type: types.REQUEST_JOBS, payload: 1 }], [], done);
});
});
describe('receiveJobsError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveJobsError,
{ id: 1 },
......@@ -220,7 +220,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveJobsSuccess', () => {
it('commits data', done => {
it('commits data', (done) => {
testAction(
receiveJobsSuccess,
{ id: 1, data: jobs },
......@@ -240,7 +240,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(stage.dropdownPath).replyOnce(200, jobs);
});
it('dispatches request', done => {
it('dispatches request', (done) => {
testAction(
fetchJobs,
stage,
......@@ -260,7 +260,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(stage.dropdownPath).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchJobs,
stage,
......@@ -277,7 +277,7 @@ describe('IDE pipelines actions', () => {
});
describe('toggleStageCollapsed', () => {
it('commits collapse', done => {
it('commits collapse', (done) => {
testAction(
toggleStageCollapsed,
1,
......@@ -290,7 +290,7 @@ describe('IDE pipelines actions', () => {
});
describe('setDetailJob', () => {
it('commits job', done => {
it('commits job', (done) => {
testAction(
setDetailJob,
'job',
......@@ -301,7 +301,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches rightPane/open as pipeline when job is null', done => {
it('dispatches rightPane/open as pipeline when job is null', (done) => {
testAction(
setDetailJob,
null,
......@@ -312,7 +312,7 @@ describe('IDE pipelines actions', () => {
);
});
it('dispatches rightPane/open as job', done => {
it('dispatches rightPane/open as job', (done) => {
testAction(
setDetailJob,
'job',
......@@ -325,13 +325,13 @@ describe('IDE pipelines actions', () => {
});
describe('requestJobLogs', () => {
it('commits request', done => {
it('commits request', (done) => {
testAction(requestJobLogs, null, mockedState, [{ type: types.REQUEST_JOB_LOGS }], [], done);
});
});
describe('receiveJobLogsError', () => {
it('commits error', done => {
it('commits error', (done) => {
testAction(
receiveJobLogsError,
null,
......@@ -354,7 +354,7 @@ describe('IDE pipelines actions', () => {
});
describe('receiveJobLogsSuccess', () => {
it('commits data', done => {
it('commits data', (done) => {
testAction(
receiveJobLogsSuccess,
'data',
......@@ -377,7 +377,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(`${TEST_HOST}/project/builds/trace`).replyOnce(200, { html: 'html' });
});
it('dispatches request', done => {
it('dispatches request', (done) => {
testAction(
fetchJobLogs,
null,
......@@ -408,7 +408,7 @@ describe('IDE pipelines actions', () => {
mock.onGet(`${TEST_HOST}/project/builds/trace`).replyOnce(500);
});
it('dispatches error', done => {
it('dispatches error', (done) => {
testAction(
fetchJobLogs,
null,
......@@ -422,7 +422,7 @@ describe('IDE pipelines actions', () => {
});
describe('resetLatestPipeline', () => {
it('commits reset mutations', done => {
it('commits reset mutations', (done) => {
testAction(
resetLatestPipeline,
null,
......
......@@ -137,7 +137,7 @@ describe('IDE pipelines mutations', () => {
mutations[types.RECEIVE_JOBS_SUCCESS](mockedState, { id: mockedState.stages[0].id, data });
expect(mockedState.stages[0].jobs.length).toBe(jobs.length);
expect(mockedState.stages[0].jobs).toEqual(
jobs.map(job => ({
jobs.map((job) => ({
id: job.id,
name: job.name,
status: job.status,
......
......@@ -102,7 +102,7 @@ describe('IDE store terminal check actions', () => {
);
});
[httpStatus.FORBIDDEN, httpStatus.NOT_FOUND].forEach(status => {
[httpStatus.FORBIDDEN, httpStatus.NOT_FOUND].forEach((status) => {
it(`hides tab, when status is ${status}`, () => {
const payload = { response: { status } };
......
......@@ -281,7 +281,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[httpStatus.NOT_FOUND, httpStatus.UNPROCESSABLE_ENTITY].forEach(status => {
[httpStatus.NOT_FOUND, httpStatus.UNPROCESSABLE_ENTITY].forEach((status) => {
it(`dispatches request and startSession on ${status}`, () => {
mock
.onPost(state.session.retryPath, { branch: rootState.currentBranchId, format: 'json' })
......
......@@ -98,7 +98,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[STOPPING, STOPPED, 'unexpected'].forEach(status => {
[STOPPING, STOPPED, 'unexpected'].forEach((status) => {
it(`kills session if status is ${status}`, () => {
return testAction(
actions.receiveSessionStatusSuccess,
......
......@@ -22,7 +22,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe('upload', () => {
it('uploads to mirror and sets success', done => {
it('uploads to mirror and sets success', (done) => {
mirror.upload.mockReturnValue(Promise.resolve());
testAction(
......@@ -38,7 +38,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
);
});
it('sets error when failed', done => {
it('sets error when failed', (done) => {
const err = { message: 'it failed!' };
mirror.upload.mockReturnValue(Promise.reject(err));
......@@ -54,7 +54,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe('stop', () => {
it('disconnects from mirror', done => {
it('disconnects from mirror', (done) => {
testAction(actions.stop, null, rootState, [{ type: types.STOP }], [], () => {
expect(mirror.disconnect).toHaveBeenCalled();
done();
......@@ -83,7 +83,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
};
});
it('connects to mirror and sets success', done => {
it('connects to mirror and sets success', (done) => {
mirror.connect.mockReturnValue(Promise.resolve());
testAction(
......
......@@ -128,7 +128,7 @@ describe('IDE store file mutations', () => {
localState.changedFiles[0],
localState.openFiles[0],
localFile,
].forEach(f => {
].forEach((f) => {
expect(f).toEqual(
expect.objectContaining({
path,
......@@ -142,7 +142,7 @@ describe('IDE store file mutations', () => {
});
describe('SET_FILE_RAW_DATA', () => {
const callMutationForFile = f => {
const callMutationForFile = (f) => {
mutations.SET_FILE_RAW_DATA(localState, {
file: f,
raw: 'testing',
......
......@@ -17,7 +17,7 @@ describe('~/ide/sync_router_and_store', () => {
const getRouterCurrentPath = () => router.currentRoute.fullPath;
const getStoreCurrentPath = () => store.state.router.fullPath;
const updateRouter = async path => {
const updateRouter = async (path) => {
if (getRouterCurrentPath() === path) {
return;
}
......@@ -25,7 +25,7 @@ describe('~/ide/sync_router_and_store', () => {
router.push(path);
await waitForPromises();
};
const updateStore = path => {
const updateStore = (path) => {
store.dispatch('router/push', path);
return waitForPromises();
};
......
......@@ -263,7 +263,7 @@ describe('WebIDE utils', () => {
it('reads a file and returns its output as a data url', () => {
const file = new File(['foo'], 'foo.png', { type: 'image/png' });
return readFileAsDataURL(file).then(contents => {
return readFileAsDataURL(file).then((contents) => {
expect(contents).toBe('data:image/png;base64,Zm9v');
});
});
......
......@@ -11,7 +11,7 @@ describe('initDiscussionTab', () => {
`);
});
it('should pass canCreateNote as false to initImageDiff', done => {
it('should pass canCreateNote as false to initImageDiff', (done) => {
jest
.spyOn(initImageDiffHelper, 'initImageDiff')
.mockImplementation((diffFileEl, canCreateNote) => {
......@@ -22,7 +22,7 @@ describe('initDiscussionTab', () => {
initDiscussionTab();
});
it('should pass renderCommentBadge as true to initImageDiff', done => {
it('should pass renderCommentBadge as true to initImageDiff', (done) => {
jest
.spyOn(initImageDiffHelper, 'initImageDiff')
.mockImplementation((diffFileEl, canCreateNote, renderCommentBadge) => {
......
......@@ -176,8 +176,8 @@ describe('ReplacedImageDiff', () => {
expect(ImageDiff.prototype.bindEvents).toHaveBeenCalled();
});
it('should register click eventlistener to 2-up view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to 2-up view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.TWO_UP);
done();
});
......@@ -186,8 +186,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.viewModesEls[viewTypes.TWO_UP].click();
});
it('should register click eventlistener to swipe view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to swipe view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.SWIPE);
done();
});
......@@ -196,8 +196,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.viewModesEls[viewTypes.SWIPE].click();
});
it('should register click eventlistener to onion skin view mode', done => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation(viewMode => {
it('should register click eventlistener to onion skin view mode', (done) => {
jest.spyOn(ReplacedImageDiff.prototype, 'changeView').mockImplementation((viewMode) => {
expect(viewMode).toEqual(viewTypes.SWIPE);
done();
});
......@@ -325,7 +325,7 @@ describe('ReplacedImageDiff', () => {
setupImageFrameEls();
});
it('should pass showCommentIndicator normalized indicator values', done => {
it('should pass showCommentIndicator normalized indicator values', (done) => {
jest.spyOn(imageDiffHelper, 'showCommentIndicator').mockImplementation(() => {});
jest
.spyOn(imageDiffHelper, 'resizeCoordinatesToImageElement')
......@@ -339,7 +339,7 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff.renderNewView(indicator);
});
it('should call showCommentIndicator', done => {
it('should call showCommentIndicator', (done) => {
const normalized = {
normalized: true,
};
......
......@@ -5,7 +5,7 @@ import ImportTableRow from '~/import_entities/import_groups/components/import_ta
import { STATUSES } from '~/import_entities/constants';
import { availableNamespacesFixture } from '../graphql/fixtures';
const getFakeGroup = status => ({
const getFakeGroup = (status) => ({
web_url: 'https://fake.host/',
full_path: 'fake_group_1',
full_name: 'fake_name_1',
......@@ -22,13 +22,13 @@ describe('import table row', () => {
let group;
const findByText = (cmp, text) => {
return wrapper.findAll(cmp).wrappers.find(node => node.text().indexOf(text) === 0);
return wrapper.findAll(cmp).wrappers.find((node) => node.text().indexOf(text) === 0);
};
const findImportButton = () => findByText(GlButton, 'Import');
const findNameInput = () => wrapper.find(GlFormInput);
const findNamespaceDropdown = () => wrapper.find(Select2Select);
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(ImportTableRow, {
propsData: {
availableNamespaces: availableNamespacesFixture,
......
......@@ -63,7 +63,7 @@ describe('Bulk import resolvers', () => {
});
it('mirrors REST endpoint response fields', () => {
const extractRelevantFields = obj => ({ id: obj.id, full_path: obj.full_path });
const extractRelevantFields = (obj) => ({ id: obj.id, full_path: obj.full_path });
expect(results.map(extractRelevantFields)).toStrictEqual(
availableNamespacesFixture.map(extractRelevantFields),
......@@ -89,20 +89,20 @@ describe('Bulk import resolvers', () => {
expect(
results.every((r, idx) =>
MIRRORED_FIELDS.every(
field => r[field] === statusEndpointFixture.importable_data[idx][field],
(field) => r[field] === statusEndpointFixture.importable_data[idx][field],
),
),
).toBe(true);
});
it('populates each result instance with status field default to none', () => {
expect(results.every(r => r.status === STATUSES.NONE)).toBe(true);
expect(results.every((r) => r.status === STATUSES.NONE)).toBe(true);
});
it('populates each result instance with import_target defaulted to first available namespace', () => {
expect(
results.every(
r => r.import_target.target_namespace === availableNamespacesFixture[0].full_path,
(r) => r.import_target.target_namespace === availableNamespacesFixture[0].full_path,
),
).toBe(true);
});
......
......@@ -27,7 +27,7 @@ describe('ImportProjectsTable', () => {
const findImportAllButton = () =>
wrapper
.findAll(GlButton)
.filter(w => w.props().variant === 'success')
.filter((w) => w.props().variant === 'success')
.at(0);
const findImportAllModal = () => wrapper.find({ ref: 'importAllModal' });
......@@ -112,7 +112,7 @@ describe('ImportProjectsTable', () => {
expect(
wrapper
.findAll('th')
.filter(w => w.text() === `From ${providerTitle}`)
.filter((w) => w.text() === `From ${providerTitle}`)
.exists(),
).toBe(true);
......
......@@ -34,7 +34,7 @@ describe('ProviderRepoTableRow', () => {
}
const findImportButton = () => {
const buttons = wrapper.findAll('button').filter(node => node.text() === 'Import');
const buttons = wrapper.findAll('button').filter((node) => node.text() === 'Import');
return buttons.length ? buttons.at(0) : buttons;
};
......
......@@ -123,7 +123,7 @@ describe('import_projects store actions', () => {
it('includes page in url query params', async () => {
let requestedUrl;
mock.onGet().reply(config => {
mock.onGet().reply((config) => {
requestedUrl = config.url;
return [200, payload];
});
......
......@@ -39,7 +39,7 @@ describe('IncidentsSettingTabs', () => {
});
it('should render the tab for each active integration', () => {
const activeTabs = wrapper.vm.$options.tabs.filter(tab => tab.active);
const activeTabs = wrapper.vm.$options.tabs.filter((tab) => tab.active);
expect(findIntegrationTabs().length).toBe(activeTabs.length);
activeTabs.forEach((tab, index) => {
expect(findIntegrationTabs().at(index).attributes('title')).toBe(tab.title);
......
......@@ -12,7 +12,7 @@ describe('JiraIssuesFields', () => {
editProjectPath: '/edit',
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = mount(JiraIssuesFields, {
propsData: { ...defaultProps, ...props },
});
......
......@@ -104,11 +104,11 @@ describe('JiraTriggerFields', () => {
true,
);
wrapper.findAll('[type=checkbox]').wrappers.forEach(checkbox => {
wrapper.findAll('[type=checkbox]').wrappers.forEach((checkbox) => {
expect(checkbox.attributes('disabled')).toBe('disabled');
});
wrapper.findAll('[type=radio]').wrappers.forEach(radio => {
wrapper.findAll('[type=radio]').wrappers.forEach((radio) => {
expect(radio.attributes('disabled')).toBe('disabled');
});
});
......
......@@ -29,7 +29,7 @@ describe('TriggerFields', () => {
const findAllGlFormCheckboxes = () => wrapper.findAll(GlFormCheckbox);
const findAllGlFormInputs = () => wrapper.findAll(GlFormInput);
describe.each([true, false])('template, isInheriting = `%p`', isInheriting => {
describe.each([true, false])('template, isInheriting = `%p`', (isInheriting) => {
it('renders a label with text "Trigger"', () => {
createComponent();
......
......@@ -130,8 +130,8 @@ describe('RelatedIssuesBlock', () => {
describe('showCategorizedIssues prop', () => {
const issueList = () => wrapper.findAll('.js-related-issues-token-list-item');
const categorizedHeadings = () => wrapper.findAll('h4');
const headingTextAt = index => categorizedHeadings().at(index).text();
const mountComponent = showCategorizedIssues => {
const headingTextAt = (index) => categorizedHeadings().at(index).text();
const mountComponent = (showCategorizedIssues) => {
wrapper = mount(RelatedIssuesBlock, {
propsData: {
pathIdSeparator: PathIdSeparator.Issue,
......
......@@ -135,7 +135,7 @@ describe('IssuableBody', () => {
it.each(['keydown-title', 'keydown-description'])(
'component emits `%s` event with event object and issuableMeta params via issuable-edit-form',
async eventName => {
async (eventName) => {
const eventObj = {
preventDefault: jest.fn(),
stopPropagation: jest.fn(),
......
......@@ -28,7 +28,7 @@ const createComponent = ({ propsData = issuableEditFormProps } = {}) =>
describe('IssuableEditForm', () => {
let wrapper;
const assertEvent = eventSpy => {
const assertEvent = (eventSpy) => {
expect(eventSpy).toHaveBeenNthCalledWith(1, 'update.issuable', expect.any(Function));
expect(eventSpy).toHaveBeenNthCalledWith(2, 'close.form', expect.any(Function));
};
......
......@@ -24,7 +24,7 @@ const createComponent = (propsData = issuableHeaderProps) =>
describe('IssuableHeader', () => {
let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
beforeEach(() => {
wrapper = createComponent();
......
......@@ -121,7 +121,7 @@ describe('IssuableShowRoot', () => {
it.each(['keydown-title', 'keydown-description'])(
'component emits `%s` event with event object and issuableMeta params via issuable-body',
eventName => {
(eventName) => {
const eventObj = {
preventDefault: jest.fn(),
stopPropagation: jest.fn(),
......
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