Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test parsed content of unknown blocks (without delimiters)
  • Loading branch information
nylen committed Apr 18, 2017
commit 7d64b27f26634b55cb1fb47778603f2f71015da0
11 changes: 10 additions & 1 deletion blocks/api/test/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@ describe( 'block parser', () => {

it( 'should parse the post content, using unknown block handler at the end of the block', () => {
registerBlock( 'core/test-block', {} );
registerBlock( 'core/unknown-block', {} );
registerBlock( 'core/unknown-block', {
// Currently this is the only way to test block content parsing?
attributes: function( rawContent ) {
return {
content: rawContent,
};
}
} );

setUnknownTypeHandler( 'core/unknown-block' );

Expand All @@ -169,6 +176,8 @@ describe( 'block parser', () => {
'core/test-block',
'core/unknown-block',
] );
expect( parsed[ 1 ].attributes.content ).to.eql( '<p>Broccoli</p>' );
expect( parsed[ 3 ].attributes.content ).to.eql( '<p>Romanesco</p>' );
} );
} );
} );