summaryrefslogtreecommitdiff
path: root/spec/javascripts/pipelines_spec.js
blob: 72770a702d305e038721e860ec14868624e14c15 (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('~/pipelines');

// Fix for phantomJS
if (!Element.prototype.matches && Element.prototype.webkitMatchesSelector) {
  Element.prototype.matches = Element.prototype.webkitMatchesSelector;
}

(() => {
  describe('Pipelines', () => {
    preloadFixtures('static/pipeline_graph.html.raw');

    beforeEach(() => {
      loadFixtures('static/pipeline_graph.html.raw');
    });

    it('should be defined', () => {
      expect(window.gl.Pipelines).toBeDefined();
    });

    it('should create a `Pipelines` instance without options', () => {
      expect(() => { new window.gl.Pipelines(); }).not.toThrow(); //eslint-disable-line
    });

    it('should create a `Pipelines` instance with options', () => {
      const pipelines = new window.gl.Pipelines({ foo: 'bar' });

      expect(pipelines.pipelineGraph).toBeDefined();
    });
  });
})();