fix: missing wait for element in blockquote-extra-tag-markdown-extension.spec.tsx

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-04-12 19:04:41 +02:00
parent b763413108
commit 16bf5bb2af
2 changed files with 76 additions and 9 deletions

View file

@ -2,6 +2,11 @@
exports[`blockquote extra tag renders the tag "> [color=#f00] text" correctly 1`] = ` exports[`blockquote extra tag renders the tag "> [color=#f00] text" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<blockquote <blockquote
style="border-left-color: #f00;" style="border-left-color: #f00;"
> >
@ -20,6 +25,11 @@ exports[`blockquote extra tag renders the tag "> [color=#f00] text" correctly 1`
exports[`blockquote extra tag renders the tag "[=value]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[=value]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[=value] [=value]
</p> </p>
@ -30,6 +40,11 @@ exports[`blockquote extra tag renders the tag "[=value]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[color=#abcdef]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[color=#abcdef]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"
@ -45,6 +60,11 @@ exports[`blockquote extra tag renders the tag "[color=#abcdef]" correctly 1`] =
exports[`blockquote extra tag renders the tag "[color=#dfe]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[color=#dfe]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"
@ -60,6 +80,11 @@ exports[`blockquote extra tag renders the tag "[color=#dfe]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[color=]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[color=]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[color=] [color=]
</p> </p>
@ -70,6 +95,11 @@ exports[`blockquote extra tag renders the tag "[color=]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[color=notarealcolor]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[color=notarealcolor]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"
@ -84,6 +114,11 @@ exports[`blockquote extra tag renders the tag "[color=notarealcolor]" correctly
exports[`blockquote extra tag renders the tag "[color=white]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[color=white]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"
@ -99,6 +134,11 @@ exports[`blockquote extra tag renders the tag "[color=white]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[key=]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[key=]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[key=] [key=]
</p> </p>
@ -109,6 +149,11 @@ exports[`blockquote extra tag renders the tag "[key=]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[key]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[key]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[key] [key]
</p> </p>
@ -119,6 +164,11 @@ exports[`blockquote extra tag renders the tag "[key]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[name=]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[name=]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[name=] [name=]
</p> </p>
@ -129,6 +179,11 @@ exports[`blockquote extra tag renders the tag "[name=]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[name=giowehg]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[name=giowehg]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"
@ -143,6 +198,11 @@ exports[`blockquote extra tag renders the tag "[name=giowehg]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[time=]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[time=]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
[time=] [time=]
</p> </p>
@ -153,6 +213,11 @@ exports[`blockquote extra tag renders the tag "[time=]" correctly 1`] = `
exports[`blockquote extra tag renders the tag "[time=tomorrow]" correctly 1`] = ` exports[`blockquote extra tag renders the tag "[time=tomorrow]" correctly 1`] = `
<div> <div>
<p>
blockquote
</p>
<p> <p>
<span <span
class="blockquote-extra" class="blockquote-extra"

View file

@ -5,11 +5,11 @@
*/ */
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer' import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
import { BlockquoteExtraTagMarkdownExtension } from './blockquote-extra-tag-markdown-extension' import { BlockquoteExtraTagMarkdownExtension } from './blockquote-extra-tag-markdown-extension'
import { render } from '@testing-library/react' import { screen, render } from '@testing-library/react'
import React from 'react' import React from 'react'
describe('blockquote extra tag', () => { describe('blockquote extra tag', () => {
;[ it.each([
'[color=white]', '[color=white]',
'[color=#dfe]', '[color=#dfe]',
'[color=notarealcolor]', '[color=notarealcolor]',
@ -23,12 +23,14 @@ describe('blockquote extra tag', () => {
'[key=]', '[key=]',
'[=value]', '[=value]',
'> [color=#f00] text' '> [color=#f00] text'
].forEach((content) => { ])(`renders the tag "%s" correctly`, async (content) => {
it(`renders the tag "${content}" correctly`, () => {
const view = render( const view = render(
<TestMarkdownRenderer extensions={[new BlockquoteExtraTagMarkdownExtension()]} content={content} /> <TestMarkdownRenderer
extensions={[new BlockquoteExtraTagMarkdownExtension()]}
content={'blockquote\n\n' + content}
/>
) )
await screen.findByText('blockquote')
expect(view.container).toMatchSnapshot() expect(view.container).toMatchSnapshot()
}) })
})
}) })