Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: Add a test to confirm that the focus moves from the post title to the paragraph using the enter key #58872

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/e2e/specs/editor/various/post-title.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test.describe( 'Post title', () => {
test.describe( 'Focus handling', () => {
test( 'should focus on the post title field when creating a new post in visual mode', async ( {
editor,
page,
admin,
} ) => {
await admin.createNewPost();
Expand All @@ -16,6 +17,13 @@ test.describe( 'Post title', () => {
} );

await expect( pageTitleField ).toBeFocused();
await page.keyboard.press( 'Enter' );
await expect(
editor.canvas.getByRole( 'document', {
name: 'Empty block',
} ),
'sould move focus to an empty paragraph block when the Enter key is pressed'
).toBeFocused();
} );

test( 'should focus on the post title field when creating a new post in code editor mode', async ( {
Expand Down