diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-01 12:26:55 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-01 12:26:55 +0000 |
commit | fe2e8dba22471eb39a703672c5d8039c20e94fa6 (patch) | |
tree | 0227bebbf665afebe9b0f2a30b3e2c5ab187cfb6 | |
parent | 4cea24f89c757dafcba190b46d1f5f866acd50f6 (diff) | |
download | gitlab-ce-ph-axios-3.tar.gz |
fixed infinite loop crashing testsph-axios-3
-rw-r--r-- | spec/javascripts/pager_spec.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/spec/javascripts/pager_spec.js b/spec/javascripts/pager_spec.js index fd9b83e3514..b09494f0b77 100644 --- a/spec/javascripts/pager_spec.js +++ b/spec/javascripts/pager_spec.js @@ -47,12 +47,12 @@ describe('pager', () => { }); describe('getOld', () => { - const urlRegex = /\/some_list(.*)$/; + const urlRegex = /(.*)some_list(.*)$/; let mock; function mockSuccess() { mock.onGet(urlRegex).reply(200, { - count: 20, + count: 0, html: '', }); } @@ -65,9 +65,9 @@ describe('pager', () => { setFixtures('<div class="content_list" data-href="/some_list"></div><div class="loading"></div>'); spyOn(axios, 'get').and.callThrough(); - Pager.init(); - mock = new MockAdapter(axios); + + Pager.init(); }); afterEach(() => { @@ -119,10 +119,15 @@ describe('pager', () => { Pager.getOld(); setTimeout(() => { - const [url, params] = $.ajax.calls.argsFor(0); - console.log(url, params); - // expect(data).toBe('limit=20&offset=100'); - // expect(url).toBe('/some_list'); + const [url, params] = axios.get.calls.argsFor(0); + + expect(params).toEqual({ + params: { + limit: 20, + offset: 100, + }, + }); + expect(url).toBe('/some_list'); done(); }); |