Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test fixes #18

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,041 changes: 1,172 additions & 869 deletions package-lock.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`DownloadCounter component > should render correctly 1`] = `
<div>
<div
class="bg-purple py-8 lg:py-16"
>
<div
class="mx-auto max-w-[832px] w-full px-6 lg:px-0 flex flex-col items-center justify-center"
>
<h2
class="text-center text-[36px] sm:text-5xl font-semibold leading-[44px] sm:leading-[56px] text-white-900"
>
Lorem ipsum dolor sit amet consectetur. Risus pretium aliquet
</h2>
<h3
class="text-center text-[64px] lg:text-[104px] leading-[72px] lg:leading-[120px] font-semibold text-pink text-pink-800 my-8"
>
0
</h3>
<div
class="flex items-center gap-4 flex-wrap sm:gap-6 justify-center"
>
<span>
<svg
class="w-[92px] h-[32px] sm:w-fit sm:h-fit"
fill="none"
height="40"
viewBox="0 0 116 40"
width="116"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M16.9277 4.16663C8.94851 4.16663 2.48572 10.6666 2.48572 18.6916C2.48572 25.1189 6.61974 30.5476 12.3604 32.4722C13.0825 32.5993 13.3533 32.1636 13.3533 31.7823C13.3533 31.4373 13.3353 30.2935 13.3353 29.077C9.70672 29.7488 8.76799 28.1873 8.47915 27.3703C8.31667 26.9527 7.61263 25.6636 6.99884 25.3187C6.49337 25.0463 5.77127 24.3745 6.98079 24.3564C8.1181 24.3382 8.93046 25.4094 9.20125 25.8452C10.501 28.0421 12.5771 27.4248 13.4075 27.0435C13.5338 26.0994 13.9129 25.4639 14.3282 25.1008C11.1148 24.7376 7.75705 23.4849 7.75705 17.9291C7.75705 16.3495 8.31667 15.0422 9.23735 14.0255C9.09293 13.6623 8.58746 12.1735 9.38177 10.1763C9.38177 10.1763 10.5913 9.79506 13.3533 11.6652C14.5087 11.3383 15.7363 11.1749 16.9638 11.1749C18.1914 11.1749 19.419 11.3383 20.5743 11.6652C23.3364 9.77691 24.5459 10.1763 24.5459 10.1763C25.3402 12.1735 24.8347 13.6623 24.6903 14.0255C25.611 15.0422 26.1706 16.3313 26.1706 17.9291C26.1706 23.503 22.7948 24.7376 19.5814 25.1008C20.105 25.5547 20.5563 26.4262 20.5563 27.7879C20.5563 29.7306 20.5382 31.2921 20.5382 31.7823C20.5382 32.1636 20.809 32.6175 21.5311 32.4722C24.3981 31.4988 26.8894 29.6456 28.6543 27.1735C30.4193 24.7015 31.3689 21.735 31.3697 18.6916C31.3697 10.6666 24.9069 4.16663 16.9277 4.16663Z"
fill="#3E3355"
fill-rule="evenodd"
/>
<path
d="M69.8119 25.7025H69.7782C69.7934 25.7025 69.8035 25.7194 69.8186 25.7211H69.8288L69.8119 25.7042V25.7025ZM69.8186 25.7211C69.6619 25.7228 69.2677 25.8058 68.8515 25.8058C67.5373 25.8058 67.0824 25.1958 67.0824 24.3993V19.0936H69.7614C69.913 19.0936 70.0309 18.958 70.0309 18.7716V15.8908C70.0309 15.7383 69.8961 15.6028 69.7614 15.6028H67.0824V12.0272C67.0824 11.8916 66.9981 11.8069 66.8465 11.8069H63.2071C63.0555 11.8069 62.9712 11.8916 62.9712 12.0272V15.7044C62.9712 15.7044 61.1347 16.162 61.0167 16.1789C60.8819 16.2128 60.7977 16.3314 60.7977 16.467V18.7716C60.7977 18.958 60.9325 19.0936 61.0841 19.0936H62.9544V24.6518C62.9544 28.7866 65.8187 29.2103 67.7732 29.2103C68.6662 29.2103 69.7445 28.9222 69.913 28.8375C70.0141 28.8036 70.0646 28.6849 70.0646 28.5663V26.0244C70.0669 25.9523 70.0434 25.8818 69.9982 25.8258C69.953 25.7698 69.8893 25.732 69.8186 25.7194V25.7211ZM109.744 21.9913C109.744 18.9241 108.514 18.5174 107.217 18.653C106.206 18.7208 105.397 19.2292 105.397 19.2292V25.1941C105.397 25.1941 106.223 25.7703 107.453 25.8041C109.188 25.855 109.744 25.228 109.744 21.9913ZM113.838 21.7202C113.838 27.5326 111.968 29.1933 108.699 29.1933C105.936 29.1933 104.453 27.7868 104.453 27.7868C104.453 27.7868 104.386 28.5663 104.302 28.668C104.251 28.7697 104.167 28.8036 104.066 28.8036H101.572C101.404 28.8036 101.252 28.668 101.252 28.5155L101.286 9.68866C101.286 9.53615 101.421 9.40058 101.572 9.40058H105.161C105.313 9.40058 105.448 9.53615 105.448 9.68866V16.0772C105.448 16.0772 106.829 15.1791 108.851 15.1791L108.834 15.1452C110.856 15.1452 113.838 15.9078 113.838 21.7202ZM99.146 15.6028H95.6077C95.4224 15.6028 95.3213 15.7383 95.3213 15.9247V25.1433C95.3213 25.1433 94.3946 25.8041 93.1309 25.8041C91.8672 25.8041 91.4966 25.228 91.4966 23.9571V15.9078C91.4966 15.7553 91.3618 15.6197 91.2101 15.6197H87.6044C87.4528 15.6197 87.318 15.7553 87.318 15.9078V24.5671C87.318 28.2952 89.3904 29.2272 92.2379 29.2272C94.5799 29.2272 96.4839 27.9224 96.4839 27.9224C96.4839 27.9224 96.5681 28.5833 96.6186 28.6849C96.6523 28.7697 96.7703 28.8375 96.8882 28.8375H99.146C99.3313 28.8375 99.4324 28.7019 99.4324 28.5494L99.4661 15.8908C99.4661 15.7383 99.3313 15.6028 99.146 15.6028ZM59.2139 15.5858H55.625C55.4734 15.5858 55.3386 15.7383 55.3386 15.9247V28.363C55.3386 28.7019 55.5576 28.8205 55.8441 28.8205H59.0791C59.4161 28.8205 59.5003 28.668 59.5003 28.363V15.8739C59.5003 15.7214 59.3655 15.5858 59.2139 15.5858ZM57.4447 9.85812C56.1474 9.85812 55.1196 10.8918 55.1196 12.1966C55.1196 13.5015 56.1474 14.5352 57.4447 14.5352C58.7084 14.5352 59.7362 13.5015 59.7362 12.1966C59.7362 10.8918 58.7084 9.85812 57.4447 9.85812ZM85.2287 9.43448H81.6736C81.5219 9.43448 81.3872 9.57004 81.3872 9.72256V16.6534H75.8101V9.72256C75.8101 9.57004 75.6754 9.43448 75.5237 9.43448H71.9349C71.7832 9.43448 71.6484 9.57004 71.6484 9.72256V28.5494C71.6484 28.7019 71.8001 28.8375 71.9349 28.8375H75.5237C75.6754 28.8375 75.8101 28.7019 75.8101 28.5494V20.5001H81.3872L81.3535 28.5494C81.3535 28.7019 81.4883 28.8375 81.6399 28.8375H85.2287C85.3804 28.8375 85.5152 28.7019 85.5152 28.5494V9.72256C85.5152 9.57004 85.3804 9.43448 85.2287 9.43448ZM53.4347 17.7718V27.4987C53.4347 27.5665 53.4178 27.6851 53.3336 27.719C53.3336 27.719 51.2275 29.2272 47.7566 29.2272C43.5612 29.2272 38.5907 27.9054 38.5907 19.1953C38.5907 10.4851 42.9378 8.68886 47.1837 8.70581C50.8568 8.70581 52.3395 9.53615 52.5754 9.68866C52.6428 9.77339 52.6765 9.84118 52.6765 9.92591L51.9688 12.9423C51.9688 13.0948 51.8172 13.2812 51.6318 13.2303C51.0253 13.0439 50.1154 12.6711 47.9756 12.6711C45.4988 12.6711 42.8367 13.3829 42.8367 18.9919C42.8367 24.601 45.364 25.2619 47.1837 25.2619C48.7338 25.2619 49.2898 25.0755 49.2898 25.0755V21.1779H46.813C46.6277 21.1779 46.4929 21.0424 46.4929 20.8899V17.7718C46.4929 17.6193 46.6277 17.4837 46.813 17.4837H53.1145C53.2999 17.4837 53.4347 17.6193 53.4347 17.7718Z"
fill="#3E3355"
/>
</svg>
</span>
<p
class="text-[16px] font-normal leading-6 text-white mb-0"
>
Total Downloads/Docker pulls ever
</p>
<button
class="bg-transparent border-2 border-pink-500/0 text-white font-bold w-[148px] h-[48px] rounded-2xl gradient-border"
>
Learn More
</button>
</div>
</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ exports[`TemurinDownloadTable component > renders correctly - with source 1`] =
<span
class="text-white d-block m-2"
>
Temurin
Temurin

<svg
data-placement="bottom"
data-toggle="tooltip"
Expand Down Expand Up @@ -250,7 +251,8 @@ exports[`TemurinDownloadTable component > renders correctly - with source 1`] =
<span
class="text-white d-block m-2"
>
Temurin
Temurin

<svg
data-placement="bottom"
data-toggle="tooltip"
Expand Down Expand Up @@ -467,7 +469,8 @@ exports[`TemurinDownloadTable component > renders correctly 1`] = `
<span
class="text-white d-block m-2"
>
Temurin
Temurin

