Skip to content

Commit

Permalink
add more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jan 13, 2023
1 parent 7864ae2 commit c14d80e
Show file tree
Hide file tree
Showing 14 changed files with 860 additions and 91 deletions.
31 changes: 30 additions & 1 deletion src/__fixtures__/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
MDXPage,
SingleMDXPage,
SingleMDXDocPage,
SiteMetaData
} from '../types';

Expand Down Expand Up @@ -52,4 +53,32 @@ export const createSingleMDXData = (): {
}
}
}
});
});

export const createMDXDocsData = (toc): {
mdx: SingleMDXDocPage;
} => ({
mdx: {
id: 'mdx-1',
fields: {
slug: '/mdx/mdx-page-title',
},
frontmatter: {
title: 'MDX Doc Page title',
authors: 'pmc, pmc2',
toc: toc ? true : false
},
tableOfContents: {
items: [
{
url: '#section1',
title: 'Section 1'
},
{
url: '#section2',
title: 'Section 2'
}
],
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -1924,6 +1926,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -2676,6 +2680,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -3087,6 +3093,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -3839,6 +3847,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -4549,6 +4559,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -4943,6 +4955,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -5242,6 +5256,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down Expand Up @@ -5446,6 +5462,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
</p>
</td>
</tr>
</tbody>
<tbody>
<tr
class="bg-grey"
>
Expand Down
43 changes: 21 additions & 22 deletions src/pages/supported-platforms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,31 @@ const SupportedPlatformsPage = () => {
</tr>
<tr>
{ versionsActive.map((version, index) => (
<th key={index} className="tableblock halign-center valign-middle"><p className="tableblock">{version}</p></th>
<th key={`verion-list-${index}`} className="tableblock halign-center valign-middle">
<p className="tableblock">{version}</p>
</th>
))}
</tr>
</thead>
<tbody>
{ Object.keys(versions).map((os, index) => (
<>
<tr key={index} className='bg-grey'>
<th className="tableblock halign-center valign-middle" colSpan={5}><p className="tableblock">{os}</p></th>
{ Object.keys(versions).map((os) => (
<tbody key={os}>
<tr className='bg-grey'>
<th className="tableblock halign-center valign-middle" colSpan={5}><p className="tableblock">{os}</p></th>
</tr>
{Object.keys(versions[os]).map((platform) => (
<tr key={`${os}-${platform}`}>
<td className="tableblock halign-center valign-middle"><p className="tableblock">{platform}</p></td>
{ versionsActive.map((version, index) => (
<td key={index} className="tableblock halign-center valign-middle">
<p className="tableblock">
{validator(versions[os][platform], version)}
</p>
</td>
))}
</tr>
{Object.keys(versions[os]).map((platform, index) => (
<tr key={index}>
<td className="tableblock halign-center valign-middle"><p className="tableblock">{platform}</p></td>
{ versionsActive.map((version, index) => (
<td key={index} className="tableblock halign-center valign-middle">
<p className="tableblock">
{validator(versions[os][platform], version)}
</p>
</td>
))}
</tr>
))}
</>

))}
</tbody>
))}
</tbody>
))}
</table>
<div className='text-start pt-3'>
<p>1. These builds should work on any distribution with glibc version 2.12 or higher.</p>
Expand Down
22 changes: 0 additions & 22 deletions src/templates/__tests__/__snapshots__/blogPost.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
// Vitest Snapshot v1

exports[`BlogPost Template page > formatDiv renders correctly - inline code block 1`] = `
<div>
<code>
<code
class="language-text"
>
test
</code>
</code>
</div>
`;

exports[`BlogPost Template page > formatDiv renders correctly 1`] = `
<div>
<div>
<p>
test
</p>
</div>
</div>
`;

exports[`BlogPost Template page > renders correctly - featured image 1`] = `
<main>
<section
Expand Down
Loading

0 comments on commit c14d80e

Please sign in to comment.