Skip to content

Commit

Permalink
Block validation: add test for empty string
Browse files Browse the repository at this point in the history
Empty strings are considered equivalent
  • Loading branch information
johngodley committed Aug 12, 2018
1 parent 54e5d09 commit 192160e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/blocks/src/api/test/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,15 @@ describe( 'validation', () => {
expect( isEquivalent ).toBe( true );
} );

it( 'should return true when comparing empty strings', () => {
const isEquivalent = isEquivalentHTML(
'',
'',
);

expect( isEquivalent ).toBe( true );
} );

it( 'should return false if supplied malformed HTML', () => {
const isEquivalent = isEquivalentHTML(
'<blockquote class="wp-block-quote">fsdfsdfsd<p>fdsfsdfsdd</pfd fd fd></blockquote>',
Expand Down

0 comments on commit 192160e

Please sign in to comment.