mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix: invalid DOM element nesting in katex tests
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
eaea86c17d
commit
b763413108
5 changed files with 53 additions and 53 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
exports[`katex frame renders a valid latex expression as explicit block 1`] = `
|
exports[`katex frame renders a valid latex expression as explicit block 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<p
|
||||||
data-testid="katex-block"
|
data-testid="katex-block"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
|
@ -10,21 +10,21 @@ exports[`katex frame renders a valid latex expression as explicit block 1`] = `
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex: \\int_0^\\infty x^2 dx
|
tex: \\int_0^\\infty x^2 dx
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: true
|
block: true
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -38,20 +38,20 @@ exports[`katex frame renders a valid latex expression as explicit inline 1`] = `
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex: \\int_0^\\infty x^2 dx
|
tex: \\int_0^\\infty x^2 dx
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: false
|
block: false
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -66,27 +66,27 @@ exports[`katex frame renders a valid latex expression as implicit inline 1`] = `
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex: \\int_0^\\infty x^2 dx
|
tex: \\int_0^\\infty x^2 dx
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: false
|
block: false
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`katex frame renders an error for an invalid latex expression as explicit block 1`] = `
|
exports[`katex frame renders an error for an invalid latex expression as explicit block 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<p
|
||||||
data-testid="katex-block"
|
data-testid="katex-block"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -95,7 +95,7 @@ exports[`katex frame renders an error for an invalid latex expression as explici
|
||||||
>
|
>
|
||||||
mocked parseerror
|
mocked parseerror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
exports[`KaTeX markdown extensions renders a valid block LaTeX expression in a single line 1`] = `
|
exports[`KaTeX markdown extensions renders a valid block LaTeX expression in a single line 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<p
|
||||||
data-testid="katex-block"
|
data-testid="katex-block"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
|
@ -10,21 +10,21 @@ exports[`KaTeX markdown extensions renders a valid block LaTeX expression in a s
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex: \\alpha
|
tex: \\alpha
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: true
|
block: true
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,7 @@ exports[`KaTeX markdown extensions renders a valid block LaTeX expression in a s
|
||||||
|
|
||||||
exports[`KaTeX markdown extensions renders a valid block LaTeX expression in multi line 1`] = `
|
exports[`KaTeX markdown extensions renders a valid block LaTeX expression in multi line 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<div
|
<p
|
||||||
data-testid="katex-block"
|
data-testid="katex-block"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
|
@ -40,23 +40,23 @@ exports[`KaTeX markdown extensions renders a valid block LaTeX expression in mul
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex:
|
tex:
|
||||||
\\alpha
|
\\alpha
|
||||||
|
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: true
|
block: true
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,20 +73,20 @@ exports[`KaTeX markdown extensions renders a valid inline LaTeX expression 1`] =
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
<span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
tex: \\alpha
|
tex: \\alpha
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<span>
|
||||||
block: false
|
block: false
|
||||||
</li>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ describe('katex frame', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.spyOn(KatexDefault, 'renderToString').mockImplementation(
|
jest.spyOn(KatexDefault, 'renderToString').mockImplementation(
|
||||||
(tex: string, options?: KatexOptions) => `<span>This is a mock for lib katex with this parameters:</span>
|
(tex: string, options?: KatexOptions) => `<span>This is a mock for lib katex with this parameters:</span>
|
||||||
<ul>
|
<span>
|
||||||
<li>tex: ${tex}</li>
|
<span>tex: ${tex}</span>
|
||||||
<li>block: ${String(options?.displayMode)}</li>
|
<span>block: ${String(options?.displayMode)}</span>
|
||||||
</ul>`
|
</span>`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ export const KatexFrame: React.FC<KatexFrameProps> = ({ expression, block = fals
|
||||||
}
|
}
|
||||||
}, [block, expression])
|
}, [block, expression])
|
||||||
|
|
||||||
return block ? <div {...testId('katex-block')}>{dom}</div> : <span {...testId('katex-inline')}>{dom}</span>
|
return block ? <p {...testId('katex-block')}>{dom}</p> : <span {...testId('katex-inline')}>{dom}</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default KatexFrame
|
export default KatexFrame
|
||||||
|
|
|
@ -21,10 +21,10 @@ describe('KaTeX markdown extensions', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.spyOn(KatexDefault, 'renderToString').mockImplementation(
|
jest.spyOn(KatexDefault, 'renderToString').mockImplementation(
|
||||||
(tex: string, options?: KatexOptions) => `<span>This is a mock for lib katex with this parameters:</span>
|
(tex: string, options?: KatexOptions) => `<span>This is a mock for lib katex with this parameters:</span>
|
||||||
<ul>
|
<span>
|
||||||
<li>tex: ${tex}</li>
|
<span>tex: ${tex}</span>
|
||||||
<li>block: ${String(options?.displayMode)}</li>
|
<span>block: ${String(options?.displayMode)}</span>
|
||||||
</ul>`
|
</span>`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue