Skip to content

Commit f1a12b4

Browse files
API upgrades for the payment tool
1 parent 43c61a5 commit f1a12b4

File tree

6 files changed

+4290
-6482
lines changed

6 files changed

+4290
-6482
lines changed

__tests__/actions/auth.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v3/groups?memberId=12345&membershipType=user';
1+
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
22
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v3/members/username12345';
33

44
jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
55
json: () => {
66
let content;
77
switch (url) {
8-
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2']; break;
9-
case MOCK_PROFILE_REQ_URL: content = { userId: 12345 }; break;
8+
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2'];
9+
return content;
10+
case MOCK_PROFILE_REQ_URL: content = { userId: 12345 };
11+
return {
12+
result: { content, status: 200 },
13+
};
1014
default: throw new Error('Unexpected URL!');
1115
}
12-
return {
13-
result: { content, status: 200 },
14-
};
1516
},
1617
})));
1718

config/test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module.exports = {
22
API: {
33
V2: 'https://api.topcoder-dev.com/v2',
44
V3: 'https://api.topcoder-dev.com/v3',
5+
V4: 'https://api.topcoder-dev.com/v4',
6+
V5: 'https://api.topcoder-dev.com/v5',
57
},
68
dummyConfigKey: 'Dummy config value',
79
};

dist/dev/index.js

Lines changed: 0 additions & 1445 deletions
This file was deleted.

0 commit comments

Comments
 (0)