diff --git a/src/components/MarketplaceDownloadTable/__tests__/MarketplaceDownloadTable.test.tsx b/src/components/MarketplaceDownloadTable/__tests__/MarketplaceDownloadTable.test.tsx index ff215af24..53fac7592 100644 --- a/src/components/MarketplaceDownloadTable/__tests__/MarketplaceDownloadTable.test.tsx +++ b/src/components/MarketplaceDownloadTable/__tests__/MarketplaceDownloadTable.test.tsx @@ -53,4 +53,22 @@ describe('MarketplaceDownloadTable component', () => { ); expect(queryByText('Out of Date')).not.toBeInTheDocument(); }); + + it('renders correctly - Without checksum', () => { + let releases = [ + createRandomMarketplaceRelease(true, 1), + ]; + + // erase checksum + releases[0].binary.package.sha265sum = undefined; + releases[0].binary.installer[0].sha265sum = undefined; + + const { container } = render( + + ); + + expect(container).toMatchSnapshot(); + }); }); \ No newline at end of file diff --git a/src/components/MarketplaceDownloadTable/__tests__/__snapshots__/MarketplaceDownloadTable.test.tsx.snap b/src/components/MarketplaceDownloadTable/__tests__/__snapshots__/MarketplaceDownloadTable.test.tsx.snap index 57023bfea..b6910d3de 100644 --- a/src/components/MarketplaceDownloadTable/__tests__/__snapshots__/MarketplaceDownloadTable.test.tsx.snap +++ b/src/components/MarketplaceDownloadTable/__tests__/__snapshots__/MarketplaceDownloadTable.test.tsx.snap @@ -1,5 +1,223 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`MarketplaceDownloadTable component > renders correctly - Without checksum 1`] = ` +
+ + + + + + + + + + + + + + + + + + + + + +
+ Text + + Text + + Text + + Text + + Text + + Text +
+ + release_name_mock + +
+ + JRE + +
+ + January 1, 2020 + + + +
+ + + This build is over 180 days old. + + + + Out of Date +
+
+
+ Distribution_mock + + distribution_mock logo + + Os_mock + + arch_mock + + + + + + + + + + + + +
+ + + + + + +
+ Text +
+
+ + + + + + .msi + +
+ + + + + + +
+ Text +
+
+ + + + + + .tar.gz + +
+
+
+`; + exports[`MarketplaceDownloadTable component > renders correctly - no data 1`] = `
- Checksum (SHA256) + {checksum + ? Checksum (SHA256) + : Not available + }
diff --git a/src/components/TemurinArchiveTable/__tests__/TemurinArchiveTable.test.tsx b/src/components/TemurinArchiveTable/__tests__/TemurinArchiveTable.test.tsx index 07a707cfa..576a06d2b 100644 --- a/src/components/TemurinArchiveTable/__tests__/TemurinArchiveTable.test.tsx +++ b/src/components/TemurinArchiveTable/__tests__/TemurinArchiveTable.test.tsx @@ -47,4 +47,24 @@ describe('TemurinArchiveTable component', () => { ); expect(container).toMatchSnapshot(); }); + + it('renders correctly - Without checksum', () => { + let data = { + pagecount: 1, + releases : [ + createRandomTemurinReleases(true), + ] + }; + + // erase checksum + data.releases[0].platforms.platform_mock.assets[0].checksum = undefined; + + const { container } = render( + + ); + expect(container).toMatchSnapshot(); + }); }); \ No newline at end of file diff --git a/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap b/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap index 41407157d..7f75eed12 100644 --- a/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap +++ b/src/components/TemurinArchiveTable/__tests__/__snapshots__/TemurinArchiveTable.test.tsx.snap @@ -1,5 +1,324 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`TemurinArchiveTable component > renders correctly - Without checksum 1`] = ` +
+
+ + + + + + + +
+
+ +

+ release_name_mock +

+
+ + + This build is JCK certified + + + + + + AQAvit logo + +

+ January 1, 2020 +

+

+ + + + + + Text + +

+

+ + + + + + + Text + +

+
+
+ + + + + + + + + + + + + + + + + +
+ OS / Architecture + + Installer + + SHA256 + + Binary + + SHA256 +
+ Os_mock architecture_mock + + + type_mock + + + + + Text + + + + type_mock + + 0 MB + + + Text +
+
+ +
+
+`; + exports[`TemurinArchiveTable component > renders correctly - no data 1`] = `
renders correctly 1`] = ` + > + Text + diff --git a/src/components/TemurinArchiveTable/index.tsx b/src/components/TemurinArchiveTable/index.tsx index 8c779f83d..11b340df8 100644 --- a/src/components/TemurinArchiveTable/index.tsx +++ b/src/components/TemurinArchiveTable/index.tsx @@ -88,9 +88,9 @@ const TemurinArchiveTable = ({results, updatePage}) => { } - {asset.installer_link ? ( - Checksum - ): <> + {asset.installer_link && asset.installer_checksum + ? Checksum + : Not available } @@ -105,7 +105,10 @@ const TemurinArchiveTable = ({results, updatePage}) => { /> - Checksum + {asset.checksum + ? Checksum + : Not available + } ) diff --git a/src/components/TemurinDownloadTable/__tests__/TemurinDownloadTable.test.tsx b/src/components/TemurinDownloadTable/__tests__/TemurinDownloadTable.test.tsx index 450a5ced8..23287e0a1 100644 --- a/src/components/TemurinDownloadTable/__tests__/TemurinDownloadTable.test.tsx +++ b/src/components/TemurinDownloadTable/__tests__/TemurinDownloadTable.test.tsx @@ -44,4 +44,20 @@ describe('TemurinDownloadTable component', () => { ); expect(container).toMatchSnapshot(); }); + + it('renders correctly - Without checksum', () => { + let releases = [ + createRandomTemurinRelease(true), + ]; + + // erase checksum + releases[0].binaries[0].checksum = undefined; + + const { container } = render( + + ); + expect(container).toMatchSnapshot(); + }); }); \ No newline at end of file diff --git a/src/components/TemurinDownloadTable/__tests__/__snapshots__/TemurinDownloadTable.test.tsx.snap b/src/components/TemurinDownloadTable/__tests__/__snapshots__/TemurinDownloadTable.test.tsx.snap index ce28c1b05..c8dee94fe 100644 --- a/src/components/TemurinDownloadTable/__tests__/__snapshots__/TemurinDownloadTable.test.tsx.snap +++ b/src/components/TemurinDownloadTable/__tests__/__snapshots__/TemurinDownloadTable.test.tsx.snap @@ -1,5 +1,213 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`TemurinDownloadTable component > renders correctly - Without checksum 1`] = ` +
+ + + + + + + + + +
+ + + release_name_mock + + + + Temurin + + + This build is JCK certified + + + + + + AQAvit logo + + + + January 1, 2020 + + + Os_mock + + arch_mock + + + + + + + + + + + + +
+ + + + + + + + + +
+ type_mock - 0 MB +
+ + + + Text + + + +
+
+ + + + + + installer_extension_mock + +
+ + + + + + + + + +
+ type_mock - 0 MB +
+ + Text + +
+
+ + + + + + extension_mock + +
+
+
+`; + exports[`TemurinDownloadTable component > renders correctly - no data 1`] = `
diff --git a/src/components/TemurinNightlyTable/__tests__/TemurinNightlyTable.test.tsx b/src/components/TemurinNightlyTable/__tests__/TemurinNightlyTable.test.tsx index eb4038cf8..e1b6d07c4 100644 --- a/src/components/TemurinNightlyTable/__tests__/TemurinNightlyTable.test.tsx +++ b/src/components/TemurinNightlyTable/__tests__/TemurinNightlyTable.test.tsx @@ -30,4 +30,23 @@ describe('TemurinNightlyTable component', () => { ); expect(container).toMatchSnapshot(); }); + + it('renders correctly - Without checksum', () => { + const data = { + pagecount: null, + releases: [ + createRandomTemurinReleases(true), + ] + } + + // erase checksum + data.releases[0].platforms.platform_mock.assets[0].checksum = undefined; + + const { container } = render( + + ); + expect(container).toMatchSnapshot(); + }); }); \ No newline at end of file diff --git a/src/components/TemurinNightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap b/src/components/TemurinNightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap index 8427148cd..995f519fe 100644 --- a/src/components/TemurinNightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap +++ b/src/components/TemurinNightlyTable/__tests__/__snapshots__/TemurinNightlyTable.test.tsx.snap @@ -1,5 +1,103 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`TemurinNightlyTable component > renders correctly - Without checksum 1`] = ` +
+
+
- - Checksum - + {checksum + ? Checksum + : Not available + }
+ + + + + + + + + + + + + + + + + + + + + + +
+ Platform + + Type + + Build/Tag + + Date + + Binary + + Installer + + SHA256 +
+ Os_mock + + architecture_mock + + type_mock + + release_name_mock + + January 1, 2020 + + + extension_mock (0 MB) + + + + installer_extension_mock + + + Text +
+
+
+`; + exports[`TemurinNightlyTable component > renders correctly - no data 1`] = `
{ ) : } - Checksum + + {asset.checksum + ? Checksum + : Not available + } + ) )