diff options
Diffstat (limited to 'spec/frontend/lib/utils/ajax_cache_spec.js')
-rw-r--r-- | spec/frontend/lib/utils/ajax_cache_spec.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/frontend/lib/utils/ajax_cache_spec.js b/spec/frontend/lib/utils/ajax_cache_spec.js index d4b95172d18..338302642ff 100644 --- a/spec/frontend/lib/utils/ajax_cache_spec.js +++ b/spec/frontend/lib/utils/ajax_cache_spec.js @@ -1,6 +1,7 @@ import MockAdapter from 'axios-mock-adapter'; import AjaxCache from '~/lib/utils/ajax_cache'; import axios from '~/lib/utils/axios_utils'; +import { HTTP_STATUS_OK } from '~/lib/utils/http_status'; describe('AjaxCache', () => { const dummyEndpoint = '/AjaxCache/dummyEndpoint'; @@ -102,7 +103,7 @@ describe('AjaxCache', () => { }); it('stores and returns data from Ajax call if cache is empty', () => { - mock.onGet(dummyEndpoint).reply(200, dummyResponse); + mock.onGet(dummyEndpoint).reply(HTTP_STATUS_OK, dummyResponse); return AjaxCache.retrieve(dummyEndpoint).then((data) => { expect(data).toEqual(dummyResponse); @@ -111,7 +112,7 @@ describe('AjaxCache', () => { }); it('makes no Ajax call if request is pending', () => { - mock.onGet(dummyEndpoint).reply(200, dummyResponse); + mock.onGet(dummyEndpoint).reply(HTTP_STATUS_OK, dummyResponse); return Promise.all([ AjaxCache.retrieve(dummyEndpoint), @@ -148,7 +149,7 @@ describe('AjaxCache', () => { AjaxCache.internalStorage[dummyEndpoint] = oldDummyResponse; - mock.onGet(dummyEndpoint).reply(200, dummyResponse); + mock.onGet(dummyEndpoint).reply(HTTP_STATUS_OK, dummyResponse); return Promise.all([ AjaxCache.retrieve(dummyEndpoint), |