Skip to content

Commit e0c977d

Browse files
author
Dushyant Bhalgami
committed
fixed testcases
1 parent 89d47e1 commit e0c977d

File tree

5 files changed

+4285
-5031
lines changed

5 files changed

+4285
-5031
lines changed

__tests__/__snapshots__/index.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,17 @@ Object {
214214
"countReset": [Function],
215215
"debug": [Function],
216216
"dir": [Function],
217+
"dirxml": [Function],
217218
"error": [Function],
218219
"group": [Function],
219220
"groupCollapsed": [Function],
220221
"groupEnd": [Function],
221222
"info": [Function],
222223
"log": [Function],
224+
"table": [Function],
223225
"time": [Function],
224226
"timeEnd": [Function],
227+
"timeLog": [Function],
225228
"trace": [Function],
226229
"warn": [Function],
227230
},

__tests__/actions/auth.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v3/groups?memberId=12345&membershipType=user';
2+
const MOCK_GROUPS_REQ_URL_V5 = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
23
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v3/members/username12345';
34

45
jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
56
json: () => {
67
let content;
78
switch (url) {
8-
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2']; break;
9+
case MOCK_GROUPS_REQ_URL_V5: content = ['Group1', 'Group2']; break;
910
case MOCK_PROFILE_REQ_URL: content = { userId: 12345 }; break;
1011
default: throw new Error('Unexpected URL!');
1112
}
@@ -31,7 +32,7 @@ describe('fetch with success response', () => {
3132
'Content-Type': 'application/json',
3233
},
3334
});
34-
expect(fetch).toHaveBeenCalledWith(MOCK_GROUPS_REQ_URL, {
35+
expect(fetch).toHaveBeenCalledWith(MOCK_GROUPS_REQ_URL_V5, {
3536
headers: {
3637
Authorization: 'Bearer token',
3738
'Content-Type': 'application/json',

config/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
API: {
33
V2: 'https://api.topcoder-dev.com/v2',
44
V3: 'https://api.topcoder-dev.com/v3',
5+
V5: 'https://api.topcoder-dev.com/v5',
56
},
67
dummyConfigKey: 'Dummy config value',
78
};

0 commit comments

Comments
 (0)