Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: topcoder-platform/topcoder-react-lib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1000.26.4
Choose a base ref
...
head repository: topcoder-platform/topcoder-react-lib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
Loading
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ jobs:
key: node-modules-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm test
- run: npm run build
- run: npm test
- persist_to_workspace:
root: .
paths:
@@ -28,7 +28,7 @@ jobs:
- attach_workspace:
at: .
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish --tag test-release
- run: npm publish
# dont change anything
workflows:
version: 2
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__coverage__
.build-info
.sass-cache
dist
node_modules
_auto_doc_
.vscode
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,13 @@

The [Topcoder](https://www.topcoder.com) lib for internal ReactJS projects.

### Before create a Test Release

Add `--tag test-release` to link 31 in `.circleci/config.yml`
```
- run: npm publish --tag test-release
```

### Configuration for AV-Scan scorer review type ID

Change the property in `AV_SCAN_SCORER_REVIEW_TYPE_ID` in config.
16 changes: 16 additions & 0 deletions __tests__/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
@@ -4,13 +4,16 @@ exports[`Library interface test 1`] = `
Object {
"actions": Object {
"auth": Object {
"getAuthenticatedMemberGroups": [Function],
"loadProfile": [Function],
"setTcTokenV2": [Function],
"setTcTokenV3": [Function],
},
"challenge": Object {
"dropCheckpoints": [Function],
"dropResults": [Function],
"fetchChallengeStatisticsDone": [Function],
"fetchChallengeStatisticsInit": [Function],
"fetchCheckpointsDone": [Function],
"fetchCheckpointsInit": [Function],
"getActiveChallengesCountDone": [Function],
@@ -53,6 +56,7 @@ Object {
"dropGroups": [Function],
"getGroupsDone": [Function],
"getGroupsInit": [Function],
"getMemberGroups": [Function],
},
"looker": Object {
"getLookerDone": [Function],
@@ -170,7 +174,9 @@ Object {
"updatePasswordDone": [Function],
"updatePasswordInit": [Function],
"updateProfileDone": [Function],
"updateProfileDoneV5": [Function],
"updateProfileInit": [Function],
"updateProfileInitV5": [Function],
"uploadPhotoDone": [Function],
"uploadPhotoInit": [Function],
"verifyMemberNewEmailDone": [Function],
@@ -200,6 +206,10 @@ Object {
"getCommunityStatsDone": [Function],
"getCommunityStatsInit": [Function],
},
"tcAcademy": Object {
"getTcaCertificationsDone": [Function],
"getTcaCertificationsInit": [Function],
},
"terms": Object {
"agreeTermDone": [Function],
"agreeTermInit": [Function],
@@ -282,6 +292,7 @@ Object {
"reviewOpportunity": [Function],
"settings": [Function],
"stats": [Function],
"tcAcademy": [Function],
"terms": [Function],
},
"services": Object {
@@ -348,6 +359,10 @@ Object {
"default": undefined,
"getService": [Function],
},
"tcAcademy": Object {
"default": undefined,
"getService": [Function],
},
"terms": Object {
"default": undefined,
"getService": [Function],
@@ -403,6 +418,7 @@ Object {
},
"getApiResponsePayload": [Function],
"getLookerApiResponsePayload": [Function],
"handleApiResponse": [Function],
},
"time": Object {
"default": undefined,
2 changes: 2 additions & 0 deletions __tests__/actions/__snapshots__/profile.js.snap
Original file line number Diff line number Diff line change
@@ -44,7 +44,9 @@ Object {
"updatePasswordDone": [Function],
"updatePasswordInit": [Function],
"updateProfileDone": [Function],
"updateProfileDoneV5": [Function],
"updateProfileInit": [Function],
"updateProfileInitV5": [Function],
"uploadPhotoDone": [Function],
"uploadPhotoInit": [Function],
"verifyMemberNewEmailDone": [Function],
4 changes: 2 additions & 2 deletions __tests__/actions/auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const MOCK_GROUPS_REQ_URL = 'https://api.topcoder-dev.com/v5/groups?memberId=12345&membershipType=user';
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v3/members/username12345';
const MOCK_PROFILE_REQ_URL = 'https://api.topcoder-dev.com/v5/members/username12345';

jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
ok: true,
@@ -10,7 +10,7 @@ jest.mock('isomorphic-fetch', () => jest.fn(url => Promise.resolve({
content = ['Group1', 'Group2'];
break;
case MOCK_PROFILE_REQ_URL:
content = { result: { content: { userId: 12345 }, status: 200 } };
content = Promise.resolve({ userId: 12345 });
break;
default: throw new Error('Unexpected URL!');
}
4 changes: 0 additions & 4 deletions __tests__/actions/profile.js
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@ const linkedAccounts = [{

// Mock services
const mockMembersService = {
getPresignedUrl: jest.fn().mockReturnValue(Promise.resolve()),
uploadFileToS3: jest.fn().mockReturnValue(Promise.resolve()),
updateMemberPhoto: jest.fn().mockReturnValue(Promise.resolve('url-of-photo')),
updateMemberProfile: jest.fn().mockReturnValue(Promise.resolve(profile)),
addSkill: jest.fn().mockReturnValue(Promise.resolve({ skills: [skill] })),
@@ -47,8 +45,6 @@ test('Module exports', () => expect(actions).toMatchSnapshot());
test('profile.uploadPhotoDone', async () => {
const actionResult = await redux.resolveAction(actions.profile.uploadPhotoDone(handle, tokenV3));
expect(actionResult).toMatchSnapshot();
expect(mockMembersService.getPresignedUrl).toBeCalled();
expect(mockMembersService.uploadFileToS3).toBeCalled();
expect(mockMembersService.updateMemberPhoto).toBeCalled();
});

Loading