-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the post title block editable (#27240)
Co-authored-by: ntsekouras <[email protected]>
- Loading branch information
1 parent
77ef788
commit b4da89f
Showing
3 changed files
with
81 additions
and
20 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
44 changes: 44 additions & 0 deletions
44
packages/e2e-tests/specs/experiments/blocks/post-title.test.js
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,44 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
activateTheme, | ||
createNewPost, | ||
insertBlock, | ||
pressKeyWithModifier, | ||
saveDraft, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
describe( 'Post Title block', () => { | ||
beforeAll( async () => { | ||
await activateTheme( 'twentytwentyone-blocks' ); | ||
} ); | ||
|
||
afterAll( async () => { | ||
await activateTheme( 'twentytwentyone' ); | ||
} ); | ||
|
||
beforeEach( async () => { | ||
await createNewPost(); | ||
} ); | ||
|
||
it( 'Can edit the post title', async () => { | ||
// Create a block with some text that will trigger a list creation. | ||
await insertBlock( 'Post Title' ); | ||
|
||
// Select all of the text in the post title block. | ||
await pressKeyWithModifier( 'primary', 'a' ); | ||
|
||
// Create a second list item. | ||
await page.keyboard.type( 'Just tweaking the post title' ); | ||
|
||
await saveDraft(); | ||
await page.reload(); | ||
await page.waitForSelector( '.edit-post-layout' ); | ||
const title = await page.$eval( | ||
'.editor-post-title__input', | ||
( element ) => element.value | ||
); | ||
expect( title ).toEqual( 'Just tweaking the post title' ); | ||
} ); | ||
} ); |
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