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