Skip to content

fix the payload for adding members to group #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ jobs:
- attach_workspace:
at: .
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish
- run: npm publish --tag test-release

workflows:
version: 2
7 changes: 4 additions & 3 deletions __tests__/actions/auth.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v3/groups?memberId=12345&membershipType=user';
// const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v3/groups?memberId=12345&membershipType=user';
const MOCK_GROUPS_REQ_URL_V5 = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v3/members/username12345';

jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
json: () => {
let content;
switch (url) {
case MOCK_GROUPS_REQ_URL: content = ['Group1', 'Group2']; break;
case MOCK_GROUPS_REQ_URL_V5: content = ['Group1', 'Group2']; break;
case MOCK_PROFILE_REQ_URL: content = { userId: 12345 }; break;
default: throw new Error('Unexpected URL!');
}
@@ -31,7 +32,7 @@ describe('fetch with success response', () => {
'Content-Type': 'application/json',
},
});
expect(fetch).toHaveBeenCalledWith(MOCK_GROUPS_REQ_URL, {
expect(fetch).toHaveBeenCalledWith(MOCK_GROUPS_REQ_URL_V5, {
headers: {
Authorization: 'Bearer token',
'Content-Type': 'application/json',
1 change: 1 addition & 0 deletions config/test.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ module.exports = {
API: {
V2: 'https://api.topcoder-dev.com/v2',
V3: 'https://api.topcoder-dev.com/v3',
V5: 'https://api.topcoder-dev.com/v5',
},
dummyConfigKey: 'Dummy config value',
};
Loading