-
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.
- Loading branch information
1 parent
544c337
commit 60e22bf
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
// 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,33 @@ | ||
/** | ||
* 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 () => { | ||
// Save should not be an option for new empty post. | ||
expect( await page.$( '.editor-post-save-draft' ) ).toBe( null ); | ||
|
||
// Add title to enable valid non-empty post save. | ||
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 dynamic block appears. | ||
const content = await page.$eval( '.entry-content', ( element ) => element.innerHTML ); | ||
expect( content ).toMatchSnapshot(); | ||
} ); | ||
} ); |