Skip to content

Commit 4e3ac0d

Browse files
authored
Merge pull request topcoder-platform#51 from topcoder-platform/develop
Develop
2 parents 1ad88c5 + 10cf02c commit 4e3ac0d

24 files changed

+2355
-303
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__coverage__
22
.build-info
33
.sass-cache
4-
dist
4+
#dist
55
node_modules
66
_auto_doc_
77
.vscode

__tests__/__snapshots__/index.js.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Object {
5454
"getLookerDone": [Function],
5555
},
5656
"lookup": Object {
57+
"getCountriesDone": [Function],
58+
"getCountriesInit": [Function],
5759
"getSkillTagsDone": [Function],
5860
"getSkillTagsInit": [Function],
5961
},
@@ -127,6 +129,8 @@ Object {
127129
"updateProfileInit": [Function],
128130
"uploadPhotoDone": [Function],
129131
"uploadPhotoInit": [Function],
132+
"verifyMemberNewEmailDone": [Function],
133+
"verifyMemberNewEmailInit": [Function],
130134
},
131135
"reviewOpportunity": Object {
132136
"cancelApplicationsDone": [Function],
@@ -201,14 +205,17 @@ Object {
201205
"countReset": [Function],
202206
"debug": [Function],
203207
"dir": [Function],
208+
"dirxml": [Function],
204209
"error": [Function],
205210
"group": [Function],
206211
"groupCollapsed": [Function],
207212
"groupEnd": [Function],
208213
"info": [Function],
209214
"log": [Function],
215+
"table": [Function],
210216
"time": [Function],
211217
"timeEnd": [Function],
218+
"timeLog": [Function],
212219
"trace": [Function],
213220
"warn": [Function],
214221
},

__tests__/actions/__snapshots__/lookup.js.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,32 @@
33
exports[`Module exports 1`] = `
44
Object {
55
"lookup": Object {
6+
"getCountriesDone": [Function],
7+
"getCountriesInit": [Function],
68
"getSkillTagsDone": [Function],
79
"getSkillTagsInit": [Function],
810
},
911
}
1012
`;
1113

14+
exports[`lookup.getCountriesDone 1`] = `
15+
Object {
16+
"payload": Array [
17+
Object {
18+
"country": "Afghanistan",
19+
"countryCode": "AFG",
20+
},
21+
],
22+
"type": "LOOKUP/GET_COUNTRIES_DONE",
23+
}
24+
`;
25+
26+
exports[`lookup.getCountriesInit 1`] = `
27+
Object {
28+
"type": "LOOKUP/GET_COUNTRIES_INIT",
29+
}
30+
`;
31+
1232
exports[`lookup.getSkillTagsDone 1`] = `
1333
Object {
1434
"payload": Array [

__tests__/actions/__snapshots__/profile.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Object {
4545
"updateProfileInit": [Function],
4646
"uploadPhotoDone": [Function],
4747
"uploadPhotoInit": [Function],
48+
"verifyMemberNewEmailDone": [Function],
49+
"verifyMemberNewEmailInit": [Function],
4850
},
4951
}
5052
`;

__tests__/actions/lookup.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ const tag = {
1010
status: 'APPROVED',
1111
};
1212

13+
const country = {
14+
country: 'Afghanistan',
15+
countryCode: 'AFG',
16+
};
17+
1318
// Mock services
1419
const mockLookupService = {
1520
getTags: jest.fn().mockReturnValue(Promise.resolve([tag])),
21+
getCountries: jest.fn().mockReturnValue(Promise.resolve([country])),
1622
};
1723
LookupService.getService = jest.fn().mockReturnValue(mockLookupService);
1824

@@ -28,3 +34,14 @@ test('lookup.getSkillTagsDone', async () => {
2834
expect(actionResult).toMatchSnapshot();
2935
expect(mockLookupService.getTags).toBeCalled();
3036
});
37+
38+
test('lookup.getCountriesInit', async () => {
39+
const actionResult = actions.lookup.getCountriesInit();
40+
expect(actionResult).toMatchSnapshot();
41+
});
42+
43+
test('lookup.getCountriesDone', async () => {
44+
const actionResult = await redux.resolveAction(actions.lookup.getCountriesDone());
45+
expect(actionResult).toMatchSnapshot();
46+
expect(mockLookupService.getCountries).toBeCalled();
47+
});

__tests__/reducers/__snapshots__/lookup.js.snap

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,50 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`Default reducer Get countries 1`] = `
4+
Object {
5+
"countries": Array [
6+
Object {
7+
"country": "Afghanistan",
8+
"countryCode": "AFG",
9+
},
10+
],
11+
"loadingCountriesError": false,
12+
"loadingSkillTagsError": true,
13+
"skillTags": Array [
14+
Object {
15+
"domain": "SKILLS",
16+
"id": 251,
17+
"name": "Jekyll",
18+
"status": "APPROVED",
19+
},
20+
],
21+
}
22+
`;
23+
24+
exports[`Default reducer Get countries error 1`] = `
25+
Object {
26+
"countries": Array [
27+
Object {
28+
"country": "Afghanistan",
29+
"countryCode": "AFG",
30+
},
31+
],
32+
"loadingCountriesError": true,
33+
"loadingSkillTagsError": true,
34+
"skillTags": Array [
35+
Object {
36+
"domain": "SKILLS",
37+
"id": 251,
38+
"name": "Jekyll",
39+
"status": "APPROVED",
40+
},
41+
],
42+
}
43+
`;
44+
345
exports[`Default reducer Get skill tags 1`] = `
446
Object {
47+
"countries": Array [],
548
"loadingSkillTagsError": false,
649
"skillTags": Array [
750
Object {
@@ -16,6 +59,7 @@ Object {
1659

1760
exports[`Default reducer Get skill tags error 1`] = `
1861
Object {
62+
"countries": Array [],
1963
"loadingSkillTagsError": true,
2064
"skillTags": Array [
2165
Object {
@@ -30,12 +74,56 @@ Object {
3074

3175
exports[`Default reducer Initial state 1`] = `
3276
Object {
77+
"countries": Array [],
3378
"skillTags": Array [],
3479
}
3580
`;
3681

82+
exports[`Factory without server side rendering Get countries 1`] = `
83+
Object {
84+
"countries": Array [
85+
Object {
86+
"country": "Afghanistan",
87+
"countryCode": "AFG",
88+
},
89+
],
90+
"loadingCountriesError": false,
91+
"loadingSkillTagsError": true,
92+
"skillTags": Array [
93+
Object {
94+
"domain": "SKILLS",
95+
"id": 251,
96+
"name": "Jekyll",
97+
"status": "APPROVED",
98+
},
99+
],
100+
}
101+
`;
102+
103+
exports[`Factory without server side rendering Get countries error 1`] = `
104+
Object {
105+
"countries": Array [
106+
Object {
107+
"country": "Afghanistan",
108+
"countryCode": "AFG",
109+
},
110+
],
111+
"loadingCountriesError": true,
112+
"loadingSkillTagsError": true,
113+
"skillTags": Array [
114+
Object {
115+
"domain": "SKILLS",
116+
"id": 251,
117+
"name": "Jekyll",
118+
"status": "APPROVED",
119+
},
120+
],
121+
}
122+
`;
123+
37124
exports[`Factory without server side rendering Get skill tags 1`] = `
38125
Object {
126+
"countries": Array [],
39127
"loadingSkillTagsError": false,
40128
"skillTags": Array [
41129
Object {
@@ -50,6 +138,7 @@ Object {
50138

51139
exports[`Factory without server side rendering Get skill tags error 1`] = `
52140
Object {
141+
"countries": Array [],
53142
"loadingSkillTagsError": true,
54143
"skillTags": Array [
55144
Object {
@@ -64,6 +153,7 @@ Object {
64153

65154
exports[`Factory without server side rendering Initial state 1`] = `
66155
Object {
156+
"countries": Array [],
67157
"skillTags": Array [],
68158
}
69159
`;

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