Skip to content

Commit b993f89

Browse files
New navigation component
1 parent cf5e02d commit b993f89

File tree

28 files changed

+8080
-8714
lines changed

28 files changed

+8080
-8714
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "./node_modules/topcoder-react-utils/config/eslint/default.json",
33
"rules": {
4-
"jsx-a11y/anchor-is-valid": false
4+
"jsx-a11y/anchor-is-valid": false,
5+
"import/no-cycle": [2, { "maxDepth": 1 }]
56
},
67
"env": {
78
"browser": true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"description": "devxxxxxx",
3+
"email": "[email protected]",
4+
"handle": "huanner",
5+
"photoURL": "https://topcoder-dev-media.s3.amazonaws.com/member/profile/huanner-1552562543506.png"
6+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Default render 1`] = `
4+
<div>
5+
<TopNav
6+
logo={
7+
<Logo
8+
height="20"
9+
viewBox="0 0 54 20"
10+
width="54"
11+
xmlns="http://www.w3.org/2000/svg"
12+
/>
13+
}
14+
menu={
15+
Array [
16+
Object {
17+
"id": "work",
18+
"subMenu": Array [
19+
Object {
20+
"subMenu": Array [
21+
Object {
22+
"link": "/challenges",
23+
"title": "All challenges",
24+
},
25+
Object {
26+
"href": "https://arena.topcoder-dev.com",
27+
"title": "Competitive programming",
28+
},
29+
],
30+
"title": "Compete",
31+
},
32+
Object {
33+
"subMenu": Array [
34+
Object {
35+
"href": "https://www.topcoder-dev.com/community/competitive-programming",
36+
"title": "Competitive programming",
37+
},
38+
Object {
39+
"href": "https://www.topcoder-dev.com/community/data-science/",
40+
"title": "Data Science",
41+
},
42+
Object {
43+
"href": "https://www.topcoder-dev.com/community/design/",
44+
"title": "Design",
45+
},
46+
Object {
47+
"href": "https://www.topcoder-dev.com/community/development",
48+
"title": "Development",
49+
},
50+
Object {
51+
"href": "https://www.topcoder-dev.com/community/qa",
52+
"title": "QA",
53+
},
54+
],
55+
"title": "Tracks",
56+
},
57+
Object {
58+
"subMenu": Array [
59+
Object {
60+
"href": "https://www.topcoder.com/tco",
61+
"title": "TCO",
62+
},
63+
Object {
64+
"href": "https://www.topcoder-dev.com/community/member-programs",
65+
"title": "Programs",
66+
},
67+
Object {
68+
"href": "https://apps.topcoder-dev.com/forums",
69+
"title": "Forums",
70+
},
71+
Object {
72+
"href": "https://www.topcoder-dev.com/community/statistics",
73+
"title": "Statistics",
74+
},
75+
Object {
76+
"href": "https://www.topcoder-dev.com/community/events",
77+
"title": "Events",
78+
},
79+
Object {
80+
"href": "https://www.topcoder-dev.com/blog",
81+
"title": "Blog",
82+
},
83+
],
84+
"title": "Community",
85+
},
86+
],
87+
"title": "WORK",
88+
},
89+
]
90+
}
91+
onChangeLevel1Id={[Function]}
92+
rightMenu={
93+
<LoginNav
94+
accountMenu={
95+
Array [
96+
Object {
97+
"link": "/settings/profile",
98+
"title": "Settings",
99+
},
100+
Object {
101+
"href": "https://community.topcoder-dev.com/PactsMemberServlet?module=PaymentHistory&full_list=false",
102+
"title": "Payments",
103+
},
104+
Object {
105+
"link": null,
106+
"title": "All projects",
107+
},
108+
Object {
109+
"separator": true,
110+
},
111+
Object {
112+
"href": "https://help.topcoder.com/",
113+
"title": "Help",
114+
},
115+
Object {
116+
"href": "https://www.topcoder.com/about/",
117+
"title": "About Topcoder",
118+
},
119+
Object {
120+
"href": "https://www.topcoder-dev.com/logout",
121+
"title": "Log Out",
122+
},
123+
]
124+
}
125+
authURLs={
126+
Object {
127+
"href": "http://accounts.topcoder-dev.com/member/registration?utm_source=community-app-main",
128+
"location": "http://accounts.topcoder-dev.com/member?retUrl=%S&utm_source=community-app-main",
129+
}
130+
}
131+
loggedIn={true}
132+
notificationButtonState="none"
133+
notifications={Array []}
134+
onSwitch={[Function]}
135+
profile={
136+
Object {
137+
"description": "devxxxxxx",
138+
"email": "[email protected]",
139+
"handle": "huanner",
140+
"photoURL": "https://d1aahxkjiobka8.cloudfront.net/avatar/https%3A%2F%2Ftopcoder-dev-media.s3.amazonaws.com%2Fmember%2Fprofile%2Fhuanner-1552562543506.png?size=32",
141+
}
142+
}
143+
showNotification={false}
144+
switchText={
145+
Object {
146+
"href": "http://connect.topcoder-dev.com",
147+
"title": "Switch to BUSINESS",
148+
}
149+
}
150+
/>
151+
}
152+
theme="light"
153+
/>
154+
</div>
155+
`;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import Renderer from 'react-test-renderer/shallow';
3+
4+
import Header from 'components/Header';
5+
6+
import profileState from './__mocks__/profile-state.json';
7+
8+
9+
const rnd = new Renderer();
10+
11+
it('Default render', () => {
12+
rnd.render((<Header
13+
profile={profileState}
14+
/>));
15+
expect(rnd.getRenderOutput()).toMatchSnapshot();
16+
});

__tests__/shared/components/TopcoderHeader/Auth.jsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

__tests__/shared/components/TopcoderHeader/__snapshots__/Auth.jsx.snap

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)