summaryrefslogtreecommitdiff
path: root/spec/frontend/jobs/store/actions_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/jobs/store/actions_spec.js')
-rw-r--r--spec/frontend/jobs/store/actions_spec.js56
1 files changed, 28 insertions, 28 deletions
diff --git a/spec/frontend/jobs/store/actions_spec.js b/spec/frontend/jobs/store/actions_spec.js
index 91bd5521f70..2d757ce76bf 100644
--- a/spec/frontend/jobs/store/actions_spec.js
+++ b/spec/frontend/jobs/store/actions_spec.js
@@ -1,6 +1,6 @@
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
-import { TEST_HOST } from '../../helpers/test_constants';
+import { TEST_HOST } from 'helpers/test_constants';
import axios from '~/lib/utils/axios_utils';
import {
setJobEndpoint,
@@ -39,7 +39,7 @@ describe('Job State actions', () => {
});
describe('setJobEndpoint', () => {
- it('should commit SET_JOB_ENDPOINT mutation', done => {
+ it('should commit SET_JOB_ENDPOINT mutation', (done) => {
testAction(
setJobEndpoint,
'job/872324.json',
@@ -52,7 +52,7 @@ describe('Job State actions', () => {
});
describe('setTraceOptions', () => {
- it('should commit SET_TRACE_OPTIONS mutation', done => {
+ it('should commit SET_TRACE_OPTIONS mutation', (done) => {
testAction(
setTraceOptions,
{ pagePath: 'job/872324/trace.json' },
@@ -65,26 +65,26 @@ describe('Job State actions', () => {
});
describe('hideSidebar', () => {
- it('should commit HIDE_SIDEBAR mutation', done => {
+ it('should commit HIDE_SIDEBAR mutation', (done) => {
testAction(hideSidebar, null, mockedState, [{ type: types.HIDE_SIDEBAR }], [], done);
});
});
describe('showSidebar', () => {
- it('should commit HIDE_SIDEBAR mutation', done => {
+ it('should commit HIDE_SIDEBAR mutation', (done) => {
testAction(showSidebar, null, mockedState, [{ type: types.SHOW_SIDEBAR }], [], done);
});
});
describe('toggleSidebar', () => {
describe('when isSidebarOpen is true', () => {
- it('should dispatch hideSidebar', done => {
+ it('should dispatch hideSidebar', (done) => {
testAction(toggleSidebar, null, mockedState, [], [{ type: 'hideSidebar' }], done);
});
});
describe('when isSidebarOpen is false', () => {
- it('should dispatch showSidebar', done => {
+ it('should dispatch showSidebar', (done) => {
mockedState.isSidebarOpen = false;
testAction(toggleSidebar, null, mockedState, [], [{ type: 'showSidebar' }], done);
@@ -93,7 +93,7 @@ describe('Job State actions', () => {
});
describe('requestJob', () => {
- it('should commit REQUEST_JOB mutation', done => {
+ it('should commit REQUEST_JOB mutation', (done) => {
testAction(requestJob, null, mockedState, [{ type: types.REQUEST_JOB }], [], done);
});
});
@@ -113,7 +113,7 @@ describe('Job State actions', () => {
});
describe('success', () => {
- it('dispatches requestJob and receiveJobSuccess ', done => {
+ it('dispatches requestJob and receiveJobSuccess ', (done) => {
mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 121212, name: 'karma' });
testAction(
@@ -140,7 +140,7 @@ describe('Job State actions', () => {
mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500);
});
- it('dispatches requestJob and receiveJobError ', done => {
+ it('dispatches requestJob and receiveJobError ', (done) => {
testAction(
fetchJob,
null,
@@ -161,7 +161,7 @@ describe('Job State actions', () => {
});
describe('receiveJobSuccess', () => {
- it('should commit RECEIVE_JOB_SUCCESS mutation', done => {
+ it('should commit RECEIVE_JOB_SUCCESS mutation', (done) => {
testAction(
receiveJobSuccess,
{ id: 121232132 },
@@ -174,25 +174,25 @@ describe('Job State actions', () => {
});
describe('receiveJobError', () => {
- it('should commit RECEIVE_JOB_ERROR mutation', done => {
+ it('should commit RECEIVE_JOB_ERROR mutation', (done) => {
testAction(receiveJobError, null, mockedState, [{ type: types.RECEIVE_JOB_ERROR }], [], done);
});
});
describe('scrollTop', () => {
- it('should dispatch toggleScrollButtons action', done => {
+ it('should dispatch toggleScrollButtons action', (done) => {
testAction(scrollTop, null, mockedState, [], [{ type: 'toggleScrollButtons' }], done);
});
});
describe('scrollBottom', () => {
- it('should dispatch toggleScrollButtons action', done => {
+ it('should dispatch toggleScrollButtons action', (done) => {
testAction(scrollBottom, null, mockedState, [], [{ type: 'toggleScrollButtons' }], done);
});
});
describe('requestTrace', () => {
- it('should commit REQUEST_TRACE mutation', done => {
+ it('should commit REQUEST_TRACE mutation', (done) => {
testAction(requestTrace, null, mockedState, [{ type: types.REQUEST_TRACE }], [], done);
});
});
@@ -212,7 +212,7 @@ describe('Job State actions', () => {
});
describe('success', () => {
- it('dispatches requestTrace, receiveTraceSuccess and stopPollingTrace when job is complete', done => {
+ it('dispatches requestTrace, receiveTraceSuccess and stopPollingTrace when job is complete', (done) => {
mock.onGet(`${TEST_HOST}/endpoint/trace.json`).replyOnce(200, {
html: 'I, [2018-08-17T22:57:45.707325 #1841] INFO -- :',
complete: true,
@@ -255,7 +255,7 @@ describe('Job State actions', () => {
mock.onGet(`${TEST_HOST}/endpoint/trace.json`).replyOnce(200, tracePayload);
});
- it('dispatches startPollingTrace', done => {
+ it('dispatches startPollingTrace', (done) => {
testAction(
fetchTrace,
null,
@@ -270,7 +270,7 @@ describe('Job State actions', () => {
);
});
- it('does not dispatch startPollingTrace when timeout is non-empty', done => {
+ it('does not dispatch startPollingTrace when timeout is non-empty', (done) => {
mockedState.traceTimeout = 1;
testAction(
@@ -293,7 +293,7 @@ describe('Job State actions', () => {
mock.onGet(`${TEST_HOST}/endpoint/trace.json`).reply(500);
});
- it('dispatches requestTrace and receiveTraceError ', done => {
+ it('dispatches requestTrace and receiveTraceError ', (done) => {
testAction(
fetchTrace,
null,
@@ -358,7 +358,7 @@ describe('Job State actions', () => {
window.clearTimeout = origTimeout;
});
- it('should commit STOP_POLLING_TRACE mutation ', done => {
+ it('should commit STOP_POLLING_TRACE mutation ', (done) => {
const traceTimeout = 7;
testAction(
@@ -377,7 +377,7 @@ describe('Job State actions', () => {
});
describe('receiveTraceSuccess', () => {
- it('should commit RECEIVE_TRACE_SUCCESS mutation ', done => {
+ it('should commit RECEIVE_TRACE_SUCCESS mutation ', (done) => {
testAction(
receiveTraceSuccess,
'hello world',
@@ -390,13 +390,13 @@ describe('Job State actions', () => {
});
describe('receiveTraceError', () => {
- it('should commit stop polling trace', done => {
+ it('should commit stop polling trace', (done) => {
testAction(receiveTraceError, null, mockedState, [], [{ type: 'stopPollingTrace' }], done);
});
});
describe('toggleCollapsibleLine', () => {
- it('should commit TOGGLE_COLLAPSIBLE_LINE mutation ', done => {
+ it('should commit TOGGLE_COLLAPSIBLE_LINE mutation ', (done) => {
testAction(
toggleCollapsibleLine,
{ isClosed: true },
@@ -409,7 +409,7 @@ describe('Job State actions', () => {
});
describe('requestJobsForStage', () => {
- it('should commit REQUEST_JOBS_FOR_STAGE mutation ', done => {
+ it('should commit REQUEST_JOBS_FOR_STAGE mutation ', (done) => {
testAction(
requestJobsForStage,
{ name: 'deploy' },
@@ -433,7 +433,7 @@ describe('Job State actions', () => {
});
describe('success', () => {
- it('dispatches requestJobsForStage and receiveJobsForStageSuccess ', done => {
+ it('dispatches requestJobsForStage and receiveJobsForStageSuccess ', (done) => {
mock
.onGet(`${TEST_HOST}/jobs.json`)
.replyOnce(200, { latest_statuses: [{ id: 121212, name: 'build' }], retried: [] });
@@ -463,7 +463,7 @@ describe('Job State actions', () => {
mock.onGet(`${TEST_HOST}/jobs.json`).reply(500);
});
- it('dispatches requestJobsForStage and receiveJobsForStageError', done => {
+ it('dispatches requestJobsForStage and receiveJobsForStageError', (done) => {
testAction(
fetchJobsForStage,
{ dropdown_path: `${TEST_HOST}/jobs.json` },
@@ -485,7 +485,7 @@ describe('Job State actions', () => {
});
describe('receiveJobsForStageSuccess', () => {
- it('should commit RECEIVE_JOBS_FOR_STAGE_SUCCESS mutation ', done => {
+ it('should commit RECEIVE_JOBS_FOR_STAGE_SUCCESS mutation ', (done) => {
testAction(
receiveJobsForStageSuccess,
[{ id: 121212, name: 'karma' }],
@@ -498,7 +498,7 @@ describe('Job State actions', () => {
});
describe('receiveJobsForStageError', () => {
- it('should commit RECEIVE_JOBS_FOR_STAGE_ERROR mutation ', done => {
+ it('should commit RECEIVE_JOBS_FOR_STAGE_ERROR mutation ', (done) => {
testAction(
receiveJobsForStageError,
null,