diff options
Diffstat (limited to 'spec/frontend/jira_connect/subscriptions/api_spec.js')
-rw-r--r-- | spec/frontend/jira_connect/subscriptions/api_spec.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/spec/frontend/jira_connect/subscriptions/api_spec.js b/spec/frontend/jira_connect/subscriptions/api_spec.js index e2a14a9102f..36e2c7bbab2 100644 --- a/spec/frontend/jira_connect/subscriptions/api_spec.js +++ b/spec/frontend/jira_connect/subscriptions/api_spec.js @@ -1,7 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; import { axiosInstance, - addSubscription, removeSubscription, fetchGroups, getCurrentUser, @@ -17,10 +16,8 @@ jest.mock('~/jira_connect/subscriptions/utils', () => ({ describe('JiraConnect API', () => { let axiosMock; - let originalGon; let response; - const mockAddPath = 'addPath'; const mockRemovePath = 'removePath'; const mockNamespace = 'namespace'; const mockJwt = 'jwt'; @@ -29,39 +26,14 @@ describe('JiraConnect API', () => { beforeEach(() => { axiosMock = new MockAdapter(axiosInstance); - originalGon = window.gon; window.gon = { api_version: 'v4' }; }); afterEach(() => { axiosMock.restore(); - window.gon = originalGon; response = null; }); - describe('addSubscription', () => { - const makeRequest = () => addSubscription(mockAddPath, mockNamespace); - - it('returns success response', async () => { - jest.spyOn(axiosInstance, 'post'); - axiosMock - .onPost(mockAddPath, { - jwt: mockJwt, - namespace_path: mockNamespace, - }) - .replyOnce(HTTP_STATUS_OK, mockResponse); - - response = await makeRequest(); - - expect(getJwt).toHaveBeenCalled(); - expect(axiosInstance.post).toHaveBeenCalledWith(mockAddPath, { - jwt: mockJwt, - namespace_path: mockNamespace, - }); - expect(response.data).toEqual(mockResponse); - }); - }); - describe('removeSubscription', () => { const makeRequest = () => removeSubscription(mockRemovePath); |