Commit c4d4f4d8 authored by Filipa Lacerda's avatar Filipa Lacerda

Clean history after every test that changes history

parent 20b54b13
......@@ -91,6 +91,10 @@ describe('Environment', () => {
});
describe('pagination', () => {
afterEach(() => {
window.history.pushState({}, null, '');
});
it('should render pagination', (done) => {
setTimeout(() => {
expect(
......
......@@ -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');
......
......@@ -124,6 +124,10 @@ describe('Pagination component', () => {
});
describe('paramHelper', () => {
afterEach(() => {
window.history.pushState({}, null, '');
});
it('can parse url parameters correctly', () => {
window.history.pushState({}, null, '?scope=all&p=2');
......
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