<svg
data-placement="bottom"
data-toggle="tooltip"
Expand Down Expand Up @@ -610,7 +613,8 @@ exports[`TemurinDownloadTable component > renders correctly 1`] = `
<span
class="text-white d-block m-2"
>
Temurin
Temurin

<svg
data-placement="bottom"
data-toggle="tooltip"
Expand Down
20 changes: 10 additions & 10 deletions src/hooks/__tests__/__snapshots__/fetchTemurinArchive.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`getAssetsForVersion > returns valid JSON - ea 1`] = `
}
`;

exports[`getAssetsForVersion > returns valid JSON - with installers 1`] = `
exports[`getAssetsForVersion > returns valid JSON 1`] = `
{
"pagecount": 3,
"releases": [
Expand All @@ -40,10 +40,6 @@ exports[`getAssetsForVersion > returns valid JSON - with installers 1`] = `
"architecture": "arch_mock",
"checksum": "checksum_mock",
"extension": ".tar.gz",
"installer_checksum": "installer_checksum_mock",
"installer_extension": ".msi",
"installer_link": "https://installer_link_mock/",
"installer_size": 0,
"link": "https://link_mock/",
"os": "os_mock",
"size": 0,
Expand All @@ -60,7 +56,7 @@ exports[`getAssetsForVersion > returns valid JSON - with installers 1`] = `
}
`;

