Skip to content

Commit c14d80e

Browse files
committed
add more coverage
1 parent 7864ae2 commit c14d80e

14 files changed

+860
-91
lines changed

src/__fixtures__/page.tsx

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
MDXPage,
33
SingleMDXPage,
4+
SingleMDXDocPage,
45
SiteMetaData
56
} from '../types';
67

@@ -52,4 +53,32 @@ export const createSingleMDXData = (): {
5253
}
5354
}
5455
}
55-
});
56+
});
57+
58+
export const createMDXDocsData = (toc): {
59+
mdx: SingleMDXDocPage;
60+
} => ({
61+
mdx: {
62+
id: 'mdx-1',
63+
fields: {
64+
slug: '/mdx/mdx-page-title',
65+
},
66+
frontmatter: {
67+
title: 'MDX Doc Page title',
68+
authors: 'pmc, pmc2',
69+
toc: toc ? true : false
70+
},
71+
tableOfContents: {
72+
items: [
73+
{
74+
url: '#section1',
75+
title: 'Section 1'
76+
},
77+
{
78+
url: '#section2',
79+
title: 'Section 2'
80+
}
81+
],
82+
}
83+
}
84+
});

src/pages/__tests__/__snapshots__/supported-platforms.test.tsx.snap

+18
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
926926
</p>
927927
</td>
928928
</tr>
929+
</tbody>
930+
<tbody>
929931
<tr
930932
class="bg-grey"
931933
>
@@ -1924,6 +1926,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
19241926
</p>
19251927
</td>
19261928
</tr>
1929+
</tbody>
1930+
<tbody>
19271931
<tr
19281932
class="bg-grey"
19291933
>
@@ -2676,6 +2680,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
26762680
</p>
26772681
</td>
26782682
</tr>
2683+
</tbody>
2684+
<tbody>
26792685
<tr
26802686
class="bg-grey"
26812687
>
@@ -3087,6 +3093,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
30873093
</p>
30883094
</td>
30893095
</tr>
3096+
</tbody>
3097+
<tbody>
30903098
<tr
30913099
class="bg-grey"
30923100
>
@@ -3839,6 +3847,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
38393847
</p>
38403848
</td>
38413849
</tr>
3850+
</tbody>
3851+
<tbody>
38423852
<tr
38433853
class="bg-grey"
38443854
>
@@ -4549,6 +4559,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
45494559
</p>
45504560
</td>
45514561
</tr>
4562+
</tbody>
4563+
<tbody>
45524564
<tr
45534565
class="bg-grey"
45544566
>
@@ -4943,6 +4955,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
49434955
</p>
49444956
</td>
49454957
</tr>
4958+
</tbody>
4959+
<tbody>
49464960
<tr
49474961
class="bg-grey"
49484962
>
@@ -5242,6 +5256,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
52425256
</p>
52435257
</td>
52445258
</tr>
5259+
</tbody>
5260+
<tbody>
52455261
<tr
52465262
class="bg-grey"
52475263
>
@@ -5446,6 +5462,8 @@ exports[`Supported Platforms page > renders correctly 1`] = `
54465462
</p>
54475463
</td>
54485464
</tr>
5465+
</tbody>
5466+
<tbody>
54495467
<tr
54505468
class="bg-grey"
54515469
>

src/pages/supported-platforms.tsx

+21-22
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,31 @@ const SupportedPlatformsPage = () => {
3939
</tr>
4040
<tr>
4141
{ versionsActive.map((version, index) => (
42-
<th key={index} className="tableblock halign-center valign-middle"><p className="tableblock">{version}</p></th>
42+
<th key={`verion-list-${index}`} className="tableblock halign-center valign-middle">
43+
<p className="tableblock">{version}</p>
44+
</th>
4345
))}
4446
</tr>
4547
</thead>
46-
<tbody>
47-
{ Object.keys(versions).map((os, index) => (
48-
<>
49-
<tr key={index} className='bg-grey'>
50-
<th className="tableblock halign-center valign-middle" colSpan={5}><p className="tableblock">{os}</p></th>
48+
{ Object.keys(versions).map((os) => (
49+
<tbody key={os}>
50+
<tr className='bg-grey'>
51+
<th className="tableblock halign-center valign-middle" colSpan={5}><p className="tableblock">{os}</p></th>
52+
</tr>
53+
{Object.keys(versions[os]).map((platform) => (
54+
<tr key={`${os}-${platform}`}>
55+
<td className="tableblock halign-center valign-middle"><p className="tableblock">{platform}</p></td>
56+
{ versionsActive.map((version, index) => (
57+
<td key={index} className="tableblock halign-center valign-middle">
58+
<p className="tableblock">
59+
{validator(versions[os][platform], version)}
60+
</p>
61+
</td>
62+
))}
5163
</tr>
52-
{Object.keys(versions[os]).map((platform, index) => (
53-
<tr key={index}>
54-
<td className="tableblock halign-center valign-middle"><p className="tableblock">{platform}</p></td>
55-
{ versionsActive.map((version, index) => (
56-
<td key={index} className="tableblock halign-center valign-middle">
57-
<p className="tableblock">
58-
{validator(versions[os][platform], version)}
59-
</p>
60-
</td>
61-
))}
62-
</tr>
63-
))}
64-
</>
65-
66-
))}
67-
</tbody>
64+
))}
65+
</tbody>
66+
))}
6867
</table>
6968
<div className='text-start pt-3'>
7069
<p>1. These builds should work on any distribution with glibc version 2.12 or higher.</p>

src/templates/__tests__/__snapshots__/blogPost.test.tsx.snap

-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
// Vitest Snapshot v1
22

3-
exports[`BlogPost Template page > formatDiv renders correctly - inline code block 1`] = `
4-
<div>
5-
<code>
6-
<code
7-
class="language-text"
8-
>
9-
test
10-
</code>
11-
</code>
12-
</div>
13-
`;
14-
15-
exports[`BlogPost Template page > formatDiv renders correctly 1`] = `
16-
<div>
17-
<div>
18-
<p>
19-
test
20-
</p>
21-
</div>
22-
</div>
23-
`;
24-
253
exports[`BlogPost Template page > renders correctly - featured image 1`] = `
264
<main>
275
<section

0 commit comments

Comments
 (0)