Commit 9e8762f8 authored by Mike Greiling's avatar Mike Greiling

rework tests which rely on teaspoon-specific behavior

parent f38b7cee
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
// IE11 will return a relative pathname while other browsers will return a full pathname. // 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 // 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. // 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 // The JavaScript test suite is executed at '/' which will lead to an absolute url
// url starting with '/teaspoon'. // starting with '/'.
expect(gl.utils.parseUrl('" test="asf"').pathname).toEqual('/teaspoon/%22%20test=%22asf%22'); expect(gl.utils.parseUrl('" test="asf"').pathname).toContain('/%22%20test=%22asf%22');
}); });
}); });
...@@ -42,9 +42,13 @@ ...@@ -42,9 +42,13 @@
}); });
describe('gl.utils.getParameterByName', () => { describe('gl.utils.getParameterByName', () => {
beforeEach(() => {
window.history.pushState({}, null, '?scope=all&p=2');
});
it('should return valid parameter', () => { it('should return valid parameter', () => {
const value = gl.utils.getParameterByName('reporter'); const value = gl.utils.getParameterByName('scope');
expect(value).toBe('Console'); expect(value).toBe('all');
}); });
it('should return invalid parameter', () => { it('should return invalid parameter', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment