summaryrefslogtreecommitdiff
path: root/spec/frontend/ide/stores/modules/terminal/actions/setup_spec.js
blob: a823c05c459f63ba81dc91d1a373f5fb8af4120e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import testAction from 'helpers/vuex_action_helper';
import * as actions from '~/ide/stores/modules/terminal/actions/setup';
import * as mutationTypes from '~/ide/stores/modules/terminal/mutation_types';

describe('IDE store terminal setup actions', () => {
  describe('init', () => {
    it('dispatches checks', () => {
      return testAction(
        actions.init,
        null,
        {},
        [],
        [{ type: 'fetchConfigCheck' }, { type: 'fetchRunnersCheck' }],
      );
    });
  });

  describe('hideSplash', () => {
    it('commits HIDE_SPLASH', () => {
      return testAction(actions.hideSplash, null, {}, [{ type: mutationTypes.HIDE_SPLASH }], []);
    });
  });

  describe('setPaths', () => {
    it('commits SET_PATHS', () => {
      const paths = {
        foo: 'bar',
        lorem: 'ipsum',
      };

      return testAction(
        actions.setPaths,
        paths,
        {},
        [{ type: mutationTypes.SET_PATHS, payload: paths }],
        [],
      );
    });
  });
});