Skip to content

Commit 182f2ea

Browse files
committed
Merge branch 'develop'
2 parents 3e8a6e0 + ee387c9 commit 182f2ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6888
-185
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ __coverage__
44
dist
55
node_modules
66
_auto_doc_
7+
.vscode

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Topcoder React Lib
22

3+
### v0.2.0
4+
Adds functionality necessary for the new *Profile Settings* page.
5+
36
### v0.1.0
47
Update of dependencies.
58

__tests__/__snapshots__/index.js.snap

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Object {
1313
"dropResults": [Function],
1414
"fetchCheckpointsDone": [Function],
1515
"fetchCheckpointsInit": [Function],
16+
"getActiveChallengesCountDone": [Function],
17+
"getActiveChallengesCountInit": [Function],
1618
"getDetailsDone": [Function],
1719
"getDetailsInit": [Function],
1820
"getSubmissionsDone": [Function],
@@ -48,6 +50,10 @@ Object {
4850
"getGroupsDone": [Function],
4951
"getGroupsInit": [Function],
5052
},
53+
"lookup": Object {
54+
"getSkillTagsDone": [Function],
55+
"getSkillTagsInit": [Function],
56+
},
5157
"memberTasks": Object {
5258
"dropAll": [Function],
5359
"getDone": [Function],
@@ -58,25 +64,59 @@ Object {
5864
"dropAll": [Function],
5965
"getAchievementsDone": [Function],
6066
"getAchievementsInit": [Function],
67+
"getActiveChallengesDone": [Function],
68+
"getActiveChallengesInit": [Function],
6169
"getFinancesDone": [Function],
6270
"getFinancesInit": [Function],
71+
"getStatsDistributionDone": [Function],
72+
"getStatsDistributionInit": [Function],
6373
"getStatsDone": [Function],
74+
"getStatsHistoryDone": [Function],
75+
"getStatsHistoryInit": [Function],
6476
"getStatsInit": [Function],
6577
},
6678
"profile": Object {
79+
"addSkillDone": [Function],
80+
"addSkillInit": [Function],
81+
"addWebLinkDone": [Function],
82+
"addWebLinkInit": [Function],
83+
"deletePhotoDone": [Function],
84+
"deletePhotoInit": [Function],
85+
"deleteWebLinkDone": [Function],
86+
"deleteWebLinkInit": [Function],
6787
"getAchievementsDone": [Function],
6888
"getAchievementsInit": [Function],
89+
"getCredentialDone": [Function],
90+
"getCredentialInit": [Function],
91+
"getEmailPreferencesDone": [Function],
92+
"getEmailPreferencesInit": [Function],
6993
"getExternalAccountsDone": [Function],
7094
"getExternalAccountsInit": [Function],
7195
"getExternalLinksDone": [Function],
7296
"getExternalLinksInit": [Function],
7397
"getInfoDone": [Function],
7498
"getInfoInit": [Function],
99+
"getLinkedAccountsDone": [Function],
100+
"getLinkedAccountsInit": [Function],
75101
"getSkillsDone": [Function],
76102
"getSkillsInit": [Function],
77103
"getStatsDone": [Function],
78104
"getStatsInit": [Function],
105+
"hideSkillDone": [Function],
106+
"hideSkillInit": [Function],
107+
"linkExternalAccountDone": [Function],
108+
"linkExternalAccountInit": [Function],
79109
"loadProfile": [Function],
110+
"saveEmailPreferencesDone": [Function],
111+
"saveEmailPreferencesInit": [Function],
112+
"unlinkExternalAccountDone": [Function],
113+
"unlinkExternalAccountInit": [Function],
114+
"updatePasswordDone": [Function],
115+
"updatePasswordInit": [Function],
116+
"updateProfileDone": [Function],
117+
"updateProfileInit": [Function],
118+
"uploadPhotoDone": [Function],
119+
"uploadPhotoInit": [Function],
80120
},
81121
"reviewOpportunity": Object {
82122
"cancelApplicationsDone": [Function],
@@ -166,6 +206,7 @@ Object {
166206
"direct": [Function],
167207
"errors": [Function],
168208
"groups": [Function],
209+
"lookup": [Function],
169210
"memberTasks": [Function],
170211
"members": [Function],
171212
"mySubmissionsManagement": [Function],
@@ -209,6 +250,10 @@ Object {
209250
"default": undefined,
210251
"getService": [Function],
211252
},
253+
"lookup": Object {
254+
"default": undefined,
255+
"getService": [Function],
256+
},
212257
"members": Object {
213258
"default": undefined,
214259
"getService": [Function],
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`challenge.getActiveChallengesCountDone 1`] = `
4+
Object {
5+
"payload": 10,
6+
"type": "CHALLENGE/GET_ACTIVE_CHALLENGES_COUNT_DONE",
7+
}
8+
`;
9+
10+
exports[`challenge.getActiveChallengesCountInit 1`] = `
11+
Object {
12+
"type": "CHALLENGE/GET_ACTIVE_CHALLENGES_COUNT_INIT",
13+
}
14+
`;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Module exports 1`] = `
4+
Object {
5+
"lookup": Object {
6+
"getSkillTagsDone": [Function],
7+
"getSkillTagsInit": [Function],
8+
},
9+
}
10+
`;
11+
12+
exports[`lookup.getSkillTagsDone 1`] = `
13+
Object {
14+
"payload": Array [
15+
Object {
16+
"domain": "SKILLS",
17+
"id": 251,
18+
"name": "Jekyll",
19+
"status": "APPROVED",
20+
},
21+
],
22+
"type": "LOOKUP/GET_SKILL_TAGS_DONE",
23+
}
24+
`;
25+
26+
exports[`lookup.getSkillTagsInit 1`] = `
27+
Object {
28+
"type": "LOOKUP/GET_SKILL_TAGS_INIT",
29+
}
30+
`;
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Module exports 1`] = `
4+
Object {
5+
"profile": Object {
6+
"addSkillDone": [Function],
7+
"addSkillInit": [Function],
8+
"addWebLinkDone": [Function],
9+
"addWebLinkInit": [Function],
10+
"deletePhotoDone": [Function],
11+
"deletePhotoInit": [Function],
12+
"deleteWebLinkDone": [Function],
13+
"deleteWebLinkInit": [Function],
14+
"getAchievementsDone": [Function],
15+
"getAchievementsInit": [Function],
16+
"getCredentialDone": [Function],
17+
"getCredentialInit": [Function],
18+
"getEmailPreferencesDone": [Function],
19+
"getEmailPreferencesInit": [Function],
20+
"getExternalAccountsDone": [Function],
21+
"getExternalAccountsInit": [Function],
22+
"getExternalLinksDone": [Function],
23+
"getExternalLinksInit": [Function],
24+
"getInfoDone": [Function],
25+
"getInfoInit": [Function],
26+
"getLinkedAccountsDone": [Function],
27+
"getLinkedAccountsInit": [Function],
28+
"getSkillsDone": [Function],
29+
"getSkillsInit": [Function],
30+
"getStatsDone": [Function],
31+
"getStatsInit": [Function],
32+
"hideSkillDone": [Function],
33+
"hideSkillInit": [Function],
34+
"linkExternalAccountDone": [Function],
35+
"linkExternalAccountInit": [Function],
36+
"loadProfile": [Function],
37+
"saveEmailPreferencesDone": [Function],
38+
"saveEmailPreferencesInit": [Function],
39+
"unlinkExternalAccountDone": [Function],
40+
"unlinkExternalAccountInit": [Function],
41+
"updatePasswordDone": [Function],
42+
"updatePasswordInit": [Function],
43+
"updateProfileDone": [Function],
44+
"updateProfileInit": [Function],
45+
"uploadPhotoDone": [Function],
46+
"uploadPhotoInit": [Function],
47+
},
48+
}
49+
`;
50+
51+
exports[`profile.addSkillDone 1`] = `
52+
Object {
53+
"payload": Object {
54+
"handle": "tcscoder",
55+
"skill": Object {
56+
"tagId": 123,
57+
"tagName": "Node.js",
58+
},
59+
"skills": Array [
60+
Object {
61+
"tagId": 123,
62+
"tagName": "Node.js",
63+
},
64+
],
65+
},
66+
"type": "PROFILE/ADD_SKILL_DONE",
67+
}
68+
`;
69+
70+
exports[`profile.addWebLinkDone 1`] = `
71+
Object {
72+
"payload": Object {
73+
"data": "https://www.google.com",
74+
"handle": "tcscoder",
75+
},
76+
"type": "PROFILE/ADD_WEB_LINK_DONE",
77+
}
78+
`;
79+
80+
exports[`profile.deleteWebLinkDone 1`] = `
81+
Object {
82+
"payload": Object {
83+
"data": "https://www.google.com",
84+
"handle": "tcscoder",
85+
},
86+
"type": "PROFILE/DELETE_WEB_LINK_DONE",
87+
}
88+
`;
89+
90+
exports[`profile.getCredentialDone 1`] = `
91+
Object {
92+
"payload": Object {
93+
"credential": Object {
94+
"hasPassword": true,
95+
},
96+
},
97+
"type": "PROFILE/GET_CREDENTIAL_DONE",
98+
}
99+
`;
100+
101+
exports[`profile.getEmailPreferencesDone 1`] = `
102+
Object {
103+
"payload": Object {
104+
"subscriptions": Object {
105+
"TOPCODER_NL_DATA": true,
106+
},
107+
},
108+
"type": "PROFILE/GET_EMAIL_PREFERENCES_DONE",
109+
}
110+
`;
111+
112+
exports[`profile.getLinkedAccountsDone 1`] = `
113+
Object {
114+
"payload": Object {
115+
"profiles": Array [
116+
Object {
117+
"providerType": "github",
118+
"social": true,
119+
"userId": "623633",
120+
},
121+
],
122+
},
123+
"type": "PROFILE/GET_LINKED_ACCOUNTS_DONE",
124+
}
125+
`;
126+
127+
exports[`profile.hideSkillDone 1`] = `
128+
Object {
129+
"payload": Object {
130+
"handle": "tcscoder",
131+
"skill": Object {
132+
"tagId": 123,
133+
"tagName": "Node.js",
134+
},
135+
"skills": Array [],
136+
},
137+
"type": "PROFILE/HIDE_SKILL_DONE",
138+
}
139+
`;
140+
141+
exports[`profile.linkExternalAccountDone 1`] = `
142+
Object {
143+
"payload": Object {
144+
"data": Object {
145+
"providerType": "github",
146+
"social": true,
147+
"userId": "623633",
148+
},
149+
"handle": "tcscoder",
150+
},
151+
"type": "PROFILE/LINK_EXTERNAL_ACCOUNT_DONE",
152+
}
153+
`;
154+
155+
exports[`profile.saveEmailPreferencesDone 1`] = `
156+
Object {
157+
"payload": Object {
158+
"data": Object {
159+
"subscriptions": Object {
160+
"TOPCODER_NL_DATA": true,
161+
},
162+
},
163+
"handle": "tcscoder",
164+
},
165+
"type": "PROFILE/SAVE_EMAIL_PREFERENCES_DONE",
166+
}
167+
`;
168+
169+
exports[`profile.unlinkExternalAccountDone 1`] = `
170+
Object {
171+
"payload": Object {
172+
"handle": "tcscoder",
173+
"providerType": "github",
174+
},
175+
"type": "PROFILE/UNLINK_EXTERNAL_ACCOUNT_DONE",
176+
}
177+
`;
178+
179+
exports[`profile.updatePasswordDone 1`] = `
180+
Object {
181+
"payload": Object {
182+
"data": Object {
183+
"update": true,
184+
},
185+
"handle": "tcscoder",
186+
},
187+
"type": "PROFILE/UPDATE_PASSWORD_DONE",
188+
}
189+
`;
190+
191+
exports[`profile.updateProfileDone 1`] = `
192+
Object {
193+
"payload": Object {
194+
"handle": "tcscoder",
195+
"userId": 12345,
196+
},
197+
"type": "PROFILE/UPDATE_PROFILE_DONE",
198+
}
199+
`;
200+
201+
exports[`profile.uploadPhotoDone 1`] = `
202+
Object {
203+
"payload": Object {
204+
"handle": "tcscoder",
205+
"photoURL": "url-of-photo",
206+
},
207+
"type": "PROFILE/UPLOAD_PHOTO_DONE",
208+
}
209+
`;

__tests__/actions/challenge.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { redux } from 'topcoder-react-utils';
12
import { actions } from '../../src';
23

34
jest.mock('../../src/services/challenges');
@@ -74,3 +75,14 @@ describe('challenge.fetchSubmissionsDone', () => {
7475
submissions: 'DUMMY DATA',
7576
})));
7677
});
78+
79+
test('challenge.getActiveChallengesCountInit', () => {
80+
const actionResult = actions.challenge.getActiveChallengesCountInit();
81+
expect(actionResult).toMatchSnapshot();
82+
});
83+
84+
test('challenge.getActiveChallengesCountDone', async () => {
85+
const actionResult =
86+
await redux.resolveAction(actions.challenge.getActiveChallengesCountDone('handle', 'tokenV3'));
87+
expect(actionResult).toMatchSnapshot();
88+
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy