diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-12-12 17:44:10 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-12-12 17:44:10 +0000 |
commit | 407adb9e9529d4aa769dbd1fbb3932684e036c3a (patch) | |
tree | d365ae989e3ee58da711da1542877d358287d63a /spec/javascripts/pipelines_spec.js.es6 | |
parent | 3445136b9b0b8367b151170509fabe613389a50d (diff) | |
parent | 52e0c4ba916d2cbc9bdb0fa0782c6b705c03c5a6 (diff) | |
download | gitlab-ce-407adb9e9529d4aa769dbd1fbb3932684e036c3a.tar.gz |
Merge branch '25483-broken-tabs' into 'master'
Fix TypeError: Cannot read property 'initTabs'
## What does this MR do?
Adds a default value to the `options` argument in order to prevent errors when `Pipelines` is initialised without arguments.
Adds tests to guarantee this does not happen again.
Adds back removed pipeline class to make the pipeline graph visible, `js-pipeline-graph`
## Why was this MR needed?
In the places where `Pipelines` is initialised without arguments it throws an error: `TypeError: Cannot read property 'initTabs'`
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #25483
Closes #25493
See merge request !8009
Diffstat (limited to 'spec/javascripts/pipelines_spec.js.es6')
-rw-r--r-- | spec/javascripts/pipelines_spec.js.es6 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/javascripts/pipelines_spec.js.es6 b/spec/javascripts/pipelines_spec.js.es6 new file mode 100644 index 00000000000..85c9cf4b4f1 --- /dev/null +++ b/spec/javascripts/pipelines_spec.js.es6 @@ -0,0 +1,25 @@ +//= require pipelines + +(() => { + describe('Pipelines', () => { + fixture.preload('pipeline_graph'); + + beforeEach(() => { + fixture.load('pipeline_graph'); + }); + + 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(); + }); + }); +})(); |