Skip to content

Commit f0a9d02

Browse files
committed
Adding unit tests
1 parent 20b47a9 commit f0a9d02

File tree

6 files changed

+545
-252
lines changed

6 files changed

+545
-252
lines changed

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

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,24 @@ exports[`Addons renders correctly 1`] = `
9999
>
100100
display top skills
101101
</AddonsItem>
102+
<AddonsItem
103+
Options={
104+
<CustomizeOptions
105+
CustomizationOptions={
106+
<CustomizeStreakStats
107+
onUpdate={[Function]}
108+
options={Object {}}
109+
prefix="streak-stats"
110+
/>
111+
}
112+
title="Customize Streak Stats Card"
113+
/>
114+
}
115+
inputId="streak-stats"
116+
onInputChange={[Function]}
117+
>
118+
display github streak stats
119+
</AddonsItem>
102120
<AddonsItem
103121
inputChecked={false}
104122
inputId="twitter-badge"
@@ -699,6 +717,80 @@ exports[`Addons should render Customize Badges 1`] = `
699717
</button>
700718
</div>
701719
</AddonsItem>
720+
<AddonsItem
721+
Options={
722+
<CustomizeOptions
723+
CustomizationOptions={
724+
<CustomizeStreakStats
725+
onUpdate={[Function]}
726+
options={Object {}}
727+
prefix="streak-stats"
728+
/>
729+
}
730+
title="Customize Streak Stats Card"
731+
/>
732+
}
733+
inputId="streak-stats"
734+
onInputChange={[Function]}
735+
>
736+
<div
737+
className="py-2 flex justify-start items-center text-sm sm:text-lg"
738+
>
739+
<label
740+
className="cursor-pointer flex items-center"
741+
htmlFor="streak-stats"
742+
>
743+
<input
744+
id="streak-stats"
745+
onChange={[Function]}
746+
type="checkbox"
747+
/>
748+
<span
749+
className="pl-4"
750+
>
751+
display github streak stats
752+
</span>
753+
</label>
754+
<button
755+
className="flex ml-3 focus:bg-gray-400"
756+
id="streak-stats-open-btn"
757+
onClick={[Function]}
758+
style={
759+
Object {
760+
"outline": "none",
761+
}
762+
}
763+
>
764+
<ToolsIcon
765+
className="transform scale-100 md:scale-125"
766+
size={16}
767+
verticalAlign="text-bottom"
768+
>
769+
<svg
770+
aria-hidden="true"
771+
className="transform scale-100 md:scale-125"
772+
dangerouslySetInnerHTML={
773+
Object {
774+
"__html": "<path fill-rule=\\"evenodd\\" d=\\"M5.433 2.304A4.494 4.494 0 003.5 6c0 1.598.832 3.002 2.09 3.802.518.328.929.923.902 1.64v.008l-.164 3.337a.75.75 0 11-1.498-.073l.163-3.33c.002-.085-.05-.216-.207-.316A5.996 5.996 0 012 6a5.994 5.994 0 012.567-4.92 1.482 1.482 0 011.673-.04c.462.296.76.827.76 1.423v2.82c0 .082.041.16.11.206l.75.51a.25.25 0 00.28 0l.75-.51A.25.25 0 009 5.282V2.463c0-.596.298-1.127.76-1.423a1.482 1.482 0 011.673.04A5.994 5.994 0 0114 6a5.996 5.996 0 01-2.786 5.068c-.157.1-.209.23-.207.315l.163 3.33a.75.75 0 11-1.498.074l-.164-3.345c-.027-.717.384-1.312.902-1.64A4.496 4.496 0 0012.5 6a4.494 4.494 0 00-1.933-3.696c-.024.017-.067.067-.067.16v2.818a1.75 1.75 0 01-.767 1.448l-.75.51a1.75 1.75 0 01-1.966 0l-.75-.51A1.75 1.75 0 015.5 5.282V2.463c0-.092-.043-.142-.067-.159zm.01-.005z\\"></path>",
775+
}
776+
}
777+
fill="currentColor"
778+
height={16}
779+
role="img"
780+
style={
781+
Object {
782+
"display": "inline-block",
783+
"userSelect": "none",
784+
"verticalAlign": "text-bottom",
785+
}
786+
}
787+
viewBox="0 0 16 16"
788+
width={16}
789+
/>
790+
</ToolsIcon>
791+
</button>
792+
</div>
793+
</AddonsItem>
702794
<AddonsItem
703795
inputChecked={false}
704796
inputId="twitter-badge"
@@ -1382,6 +1474,80 @@ exports[`Addons should render Customize Github stats card 1`] = `
13821474
</button>
13831475
</div>
13841476
</AddonsItem>
1477+
<AddonsItem
1478+
Options={
1479+
<CustomizeOptions
1480+
CustomizationOptions={
1481+
<CustomizeStreakStats
1482+
onUpdate={[Function]}
1483+
options={Object {}}
1484+
prefix="streak-stats"
1485+
/>
1486+
}
1487+
title="Customize Streak Stats Card"
1488+
/>
1489+
}
1490+
inputId="streak-stats"
1491+
onInputChange={[Function]}
1492+
>
1493+
<div
1494+
className="py-2 flex justify-start items-center text-sm sm:text-lg"
1495+
>
1496+
<label
1497+
className="cursor-pointer flex items-center"
1498+
htmlFor="streak-stats"
1499+
>
1500+
<input
1501+
id="streak-stats"
1502+
onChange={[Function]}
1503+
type="checkbox"
1504+
/>
1505+
<span
1506+
className="pl-4"
1507+
>
1508+
display github streak stats
1509+
</span>
1510+
</label>
1511+
<button
1512+
className="flex ml-3 focus:bg-gray-400"
1513+
id="streak-stats-open-btn"
1514+
onClick={[Function]}
1515+
style={
1516+
Object {
1517+
"outline": "none",
1518+
}
1519+
}
1520+
>
1521+
<ToolsIcon
1522+
className="transform scale-100 md:scale-125"
1523+
size={16}
1524+
verticalAlign="text-bottom"
1525+
>
1526+
<svg
1527+
aria-hidden="true"
1528+
className="transform scale-100 md:scale-125"
1529+
dangerouslySetInnerHTML={
1530+
Object {
1531+
"__html": "<path fill-rule=\\"evenodd\\" d=\\"M5.433 2.304A4.494 4.494 0 003.5 6c0 1.598.832 3.002 2.09 3.802.518.328.929.923.902 1.64v.008l-.164 3.337a.75.75 0 11-1.498-.073l.163-3.33c.002-.085-.05-.216-.207-.316A5.996 5.996 0 012 6a5.994 5.994 0 012.567-4.92 1.482 1.482 0 011.673-.04c.462.296.76.827.76 1.423v2.82c0 .082.041.16.11.206l.75.51a.25.25 0 00.28 0l.75-.51A.25.25 0 009 5.282V2.463c0-.596.298-1.127.76-1.423a1.482 1.482 0 011.673.04A5.994 5.994 0 0114 6a5.996 5.996 0 01-2.786 5.068c-.157.1-.209.23-.207.315l.163 3.33a.75.75 0 11-1.498.074l-.164-3.345c-.027-.717.384-1.312.902-1.64A4.496 4.496 0 0012.5 6a4.494 4.494 0 00-1.933-3.696c-.024.017-.067.067-.067.16v2.818a1.75 1.75 0 01-.767 1.448l-.75.51a1.75 1.75 0 01-1.966 0l-.75-.51A1.75 1.75 0 015.5 5.282V2.463c0-.092-.043-.142-.067-.159zm.01-.005z\\"></path>",
1532+
}
1533+
}
1534+
fill="currentColor"
1535+
height={16}
1536+
role="img"
1537+
style={
1538+
Object {
1539+
"display": "inline-block",
1540+
"userSelect": "none",
1541+
"verticalAlign": "text-bottom",
1542+
}
1543+
}
1544+
viewBox="0 0 16 16"
1545+
width={16}
1546+
/>
1547+
</ToolsIcon>
1548+
</button>
1549+
</div>
1550+
</AddonsItem>
13851551
<AddonsItem
13861552
inputChecked={false}
13871553
inputId="twitter-badge"
@@ -2065,6 +2231,80 @@ exports[`Addons should render Customize Top Skills Card 1`] = `
20652231
</div>
20662232
</CustomizeOptions>
20672233
</AddonsItem>
2234+
<AddonsItem
2235+
Options={
2236+
<CustomizeOptions
2237+
CustomizationOptions={
2238+
<CustomizeStreakStats
2239+
onUpdate={[Function]}
2240+
options={Object {}}
2241+
prefix="streak-stats"
2242+
/>
2243+
}
2244+
title="Customize Streak Stats Card"
2245+
/>
2246+
}
2247+
inputId="streak-stats"
2248+
onInputChange={[Function]}
2249+
>
2250+
<div
2251+
className="py-2 flex justify-start items-center text-sm sm:text-lg"
2252+
>
2253+
<label
2254+
className="cursor-pointer flex items-center"
2255+
htmlFor="streak-stats"
2256+
>
2257+
<input
2258+
id="streak-stats"
2259+
onChange={[Function]}
2260+
type="checkbox"
2261+
/>
2262+
<span
2263+
className="pl-4"
2264+
>
2265+
display github streak stats
2266+
</span>
2267+
</label>
2268+
<button
2269+
className="flex ml-3 focus:bg-gray-400"
2270+
id="streak-stats-open-btn"
2271+
onClick={[Function]}
2272+
style={
2273+
Object {
2274+
"outline": "none",
2275+
}
2276+
}
2277+
>
2278+
<ToolsIcon
2279+
className="transform scale-100 md:scale-125"
2280+
size={16}
2281+
verticalAlign="text-bottom"
2282+
>
2283+
<svg
2284+
aria-hidden="true"
2285+
className="transform scale-100 md:scale-125"
2286+
dangerouslySetInnerHTML={
2287+
Object {
2288+
"__html": "<path fill-rule=\\"evenodd\\" d=\\"M5.433 2.304A4.494 4.494 0 003.5 6c0 1.598.832 3.002 2.09 3.802.518.328.929.923.902 1.64v.008l-.164 3.337a.75.75 0 11-1.498-.073l.163-3.33c.002-.085-.05-.216-.207-.316A5.996 5.996 0 012 6a5.994 5.994 0 012.567-4.92 1.482 1.482 0 011.673-.04c.462.296.76.827.76 1.423v2.82c0 .082.041.16.11.206l.75.51a.25.25 0 00.28 0l.75-.51A.25.25 0 009 5.282V2.463c0-.596.298-1.127.76-1.423a1.482 1.482 0 011.673.04A5.994 5.994 0 0114 6a5.996 5.996 0 01-2.786 5.068c-.157.1-.209.23-.207.315l.163 3.33a.75.75 0 11-1.498.074l-.164-3.345c-.027-.717.384-1.312.902-1.64A4.496 4.496 0 0012.5 6a4.494 4.494 0 00-1.933-3.696c-.024.017-.067.067-.067.16v2.818a1.75 1.75 0 01-.767 1.448l-.75.51a1.75 1.75 0 01-1.966 0l-.75-.51A1.75 1.75 0 015.5 5.282V2.463c0-.092-.043-.142-.067-.159zm.01-.005z\\"></path>",
2289+
}
2290+
}
2291+
fill="currentColor"
2292+
height={16}
2293+
role="img"
2294+
style={
2295+
Object {
2296+
"display": "inline-block",
2297+
"userSelect": "none",
2298+
"verticalAlign": "text-bottom",
2299+
}
2300+
}
2301+
viewBox="0 0 16 16"
2302+
width={16}
2303+
/>
2304+
</ToolsIcon>
2305+
</button>
2306+
</div>
2307+
</AddonsItem>
20682308
<AddonsItem
20692309
inputChecked={false}
20702310
inputId="twitter-badge"

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,16 @@ exports[`Donate renders correctly 1`] = `
7171
Buy me a ko-fi
7272
</a>
7373
<a
74-
className="flex items-center justify-evenly bg-blue-500 text-white py-2 px-4 my-2"
74+
className="flex items-center justify-evenly bg-white-500 text-white py-2 px-4 my-2 border border-solid"
7575
href="https://www.paypal.me/rahuldkjain/10"
7676
rel="noreferrer"
7777
target="_blank"
7878
>
7979
<img
8080
alt="Donate rahuldkjain via paypal"
81-
className="w-6 h-6 mr-2"
82-
src="https://www.vectorlogo.zone/logos/paypal/paypal-ar21.svg"
81+
className="w-32 h-4"
82+
src="https://cdn.worldvectorlogo.com/logos/paypal-2.svg"
8383
/>
84-
Paypal
8584
</a>
8685
<a
8786
className="flex items-center justify-evenly bg-orange-500 text-white py-2 px-4 my-2"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ exports[`Footer component renders correctly 1`] = `
157157
</strong>
158158
</div>
159159
<div
160-
class="ml-2 sm:ml-0"
160+
className="ml-2 sm:ml-0"
161161
>
162162
<a
163163
aria-label="Discord of the community"

0 commit comments

Comments
 (0)