diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 15:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 15:09:13 +0300 |
commit | 83916cf0a2f9254455a08a723961db34f0840df4 (patch) | |
tree | 41995d4ec0210785de1cd71853cbd1380570b2e7 /spec/frontend/vue_shared/components/url_sync_spec.js | |
parent | a9c5941625be2416fbf3b514019886e8f9658416 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/url_sync_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/url_sync_spec.js | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/spec/frontend/vue_shared/components/url_sync_spec.js b/spec/frontend/vue_shared/components/url_sync_spec.js index acda1a64a75..4ade168aa84 100644 --- a/spec/frontend/vue_shared/components/url_sync_spec.js +++ b/spec/frontend/vue_shared/components/url_sync_spec.js @@ -35,32 +35,22 @@ describe('url sync component', () => { wrapper.destroy(); }); - const expectUrlSyncFactory = ( - query, - times, - urlParamsUpdateStrategy, - urlOptions, - urlReturnValue, - ) => { - expect(urlParamsUpdateStrategy).toHaveBeenCalledTimes(times); - expect(urlParamsUpdateStrategy).toHaveBeenCalledWith(query, window.location.href, urlOptions); + const expectUrlSyncWithMergeUrlParams = (query, times, mergeUrlParamsReturnValue) => { + expect(mergeUrlParams).toHaveBeenCalledTimes(times); + expect(mergeUrlParams).toHaveBeenCalledWith(query, window.location.href, { + spreadArrays: true, + }); expect(historyPushState).toHaveBeenCalledTimes(times); - expect(historyPushState).toHaveBeenCalledWith(urlReturnValue); - }; - - const expectUrlSyncWithMergeUrlParams = (query, times, mergeUrlParamsReturnValue) => { - expectUrlSyncFactory( - query, - times, - mergeUrlParams, - { spreadArrays: true }, - mergeUrlParamsReturnValue, - ); + expect(historyPushState).toHaveBeenCalledWith(mergeUrlParamsReturnValue); }; const expectUrlSyncWithSetUrlParams = (query, times, setUrlParamsReturnValue) => { - expectUrlSyncFactory(query, times, setUrlParams, true, setUrlParamsReturnValue); + expect(setUrlParams).toHaveBeenCalledTimes(times); + expect(setUrlParams).toHaveBeenCalledWith(query, window.location.href, true, true, true); + + expect(historyPushState).toHaveBeenCalledTimes(times); + expect(historyPushState).toHaveBeenCalledWith(setUrlParamsReturnValue); }; describe('with query as a props', () => { |