pipeline_store_spec.js 669 Bytes
Newer Older
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
import PipelineStore from '~/pipelines/stores/pipeline_store';

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

  beforeEach(() => {
    store = new PipelineStore();
  });

  it('should set defaults', () => {
    expect(store.state).toEqual({ pipeline: {} });
    expect(store.state.pipeline).toEqual({});
  });

  describe('storePipeline', () => {
    it('should store empty object if none is provided', () => {
      store.storePipeline();

      expect(store.state.pipeline).toEqual({});
    });

    it('should store received object', () => {
      store.storePipeline({ foo: 'bar' });
      expect(store.state.pipeline).toEqual({ foo: 'bar' });
    });
  });
});