Skip to content

Commit 9085d44

Browse files
authored
Merge pull request #76 from topcoder-platform/develop
Stats integration
2 parents 5ba77dc + 83b6610 commit 9085d44

File tree

32 files changed

+1435
-167
lines changed

32 files changed

+1435
-167
lines changed
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
import React from 'react';
2-
import Rnd from 'react-test-renderer/shallow';
2+
import Render from 'react-test-renderer';
33
import IconStat from 'components/tc-communities/IconStat';
44

5-
const rnd = new Rnd();
6-
75
function Icon() {
86
return <div />;
97
}
108

119
test('Snapshot match', () => {
12-
rnd.render((
13-
<IconStat icon={Icon} number="5" label="Projects" />
14-
));
15-
expect(rnd.getRenderOutput()).toMatchSnapshot();
16-
17-
rnd.render((
10+
const render = Render.create((
1811
<IconStat
1912
icon={Icon}
2013
number="5"
@@ -27,5 +20,5 @@ test('Snapshot match', () => {
2720
}}
2821
/>
2922
));
30-
expect(rnd.getRenderOutput()).toMatchSnapshot();
23+
expect(render.toJSON()).toMatchSnapshot();
3124
});

__tests__/shared/components/tc-communities/__snapshots__/Header.jsx.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ exports[`Snapshot match 1`] = `
6767
<div
6868
className="src-shared-components-tc-communities-Header-___style__authorize___3ARhM"
6969
>
70-
<a
70+
<button
7171
className="src-shared-components-tc-communities-Header-___style__btnRegister___2mlu6"
72-
href="/some/register/url"
72+
onClick={[Function]}
7373
>
7474
Register
75-
</a>
76-
<a
75+
</button>
76+
<button
7777
className="src-shared-components-tc-communities-Header-___style__btnLogin___37sgV"
78-
href="/some/login/url"
78+
onClick={[Function]}
7979
>
8080
Login
81-
</a>
81+
</button>
8282
</div>
8383
<div
8484
className="src-shared-components-tc-communities-Header-___style__search___3BJGl"
@@ -211,18 +211,18 @@ exports[`Snapshot match 2`] = `
211211
<div
212212
className="src-shared-components-tc-communities-Header-___style__authorize___3ARhM"
213213
>
214-
<a
214+
<button
215215
className="src-shared-components-tc-communities-Header-___style__btnRegister___2mlu6"
216-
href="/some/register/url"
216+
onClick={[Function]}
217217
>
218218
Register
219-
</a>
220-
<a
219+
</button>
220+
<button
221221
className="src-shared-components-tc-communities-Header-___style__btnLogin___37sgV"
222-
href="/some/login/url"
222+
onClick={[Function]}
223223
>
224224
Login
225-
</a>
225+
</button>
226226
</div>
227227
<div
228228
className="src-shared-components-tc-communities-Header-___style__search___3BJGl"
Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Snapshot match 1`] = `
4-
<IconStat
5-
icon={[Function]}
6-
label="Projects"
7-
number="5"
8-
theme={
9-
Object {
10-
"container": "src-shared-components-tc-communities-IconStat-___style__container___145TJ",
11-
"icon": "src-shared-components-tc-communities-IconStat-___style__icon___2PSr9",
12-
"label": "src-shared-components-tc-communities-IconStat-___style__label___3v7Pl",
13-
"number": "src-shared-components-tc-communities-IconStat-___style__number___3GKcu",
14-
}
15-
}
16-
/>
17-
`;
18-
19-
exports[`Snapshot match 2`] = `
20-
<IconStat
21-
icon={[Function]}
22-
label="Projects"
23-
number="5"
24-
theme={
25-
Object {
26-
"container": "src-shared-components-tc-communities-IconStat-___style__container___145TJ container",
27-
"icon": "src-shared-components-tc-communities-IconStat-___style__icon___2PSr9 icon",
28-
"label": "src-shared-components-tc-communities-IconStat-___style__label___3v7Pl label",
29-
"number": "src-shared-components-tc-communities-IconStat-___style__number___3GKcu number",
30-
}
31-
}
32-
/>
4+
<div
5+
className="src-shared-components-tc-communities-IconStat-___style__container___145TJ container"
6+
>
7+
<div />
8+
<p
9+
className="src-shared-components-tc-communities-IconStat-___style__number___3GKcu number"
10+
>
11+
5
12+
</p>
13+
<p
14+
className="src-shared-components-tc-communities-IconStat-___style__label___3v7Pl label"
15+
>
16+
Projects
17+
</p>
18+
</div>
3319
`;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import Rnd from 'react-test-renderer/shallow';
3+
import Home from 'components/tc-communities/communities/demo-expert/Home';
4+
5+
const rnd = new Rnd();
6+
7+
test('Snapshot match', () => {
8+
rnd.render((
9+
<Home />
10+
));
11+
expect(rnd.getRenderOutput()).toMatchSnapshot();
12+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import Rnd from 'react-test-renderer/shallow';
3+
import Learn from 'components/tc-communities/communities/demo-expert/Learn';
4+
5+
const rnd = new Rnd();
6+
7+
test('Snapshot match', () => {
8+
rnd.render((
9+
<Learn />
10+
));
11+
expect(rnd.getRenderOutput()).toMatchSnapshot();
12+
});
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Snapshot match 1`] = `
4+
<main>
5+
<ThemedBanner
6+
composeTheme="deeply"
7+
imageSrc="/themes/wipro/home/banner.jpg"
8+
link={
9+
Object {
10+
"title": "Compete Now",
11+
"url": "challenges",
12+
}
13+
}
14+
mapThemrProps={[Function]}
15+
text="Wipro's Hybrid Crowd gives our vast ecosystem of customers and partners options to access new range of skills that provide new value services and efficiency options all over the world."
16+
theme={Object {}}
17+
title="Wipro Crowd"
18+
/>
19+
<Connect(GroupStatsContainer) />
20+
<ThemedSection
21+
composeTheme="deeply"
22+
link={null}
23+
mapThemrProps={[Function]}
24+
theme={
25+
Object {
26+
"container": "src-shared-components-tc-communities-communities-demo-expert-Home-___style__linksContainer___15dON",
27+
}
28+
}
29+
title={null}
30+
>
31+
<div>
32+
<ThemedImageText
33+
composeTheme="deeply"
34+
imageSrc="/themes/wipro/home/image-text-learn.jpg"
35+
link={
36+
Object {
37+
"title": "Start Learning",
38+
"url": "learn",
39+
}
40+
}
41+
mapThemrProps={[Function]}
42+
text="Our continuously evolving structured learning paths, constantly abreast of the latest, tailored for employees to deepen your knowledge, infuses important software capabilities that are industry specific and help you get the skills you need to succeed."
43+
theme={Object {}}
44+
title="Improve Your Skills"
45+
/>
46+
<ThemedImageText
47+
composeTheme="deeply"
48+
imageSrc="/themes/wipro/home/image-text-do.jpg"
49+
link={
50+
Object {
51+
"title": "Start Earning",
52+
"url": "challenges",
53+
}
54+
}
55+
mapThemrProps={[Function]}
56+
text="Rewards program is intended to celebrate and recognize your contribution. Rewards for project contributions are given using ‘Reward Points’. Points earned translate into badges. Quarterly rewards are given away to the toppers of all categories."
57+
theme={Object {}}
58+
title="Get Involved"
59+
/>
60+
</div>
61+
</ThemedSection>
62+
<ThemedSection
63+
composeTheme="deeply"
64+
link={null}
65+
mapThemrProps={[Function]}
66+
theme={
67+
Object {
68+
"container": "src-shared-components-tc-communities-communities-demo-expert-Home-___style__resourcesContainer___3u3oE",
69+
}
70+
}
71+
title={null}
72+
>
73+
<ThemedResourceCard
74+
composeTheme="deeply"
75+
icon={[Function]}
76+
link={
77+
Object {
78+
"title": "Browse resources",
79+
"url": "learn",
80+
}
81+
}
82+
mapThemrProps={[Function]}
83+
text="Pellentesque non dignissim neque. Nunc vel rhoncus nibh, ut tincidunt turpis. Integer ac enim pellentesque, adipiscing metus id, pharetra odio."
84+
theme={Object {}}
85+
title="Up Your iOS and Swift Development Skills"
86+
/>
87+
<ThemedResourceCard
88+
composeTheme="deeply"
89+
icon={[Function]}
90+
link={
91+
Object {
92+
"title": "Learn about badges",
93+
"url": "leaderboard",
94+
}
95+
}
96+
mapThemrProps={[Function]}
97+
text="Donec bibendum nunc sit amet tortor scelerisque luctus et sit amet mauris. Suspendisse felis sem, condimentum ullamcorper est sit amet, molestie"
98+
theme={Object {}}
99+
title="Take the First Steps to Stand Out in the Community"
100+
/>
101+
<ThemedResourceCard
102+
composeTheme="deeply"
103+
icon={[Function]}
104+
link={
105+
Object {
106+
"title": "Browse challenges",
107+
"url": "challenges",
108+
}
109+
}
110+
mapThemrProps={[Function]}
111+
text="Suspendisse felis sem, condimentum ullamcorper est sit amet, molestie mollis nulla. Etiam lorem orci, consequat ac magna quis, facilisis"
112+
theme={Object {}}
113+
title="Compete in Challenges and Win Cash"
114+
/>
115+
</ThemedSection>
116+
<NewsSection
117+
news={Array []}
118+
/>
119+
<ThemedNewsletterSignup
120+
buttonText="Sign Up"
121+
composeTheme="deeply"
122+
emailPlaceholder="Email address"
123+
imageSrc="/themes/wipro/subscribe-bg.jpg"
124+
mapThemrProps={[Function]}
125+
text="Don’t miss out on the latest Topcoder IOS challenges and information!"
126+
theme={Object {}}
127+
title="Sign up for our newsletter"
128+
/>
129+
</main>
130+
`;

0 commit comments

Comments
 (0)