Skip to content

Commit 7a61290

Browse files
committed
Added Test for markdownPreview and its subcomponents
1 parent d81fa46 commit 7a61290

File tree

3 files changed

+771
-4
lines changed

3 files changed

+771
-4
lines changed

src/components/__tests__/__snapshots__/footer.test.js.snap

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`Footer component Matches the snapshot 1`] = `
88
className="w-full flex flex-col sm:flex-row justify-evenly py-2"
99
>
1010
<div
11-
className="ml-2 sm:ml-0 sm:mr-6 order-last sm:order-none flex"
11+
className="sm:ml-0 sm:mr-6 order-last sm:order-none flex"
1212
>
1313
<h1
1414
className="text-base font-bold font-title text-xl sm:text-2xl mt-3 sm:mt-0"
@@ -110,7 +110,9 @@ exports[`Footer component Matches the snapshot 1`] = `
110110
Releases
111111
</a>
112112
</div>
113-
<div>
113+
<div
114+
className="ml-2 sm:ml-0"
115+
>
114116
<a
115117
aria-label="Issues in rahuldkjain/github-profile-readme-generator"
116118
href="https://github.com/rahuldkjain/github-profile-readme-generator/issues"
@@ -119,7 +121,9 @@ exports[`Footer component Matches the snapshot 1`] = `
119121
Issues
120122
</a>
121123
</div>
122-
<div>
124+
<div
125+
className="ml-2 sm:ml-0"
126+
>
123127
<a
124128
aria-label="Pull Requests in rahuldkjain/github-profile-readme-generator"
125129
href="https://github.com/rahuldkjain/github-profile-readme-generator/pulls"
@@ -137,7 +141,9 @@ exports[`Footer component Matches the snapshot 1`] = `
137141
Join Community
138142
</strong>
139143
</div>
140-
<div>
144+
<div
145+
class="ml-2 sm:ml-0"
146+
>
141147
<a
142148
aria-label="Discord of the community"
143149
href="https://discord.gg/HHMs7Eg"
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`DisplaySocial Preview renders correctly 1`] = `
4+
<a
5+
className="no-underline text-blue-700 m-2"
6+
href="https://codepen.io/dummy"
7+
target="blank"
8+
>
9+
<img
10+
alt="props.username"
11+
className="w-6 h-6"
12+
src="https://cdn.jsdelivr.net/npm/[email protected]/icons/codepen.svg"
13+
/>
14+
</a>
15+
`;
16+
17+
exports[`DisplaySocial Preview renders correctly with no username 1`] = `null`;
18+
19+
exports[`DisplayWork Preview renders correctly 1`] = `
20+
<div
21+
className="my-2"
22+
>
23+
[object Object]
24+
<a
25+
className="no-underline text-blue-700"
26+
href="https://dummy.com"
27+
target="blank"
28+
>
29+
readme-generator
30+
</a>
31+
</div>
32+
`;
33+
34+
exports[`DisplayWork Preview renders correctly with no link 1`] = `
35+
<div
36+
className="my-2"
37+
>
38+
[object Object]
39+
<b>
40+
readme-generator
41+
</b>
42+
</div>
43+
`;
44+
45+
exports[`DisplayWork Preview renders correctly with no prefix 1`] = `null`;
46+
47+
exports[`DisplayWork Preview renders correctly with no prefix and link 1`] = `null`;
48+
49+
exports[`DisplayWork Preview renders correctly with no prefix, link and project 1`] = `null`;
50+
51+
exports[`DisplayWork Preview renders correctly with no project 1`] = `
52+
<div
53+
className="my-2"
54+
>
55+
[object Object]
56+
<a
57+
className="no-underline text-blue-700"
58+
href="https://dummy.com"
59+
target="blank"
60+
>
61+
https://dummy.com
62+
</a>
63+
</div>
64+
`;
65+
66+
exports[`DisplayWork Preview renders correctly with no project and link 1`] = `null`;
67+
68+
exports[`DisplayWork Preview renders correctly with no project and prefix 1`] = `null`;
69+
70+
exports[`GitHubStats Preview renders correctly 1`] = `null`;
71+
72+
exports[`GitHubStats Preview renders correctly 2`] = `
73+
<div
74+
className="text-center mx-4 mb-4"
75+
>
76+
<img
77+
alt=""
78+
src="https://github-readme-stats.vercel.app/api?username=&show_icons=true&locale=en"
79+
/>
80+
</div>
81+
`;
82+
83+
exports[`GithubProfileTrophy Preview renders correctly 1`] = `null`;
84+
85+
exports[`GithubProfileTrophy Preview renders correctly with show true 1`] = `
86+
<div
87+
className="text-left my-2"
88+
>
89+
90+
<a
91+
href="https://github.com/ryo-ma/github-profile-trophy"
92+
>
93+
<img
94+
alt=""
95+
src="https://github-profile-trophy.vercel.app/?username="
96+
/>
97+
</a>
98+
99+
</div>
100+
`;
101+
102+
exports[`Markdown Preview renders correctly 1`] = `
103+
<div
104+
id="markdown-preview"
105+
>
106+
<h1
107+
className="text-center text-xl font-bold"
108+
>
109+
Hi 👋, I'm dummy
110+
</h1>
111+
<h3
112+
className="text-center font-medium"
113+
>
114+
A passionate frontend developer from India
115+
</h3>
116+
<div
117+
className="my-2"
118+
>
119+
🔭 I’m currently working on
120+
<a
121+
className="no-underline text-blue-700"
122+
href="https://dummy.com"
123+
target="blank"
124+
>
125+
readme-generator
126+
</a>
127+
</div>
128+
<div
129+
className="flex justify-start items-end flex-wrap"
130+
>
131+
<h3
132+
className="w-full text-lg sm:text-xl"
133+
>
134+
Connect with me:
135+
</h3>
136+
<a
137+
className="no-underline text-blue-700 m-2"
138+
href="https://codepen.io/dummy"
139+
target="blank"
140+
>
141+
<img
142+
alt="props.username"
143+
className="w-6 h-6"
144+
src="https://cdn.jsdelivr.net/npm/[email protected]/icons/codepen.svg"
145+
/>
146+
</a>
147+
</div>
148+
149+
<div
150+
className="block sm:flex sm:justify-center sm:items-start"
151+
>
152+
<div
153+
className="text-center mx-4 mb-4"
154+
>
155+
 
156+
</div>
157+
</div>
158+
</div>
159+
`;
160+
161+
exports[`SectionTitle Preview renders correctly 1`] = `
162+
<h3
163+
className="w-full text-lg sm:text-xl"
164+
>
165+
dummy
166+
</h3>
167+
`;
168+
169+
exports[`SectionTitle Preview renders correctly with no label 1`] = `null`;
170+
171+
exports[`SectionTitle Preview renders correctly with visible false 1`] = `null`;
172+
173+
exports[`Skills Preview renders correctly 1`] = `
174+
<div
175+
className="flex flex-wrap justify-start items-center"
176+
>
177+
<h3
178+
className="w-full text-lg sm:text-xl"
179+
>
180+
Languages and Tools:
181+
</h3>
182+
<a
183+
href="https://unity.com/"
184+
rel="noreferrer"
185+
target="_blank"
186+
>
187+
<img
188+
alt="unity"
189+
className="mb-4 mr-4 h-6 w-6 sm:h-10 sm:w-10"
190+
src="https://www.vectorlogo.zone/logos/unity3d/unity3d-icon.svg"
191+
/>
192+
</a>
193+
</div>
194+
`;
195+
196+
exports[`Skills Preview renders correctly with no skills 1`] = `""`;
197+
198+
exports[`Social Preview renders correctly 1`] = `
199+
<div
200+
className="flex justify-start items-end flex-wrap"
201+
>
202+
<h3
203+
className="w-full text-lg sm:text-xl"
204+
>
205+
Connect with me:
206+
</h3>
207+
<a
208+
className="no-underline text-blue-700 m-2"
209+
href="https://codepen.io/dummy"
210+
target="blank"
211+
>
212+
<img
213+
alt="props.username"
214+
className="w-6 h-6"
215+
src="https://cdn.jsdelivr.net/npm/[email protected]/icons/codepen.svg"
216+
/>
217+
</a>
218+
</div>
219+
`;
220+
221+
exports[`SubTitle Preview renders correctly 1`] = `
222+
<h3
223+
className="text-center font-medium"
224+
>
225+
A passionate frontend developer from India
226+
</h3>
227+
`;
228+
229+
exports[`SubTitle Preview renders correctly with no subtitle 1`] = `null`;
230+
231+
exports[`Title Preview renders correctly 1`] = `
232+
<h1
233+
className="text-center text-xl font-bold"
234+
>
235+
Hi 👋, I'm dummy
236+
</h1>
237+
`;
238+
239+
exports[`Title Preview renders correctly with no prefix 1`] = `null`;
240+
241+
exports[`Title Preview renders correctly with no title 1`] = `null`;
242+
243+
exports[`Title Preview renders correctly with no title and prefix 1`] = `null`;
244+
245+
exports[`TopLanguages Preview renders correctly 1`] = `
246+
<div
247+
className="text-center mx-4 mb-4"
248+
>
249+
 
250+
</div>
251+
`;
252+
253+
exports[`TopLanguages Preview renders correctly with show true 1`] = `
254+
<div
255+
className="text-center mx-4 mb-4"
256+
>
257+
<img
258+
alt=""
259+
src="https://github-readme-stats.vercel.app/api/top-langs?username=&show_icons=true&locale=en&layout=compact"
260+
/>
261+
</div>
262+
`;
263+
264+
exports[`TwitterBadgePreview Preview renders correctly 1`] = `null`;
265+
266+
exports[`TwitterBadgePreview Preview renders correctly with show true 1`] = `
267+
<div
268+
className="text-left my-2"
269+
>
270+
271+
<a
272+
href="https://twitter.com/\${props.twitter}"
273+
target="blank"
274+
>
275+
<img
276+
alt=""
277+
className="h-4 sm:h-6"
278+
src="https://img.shields.io/twitter/follow/?logo=twitter&style=for-the-badge"
279+
/>
280+
</a>
281+
282+
</div>
283+
`;
284+
285+
exports[`VisitorsBadge Preview renders correctly 1`] = `null`;
286+
287+
exports[`VisitorsBadge Preview renders correctly with show true 1`] = `
288+
<div
289+
className="text-left my-2"
290+
>
291+
292+
<img
293+
alt=""
294+
className="h-4 sm:h-6"
295+
src="https://komarev.com/ghpvc/?username=&label=Profile%20views&color=0e75b6&style=flat"
296+
/>
297+
298+
</div>
299+
`;
300+
301+
exports[`Work Preview renders correctly 1`] = `
302+
<div
303+
className="my-2"
304+
>
305+
🔭 I’m currently working on
306+
<a
307+
className="no-underline text-blue-700"
308+
href="https://dummy.com"
309+
target="blank"
310+
>
311+
readme-generator
312+
</a>
313+
</div>
314+
`;

0 commit comments

Comments
 (0)