diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-02 13:20:23 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-02 13:20:23 -0600 |
commit | 9e8762f898b9bc424600969b8d25eeb6549fe159 (patch) | |
tree | 2e66f2b6a1032eba8a2e61c286c74ad8e170c2cb /spec/javascripts | |
parent | f38b7cee7bdc261892c3b9354c56d54633c46054 (diff) | |
download | gitlab-ce-9e8762f898b9bc424600969b8d25eeb6549fe159.tar.gz |
rework tests which rely on teaspoon-specific behavior
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js.es6 | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js.es6 b/spec/javascripts/lib/utils/common_utils_spec.js.es6 index 1ce8f28e568..32c96e2a088 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js.es6 +++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6 @@ -10,9 +10,9 @@ // IE11 will return a relative pathname while other browsers will return a full pathname. // parseUrl uses an anchor element for parsing an url. With relative urls, the anchor // element will create an absolute url relative to the current execution context. - // The JavaScript test suite is executed at '/teaspoon' which will lead to an absolute - // url starting with '/teaspoon'. - expect(gl.utils.parseUrl('" test="asf"').pathname).toEqual('/teaspoon/%22%20test=%22asf%22'); + // The JavaScript test suite is executed at '/' which will lead to an absolute url + // starting with '/'. + expect(gl.utils.parseUrl('" test="asf"').pathname).toContain('/%22%20test=%22asf%22'); }); }); @@ -42,9 +42,13 @@ }); describe('gl.utils.getParameterByName', () => { + beforeEach(() => { + window.history.pushState({}, null, '?scope=all&p=2'); + }); + it('should return valid parameter', () => { - const value = gl.utils.getParameterByName('reporter'); - expect(value).toBe('Console'); + const value = gl.utils.getParameterByName('scope'); + expect(value).toBe('all'); }); it('should return invalid parameter', () => { |