exports[`getAssetsForVersion > returns valid JSON - with release notes 1`] = `
exports[`returns valid JSON - with installers 1`] = `
{
"pagecount": 3,
"releases": [
Expand All @@ -72,6 +68,10 @@ exports[`getAssetsForVersion > returns valid JSON - with release notes 1`] = `
"architecture": "arch_mock",
"checksum": "checksum_mock",
"extension": ".tar.gz",
"installer_checksum": "installer_checksum_mock",
"installer_extension": ".msi",
"installer_link": "https://installer_link_mock/",
"installer_size": 0,
"link": "https://link_mock/",
"os": "os_mock",
"size": 0,
Expand All @@ -82,14 +82,13 @@ exports[`getAssetsForVersion > returns valid JSON - with release notes 1`] = `
},
"release_link": "https://release_link_mock/",
"release_name": "release_name_mock",
"release_notes": true,
"timestamp": "2020-01-01T00:00:00.000Z",
},
],
}
`;

exports[`getAssetsForVersion > returns valid JSON - with source 1`] = `
exports[`returns valid JSON - with release notes 1`] = `
{
"pagecount": 3,
"releases": [
Expand All @@ -111,14 +110,14 @@ exports[`getAssetsForVersion > returns valid JSON - with source 1`] = `
},
"release_link": "https://release_link_mock/",
"release_name": "release_name_mock",
"source_url": "https://source_mock/",
"release_notes": true,
"timestamp": "2020-01-01T00:00:00.000Z",
},
],
}
`;

exports[`getAssetsForVersion > returns valid JSON 1`] = `
exports[`returns valid JSON - with source 1`] = `
{
"pagecount": 3,
"releases": [
Expand All @@ -140,6 +139,7 @@ exports[`getAssetsForVersion > returns valid JSON 1`] = `
},
"release_link": "https://release_link_mock/",
"release_name": "release_name_mock",
"source_url": "https://source_mock/",
"timestamp": "2020-01-01T00:00:00.000Z",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`useMediaQuery > should check for matchMedia support 1`] = `
<div>
undefined
false
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/__tests__/fetchReleaseNotes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { renderHook, waitFor } from "@testing-library/react"
import { describe, expect, it, vi } from "vitest"
import { afterAll, afterEach, describe, expect, it, vi } from "vitest"
import { fetchReleaseNotesForVersion } from "../fetchReleaseNotes"
import { createMockReleaseNotesAPI } from "../../__fixtures__/hooks"
import axios from "axios"
Expand Down
Loading
Loading