summaryrefslogtreecommitdiff
path: root/spec/javascripts/commit/pipelines/pipelines_store_spec.js.es6
blob: 559723bafcc51c63b1f0acfcc0d1090fcafa4ffc (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
require('~/commit/pipelines/pipelines_store');

describe('Store', () => {
  let store;

  beforeEach(() => {
    store = new gl.commits.pipelines.PipelinesStore();
  });

  it('should start with a blank state', () => {
    expect(store.state.pipelines.length).toBe(0);
  });

  it('should store an array of pipelines', () => {
    const pipelines = [
      {
        id: '1',
        name: 'pipeline',
      },
      {
        id: '2',
        name: 'pipeline_2',
      },
    ];

    store.storePipelines(pipelines);

    expect(store.state.pipelines.length).toBe(pipelines.length);
  });
});