Skip to content

Commit

Permalink
Adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
godismyjudge95 committed Oct 1, 2023
1 parent cb35d8e commit 441711c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/DOMParser/EmptyNodesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

use Tiptap\Editor;

test('parsing must not fail on empty nodes', function () {
$html = '<p><img /></p><p><img /></p>';

$result = (new Editor)
->setContent($html)
->getDocument();

expect($result)->toEqual([
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [],
],
[
'type' => 'paragraph',
'content' => [],
],
],
]);
});

0 comments on commit 441711c

Please sign in to comment.