diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-23 03:07:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-23 03:07:55 +0300 |
commit | 82f96a9ae2529898de0e91ccfad1d6457f3c1975 (patch) | |
tree | 7e189a0d2cef7df67aaa4f709e3f5bc312878cbd /spec/frontend/lib | |
parent | c50e042a392687730db9b8c2607883485b258ae4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/lib')
-rw-r--r-- | spec/frontend/lib/utils/url_utility_spec.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js index 4bf3a779f00..f41fe140ba1 100644 --- a/spec/frontend/lib/utils/url_utility_spec.js +++ b/spec/frontend/lib/utils/url_utility_spec.js @@ -406,7 +406,9 @@ describe('URL utility', () => { Object.defineProperty(window, 'location', { writable: true, - value: new URL(TEST_HOST), + value: { + assign: jest.fn(), + }, }); }); @@ -417,11 +419,15 @@ describe('URL utility', () => { it('navigates to a page', () => { urlUtils.visitUrl(mockUrl); - expect(window.location.href).toBe(mockUrl); + expect(window.location.assign).toHaveBeenCalledWith(mockUrl); }); it('navigates to a new page', () => { - const otherWindow = {}; + const otherWindow = { + location: { + assign: jest.fn(), + }, + }; Object.defineProperty(window, 'open', { writable: true, @@ -431,7 +437,7 @@ describe('URL utility', () => { urlUtils.visitUrl(mockUrl, true); expect(otherWindow.opener).toBe(null); - expect(otherWindow.location).toBe(mockUrl); + expect(otherWindow.location.assign).toHaveBeenCalledWith(mockUrl); }); }); |