diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-08 09:14:57 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-09-08 09:14:57 +0000 |
commit | 56509d22d601b60bae888224d969dc4148bb9053 (patch) | |
tree | 93cfd9d977e409bc3adbf32e2cc2b739d5dbd140 /spec | |
parent | 8db9d8ff0a62674d4a8ede126b638d06b43fa3da (diff) | |
parent | 3d9b6bc2b98583a5220870025e942077c9303eaf (diff) | |
download | gitlab-ce-56509d22d601b60bae888224d969dc4148bb9053.tar.gz |
Merge branch 'backport-issues-controller-changes' into 'master'
Move issues index variable setting to a method
See merge request !14048
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/filtered_search/filtered_search_manager_spec.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/javascripts/filtered_search/filtered_search_manager_spec.js b/spec/javascripts/filtered_search/filtered_search_manager_spec.js index 16ae649ee60..f209328dee1 100644 --- a/spec/javascripts/filtered_search/filtered_search_manager_spec.js +++ b/spec/javascripts/filtered_search/filtered_search_manager_spec.js @@ -411,4 +411,26 @@ describe('Filtered Search Manager', () => { expect(document.querySelector('.filtered-search-box').classList.contains('focus')).toEqual(false); }); }); + + describe('getAllParams', () => { + beforeEach(() => { + this.paramsArr = ['key=value', 'otherkey=othervalue']; + + initializeManager(); + }); + + it('correctly modifies params when custom modifier is passed', () => { + const modifedParams = manager.getAllParams.call({ + modifyUrlParams: paramsArr => paramsArr.reverse(), + }, [].concat(this.paramsArr)); + + expect(modifedParams[0]).toBe(this.paramsArr[1]); + }); + + it('does not modify params when no custom modifier is passed', () => { + const modifedParams = manager.getAllParams.call({}, this.paramsArr); + + expect(modifedParams[1]).toBe(this.paramsArr[1]); + }); + }); }); |