summaryrefslogtreecommitdiff
path: root/spec/javascripts/ide/helpers.js
blob: 5c7e2db0e968b2f5cc73d3043c380b1b0bf842c2 (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
import { decorateData } from '~/ide/stores/utils';
import state from '~/ide/stores/state';
import commitState from '~/ide/stores/modules/commit/state';
import pipelinesState from '~/ide/stores/modules/pipelines/state';

export const resetStore = store => {
  const newState = {
    ...state(),
    commit: commitState(),
    pipelines: pipelinesState(),
  };
  store.replaceState(newState);
};

export const file = (name = 'name', id = name, type = '') =>
  decorateData({
    id,
    type,
    icon: 'icon',
    url: 'url',
    name,
    path: name,
    lastCommit: {},
  });