File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
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' ;
3
3
4
4
jest . mock ( 'isomorphic-fetch' , ( ) => jest . fn ( url => Promise . resolve ( {
5
5
ok : true ,
6
6
json : ( ) => {
7
7
let content ;
8
8
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 ;
11
15
default : throw new Error ( 'Unexpected URL!' ) ;
12
16
}
13
17
return content ;
You can’t perform that action at this time.
0 commit comments