diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-02 15:08:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-02 15:08:33 +0300 |
commit | 810bd2a662abaa60663ec19bcb55f883d329eb07 (patch) | |
tree | 9c0e537d8a23ac4481f13420fd9e0772dc3abf10 /spec/javascripts | |
parent | 8c826685ecb0058bf6acaf960ecab7897932f2e2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/merge_request_tabs_spec.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js index cbb61333d77..2b5fde9532d 100644 --- a/spec/javascripts/merge_request_tabs_spec.js +++ b/spec/javascripts/merge_request_tabs_spec.js @@ -30,7 +30,7 @@ describe('MergeRequestTabs', function() { setLocation(); this.spies = { - history: spyOn(window.history, 'replaceState').and.callFake(function() {}), + history: spyOn(window.history, 'pushState').and.callFake(function() {}), }; }); @@ -142,6 +142,7 @@ describe('MergeRequestTabs', function() { afterEach(() => { mock.restore(); + window.history.replaceState({}, '', '/'); }); it('changes from commits', function() { @@ -194,11 +195,21 @@ describe('MergeRequestTabs', function() { setLocation({ pathname: '/foo/bar/-/merge_requests/1', }); + window.history.replaceState( + { + url: window.location.href, + action: 'show', + }, + document.title, + window.location.href, + ); + const newState = this.subject('commits'); expect(this.spies.history).toHaveBeenCalledWith( { url: newState, + action: 'commits', }, document.title, newState, |