Skip to content

Commit 4b2df6b

Browse files
Update tests
1 parent e3c9499 commit 4b2df6b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

__tests__/actions/auth.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
2-
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v5/members/username12345';
2+
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
ok: true,
66
json: () => {
77
let content;
88
switch (url) {
9-
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2']; break;
10-
case MOCK_PROFILE_REQ_URL: content = [{ userId: 12345 }]; break;
9+
case MOCK_GROUPS_REQ_URL:
10+
content = ['Group1', 'Group2'];
11+
break;
12+
case MOCK_PROFILE_REQ_URL:
13+
content = { result: { content: { userId: 12345 }, status: 200 } };
14+
break;
1115
default: throw new Error('Unexpected URL!');
1216
}
1317
return content;

0 commit comments

Comments
 (0)