diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-03-31 11:22:31 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-04-03 10:40:31 +0100 |
commit | c4d4f4d8577ec3d8e728bc56b3811db33094dd61 (patch) | |
tree | 5cb8991810821eac21e5785a2bf8f8a115315e4b /spec/javascripts/lib/utils | |
parent | 20b54b133c1714e6a2b0afbbf4c1770991e8e344 (diff) | |
download | gitlab-ce-c4d4f4d8577ec3d8e728bc56b3811db33094dd61.tar.gz |
Clean history after every test that changes history
Diffstat (limited to 'spec/javascripts/lib/utils')
-rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js b/spec/javascripts/lib/utils/common_utils_spec.js index d6dcdbf1d12..0fa4c51560b 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js +++ b/spec/javascripts/lib/utils/common_utils_spec.js @@ -46,6 +46,10 @@ require('~/lib/utils/common_utils'); spyOn(window.document, 'getElementById').and.callThrough(); }); + afterEach(() => { + window.history.pushState({}, null, ''); + }); + function expectGetElementIdToHaveBeenCalledWith(elementId) { expect(window.document.getElementById).toHaveBeenCalledWith(elementId); } @@ -80,6 +84,10 @@ require('~/lib/utils/common_utils'); window.history.pushState({}, null, '?scope=all&p=2'); }); + afterEach(() => { + window.history.pushState({}, null, ''); + }); + it('should return valid parameter', () => { const value = gl.utils.getParameterByName('scope'); expect(value).toBe('all'); |