-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pullquote: fix transform to quote crash (#44315)
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
clickBlockAppender, | ||
getEditedPostContent, | ||
createNewPost, | ||
transformBlockTo, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
describe( 'Quote', () => { | ||
beforeEach( async () => { | ||
await createNewPost(); | ||
} ); | ||
|
||
it( 'can be created by converting a quote and converted back to quote', async () => { | ||
await clickBlockAppender(); | ||
await page.keyboard.type( 'test' ); | ||
await transformBlockTo( 'Quote' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` | ||
"<!-- wp:quote --> | ||
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph --> | ||
<p>test</p> | ||
<!-- /wp:paragraph --></blockquote> | ||
<!-- /wp:quote -->" | ||
` ); | ||
|
||
await transformBlockTo( 'Pullquote' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` | ||
"<!-- wp:pullquote --> | ||
<figure class=\\"wp-block-pullquote\\"><blockquote><p>test</p></blockquote></figure> | ||
<!-- /wp:pullquote -->" | ||
` ); | ||
|
||
await transformBlockTo( 'Quote' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchInlineSnapshot( ` | ||
"<!-- wp:quote --> | ||
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph --> | ||
<p>test</p> | ||
<!-- /wp:paragraph --></blockquote> | ||
<!-- /wp:quote -->" | ||
` ); | ||
} ); | ||
} ); |