summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Florian <mflorian@gitlab.com>2019-06-25 11:14:34 +0800
committerMark Florian <mflorian@gitlab.com>2019-06-25 11:20:10 +0800
commit105373a2f933a1007d87d037aefdc4f892f1e673 (patch)
tree2776b8e644cb05c09851be5ad8eb48e60bec3f81
parente4e88057fe1c0ba90c8a7516b3e65cc7015bf7ad (diff)
downloadgitlab-ce-63225-move-vuex-action-helper-to-jest.tar.gz
Rewrite spec descriptions for better consistency63225-move-vuex-action-helper-to-jest
-rw-r--r--spec/frontend/helpers/vuex_action_helper_spec.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/frontend/helpers/vuex_action_helper_spec.js b/spec/frontend/helpers/vuex_action_helper_spec.js
index 86175d5f91a..61d05762a04 100644
--- a/spec/frontend/helpers/vuex_action_helper_spec.js
+++ b/spec/frontend/helpers/vuex_action_helper_spec.js
@@ -30,7 +30,7 @@ describe('VueX test helper (testAction)', () => {
global.expect = originalExpect;
});
- it('should properly pass on state and payload', () => {
+ it('properly passes state and payload to action', () => {
const exampleState = { FOO: 12, BAR: 3 };
const examplePayload = { BAZ: 73, BIZ: 55 };
@@ -44,8 +44,8 @@ describe('VueX test helper (testAction)', () => {
testAction(action, examplePayload, exampleState);
});
- describe('should work with synchronous actions', () => {
- it('committing mutation', () => {
+ describe('given a sync action', () => {
+ it('mocks committing mutations', () => {
const action = ({ commit }) => {
commit('MUTATION');
};
@@ -55,7 +55,7 @@ describe('VueX test helper (testAction)', () => {
testAction(action, null, {}, assertion.mutations, assertion.actions, noop);
});
- it('dispatching action', () => {
+ it('mocks dispatching actions', () => {
const action = ({ dispatch }) => {
dispatch('ACTION');
};
@@ -65,13 +65,13 @@ describe('VueX test helper (testAction)', () => {
testAction(action, null, {}, assertion.mutations, assertion.actions, noop);
});
- it('work with done callback once finished', done => {
+ it('works with done callback once finished', done => {
assertion = { mutations: [], actions: [] };
testAction(noop, null, {}, assertion.mutations, assertion.actions, done);
});
- it('provide promise interface', done => {
+ it('returns a promise', done => {
assertion = { mutations: [], actions: [] };
testAction(noop, null, {}, assertion.mutations, assertion.actions)
@@ -80,7 +80,7 @@ describe('VueX test helper (testAction)', () => {
});
});
- describe('should work with promise based actions (fetch action)', () => {
+ describe('given an async action (returning a promise)', () => {
let lastError;
const data = { FOO: 'BAR' };
@@ -104,7 +104,7 @@ describe('VueX test helper (testAction)', () => {
lastError = null;
});
- it('work with done callback once finished', done => {
+ it('works with done callback once finished', done => {
mock.onGet(TEST_HOST).replyOnce(200, 42);
assertion = { mutations: [{ type: 'SUCCESS' }], actions: [{ type: 'ACTION' }] };
@@ -112,7 +112,7 @@ describe('VueX test helper (testAction)', () => {
testAction(asyncAction, null, {}, assertion.mutations, assertion.actions, done);
});
- it('return original data of successful promise while checking actions/mutations', done => {
+ it('returns original data of successful promise while checking actions/mutations', done => {
mock.onGet(TEST_HOST).replyOnce(200, 42);
assertion = { mutations: [{ type: 'SUCCESS' }], actions: [{ type: 'ACTION' }] };
@@ -125,7 +125,7 @@ describe('VueX test helper (testAction)', () => {
.catch(done.fail);
});
- it('return original error of rejected promise while checking actions/mutations', done => {
+ it('returns original error of rejected promise while checking actions/mutations', done => {
mock.onGet(TEST_HOST).replyOnce(500, '');
assertion = { mutations: [{ type: 'ERROR' }], actions: [{ type: 'ACTION' }] };
@@ -139,7 +139,7 @@ describe('VueX test helper (testAction)', () => {
});
});
- it('should work with async actions not returning promises', done => {
+ it('works with async actions not returning promises', done => {
const data = { FOO: 'BAR' };
const asyncAction = ({ commit, dispatch }) => {