diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-03 21:10:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-03 21:10:18 +0300 |
commit | 9be457ffc1727f6a942a68c16e47ca0bcaa2f64a (patch) | |
tree | 5c006f5e268f88603a69da3c1c3056030b0afca7 /spec/frontend/lib | |
parent | 388e0fbbd00e04a10e3ac1084945aa18a781c40c (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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js index f35b25fdf04..450eeefd898 100644 --- a/spec/frontend/lib/utils/url_utility_spec.js +++ b/spec/frontend/lib/utils/url_utility_spec.js @@ -421,6 +421,16 @@ describe('URL utility', () => { window.location = originalLocation; }); + it.each` + inputQuery | expectedQuery + ${'?scope=all&state=merged'} | ${'?scope=all&state=merged'} + ${'?'} | ${'?'} + `('handles query string: $inputQuery', ({ inputQuery, expectedQuery }) => { + window.location.href = mockUrl; + urlUtils.visitUrl(inputQuery); + expect(window.location.assign).toHaveBeenCalledWith(`${mockUrl}${expectedQuery}`); + }); + it('does not navigate to unsafe urls', () => { // eslint-disable-next-line no-script-url const url = 'javascript:alert(document.domain)'; |