Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-03-29 17:16:19 +0300
committerPhil Hughes <me@iamphill.com>2018-03-29 17:16:19 +0300
commitd6dd2f5f70685e35cf6d0f2738059fe44e1054a3 (patch)
tree7b97644cd014975681d75b8c683f52e7b27293dc /spec/javascripts/ide/stores/actions/file_spec.js
parentaaa7dbb4b6cd1ac7a9a5d4eddcd3ecb23ef870ac (diff)
updated tests to use testAction helper
Diffstat (limited to 'spec/javascripts/ide/stores/actions/file_spec.js')
-rw-r--r--spec/javascripts/ide/stores/actions/file_spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/javascripts/ide/stores/actions/file_spec.js b/spec/javascripts/ide/stores/actions/file_spec.js
index 5b7c8365641..5de09f1faae 100644
--- a/spec/javascripts/ide/stores/actions/file_spec.js
+++ b/spec/javascripts/ide/stores/actions/file_spec.js
@@ -1,9 +1,12 @@
import Vue from 'vue';
import store from '~/ide/stores';
+import * as actions from '~/ide/stores/actions/file';
+import * as types from '~/ide/stores/mutation_types';
import service from '~/ide/services';
import router from '~/ide/ide_router';
import eventHub from '~/ide/eventhub';
import { file, resetStore } from '../../helpers';
+import testAction from '../../../helpers/vuex_action_helper';
describe('Multi-file store file actions', () => {
beforeEach(() => {
@@ -418,4 +421,28 @@ describe('Multi-file store file actions', () => {
.catch(done.fail);
});
});
+
+ describe('stageChange', () => {
+ it('calls STAGE_CHANGE with file path', done => {
+ testAction(
+ actions.stageChange,
+ 'path',
+ null,
+ [{ type: types.STAGE_CHANGE, payload: 'path' }],
+ done,
+ );
+ });
+ });
+
+ describe('unstageChange', () => {
+ it('calls UNSTAGE_CHANGE with file path', done => {
+ testAction(
+ actions.unstageChange,
+ 'path',
+ null,
+ [{ type: types.UNSTAGE_CHANGE, payload: 'path' }],
+ done,
+ );
+ });
+ });
});