diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-04-14 06:49:11 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-04-23 08:54:20 +0300 |
commit | 704e86613459fccfbab882de69f73c54372be611 (patch) | |
tree | 8117687740f6c7dcb0cf6da0bfa4d0fc6ae69825 /spec/javascripts/pager_spec.js | |
parent | 1f1af49a41be0072b7a5d37d47b470bea4daf222 (diff) |
fix more instances of "import *" with spyOnDependency
Diffstat (limited to 'spec/javascripts/pager_spec.js')
-rw-r--r-- | spec/javascripts/pager_spec.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/javascripts/pager_spec.js b/spec/javascripts/pager_spec.js index b09494f0b77..8e1e6af2286 100644 --- a/spec/javascripts/pager_spec.js +++ b/spec/javascripts/pager_spec.js @@ -1,7 +1,5 @@ -/* global fixture */ import MockAdapter from 'axios-mock-adapter'; import axios from '~/lib/utils/axios_utils'; -import * as utils from '~/lib/utils/url_utility'; import Pager from '~/pager'; describe('pager', () => { @@ -25,7 +23,7 @@ describe('pager', () => { it('should use current url if data-href attribute not provided', () => { const href = `${gl.TEST_HOST}/some_list`; - spyOn(utils, 'removeParams').and.returnValue(href); + spyOnDependency(Pager, 'removeParams').and.returnValue(href); Pager.init(); expect(Pager.url).toBe(href); }); @@ -39,9 +37,9 @@ describe('pager', () => { it('keeps extra query parameters from url', () => { window.history.replaceState({}, null, '?filter=test&offset=100'); const href = `${gl.TEST_HOST}/some_list?filter=test`; - spyOn(utils, 'removeParams').and.returnValue(href); + const removeParams = spyOnDependency(Pager, 'removeParams').and.returnValue(href); Pager.init(); - expect(utils.removeParams).toHaveBeenCalledWith(['limit', 'offset']); + expect(removeParams).toHaveBeenCalledWith(['limit', 'offset']); expect(Pager.url).toEqual(href); }); }); |