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:
Diffstat (limited to 'spec/frontend/ide/stores/modules/editor/actions_spec.js')
-rw-r--r--spec/frontend/ide/stores/modules/editor/actions_spec.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/frontend/ide/stores/modules/editor/actions_spec.js b/spec/frontend/ide/stores/modules/editor/actions_spec.js
new file mode 100644
index 00000000000..6a420ac32de
--- /dev/null
+++ b/spec/frontend/ide/stores/modules/editor/actions_spec.js
@@ -0,0 +1,36 @@
+import testAction from 'helpers/vuex_action_helper';
+import * as types from '~/ide/stores/modules/editor/mutation_types';
+import * as actions from '~/ide/stores/modules/editor/actions';
+import { createTriggerRenamePayload } from '../../../helpers';
+
+describe('~/ide/stores/modules/editor/actions', () => {
+ describe('updateFileEditor', () => {
+ it('commits with payload', () => {
+ const payload = {};
+
+ testAction(actions.updateFileEditor, payload, {}, [
+ { type: types.UPDATE_FILE_EDITOR, payload },
+ ]);
+ });
+ });
+
+ describe('removeFileEditor', () => {
+ it('commits with payload', () => {
+ const payload = 'path/to/file.txt';
+
+ testAction(actions.removeFileEditor, payload, {}, [
+ { type: types.REMOVE_FILE_EDITOR, payload },
+ ]);
+ });
+ });
+
+ describe('renameFileEditor', () => {
+ it('commits with payload', () => {
+ const payload = createTriggerRenamePayload('test', 'test123');
+
+ testAction(actions.renameFileEditor, payload, {}, [
+ { type: types.RENAME_FILE_EDITOR, payload },
+ ]);
+ });
+ });
+});