-
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.
Fix dynamic blocks not rendering in the frontend (#11050)
* Fix dynamic blocks not rendering in the frontend * Use variables for hook priorities * Test that dynamic blocks are rendered when meta boxes use the excerpt * Fix autop hook order * Fix linting * Fix scoping issues * Add an e2e test for the autop issue * copy/paste issues * Trying to fix travis * Trim content to avoid small differences between themes
- Loading branch information
1 parent
c5227f3
commit 4317761
Showing
6 changed files
with
77 additions
and
4 deletions.
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
7 changes: 7 additions & 0 deletions
7
test/e2e/specs/__snapshots__/compatibility-classic-editor.test.js.snap
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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Compatibility with Classic Editor Should not apply autop when rendering blocks 1`] = ` | ||
"<a> | ||
Random Link | ||
</a>" | ||
`; |
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,30 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { newPost, insertBlock, publishPost } from '../support/utils'; | ||
|
||
describe( 'Compatibility with Classic Editor', () => { | ||
beforeEach( async () => { | ||
await newPost(); | ||
} ); | ||
|
||
it( 'Should not apply autop when rendering blocks', async () => { | ||
await insertBlock( 'Custom HTML' ); | ||
await page.keyboard.type( '<a>' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( 'Random Link' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( '</a>' ); | ||
await publishPost(); | ||
|
||
// View the post. | ||
const viewPostLinks = await page.$x( "//a[contains(text(), 'View Post')]" ); | ||
await viewPostLinks[ 0 ].click(); | ||
await page.waitForNavigation(); | ||
|
||
// Check the the content doesn't contain <p> tags | ||
await page.waitForSelector( '.entry-content' ); | ||
const content = await page.$eval( '.entry-content', ( element ) => element.innerHTML.trim() ); | ||
expect( content ).toMatchSnapshot(); | ||
} ); | ||
} ); |
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