Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Dec 19, 2024
1 parent d664bf9 commit fd57e0f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Transformers/BardTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ public function it_converts_html_to_prosemirror()
]], $output);
}

#[Test]
public function it_handles_text_without_paragraph_tags()
{
$transformer = new BardTransformer(
import: $this->import,
blueprint: $this->blueprint,
field: $this->field,
config: []
);

$output = $transformer->transform(<<<'HTML'
<h2>Blah blah</h2>
Nam voluptatem rem molestiae cumque doloremque. Saepe animi deserunt Maxime iam et inventore. ipsam in dignissimos qui occaecati.
HTML);

$this->assertEquals([
['type' => 'heading', 'attrs' => ['level' => 2, 'textAlign' => 'left'], 'content' => [['type' => 'text', 'text' => 'Blah blah']]],
['type' => 'paragraph', 'content' => [
['type' => 'text', 'text' => 'Nam voluptatem rem molestiae cumque doloremque. Saepe animi deserunt Maxime iam et inventore. ipsam in dignissimos qui occaecati.'],
]],
], $output);
}

#[Test]
public function it_handles_images()
{
Expand Down

0 comments on commit fd57e0f

Please sign in to comment.