Skip to content

Commit

Permalink
Update test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed May 7, 2024
1 parent 9e20794 commit fd8b460
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions packages/starlight/__tests__/remark-rehype/rehype-steps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,36 @@ test('component with non-`<ol>` content throws an error', () => {
"[AstroUserError]:
The \`<Steps>\` component expects its content to be a single ordered list (\`<ol>\`) but found the following element: \`<p>\`.
Hint:
To learn more about the \`<Steps>\` component, see https://starlight.astro.build/guides/components/#steps"
To learn more about the \`<Steps>\` component, see https://starlight.astro.build/guides/components/#steps
Full HTML passed to \`<Steps>\`:
<p>A paragraph is not an ordered list</p>
"
`);
});

test('component with multiple children throws an error', () => {
expect(() => processSteps('<ol></ol><ol></ol>')).toThrowErrorMatchingInlineSnapshot(`
expect(() =>
processSteps(
'<ol><li>List item</li></ol><p>I intended this to be part of the same list item</p><ol><li>Other list item</li></ol>'
)
).toThrowErrorMatchingInlineSnapshot(`
"[AstroUserError]:
The \`<Steps>\` component expects its content to be a single ordered list (\`<ol>\`) but found multiple child elements: \`<ol>\`, \`<ol>\`.
The \`<Steps>\` component expects its content to be a single ordered list (\`<ol>\`) but found multiple child elements: \`<ol>\`, \`<p>\`, \`<ol>\`.
Hint:
To learn more about the \`<Steps>\` component, see https://starlight.astro.build/guides/components/#steps"
To learn more about the \`<Steps>\` component, see https://starlight.astro.build/guides/components/#steps
Full HTML passed to \`<Steps>\`:
<ol>
<li>List item</li>
</ol>
<p>I intended this to be part of the same list item</p>
<ol>
<li>Other list item</li>
</ol>
"
`);
});

Expand Down

0 comments on commit fd8b460

Please sign in to comment.