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

RichText: attempt to fix RTL e2e test #23203

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/e2e-tests/specs/editor/various/rtl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ describe( 'RTL', () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

// Wait for rich text editor to load.
await page.waitForSelector( '.block-editor-rich-text__editable' );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also used here:

it( 'should handle Home and End keys', async () => {
await page.keyboard.press( 'Enter' );
// Wait for rich text editor to load.
await page.waitForSelector( '.block-editor-rich-text__editable' );
await pressKeyWithModifier( 'primary', 'b' );

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why this is sometimes needed: caret position is not possible to be set internally upon focus. RichText only knows this information after a small delay. That's ok for typing since that's done by the browser, but it is needed for applying formats.


await pressKeyWithModifier( 'primary', 'b' );
await page.keyboard.type( ARABIC_ONE );
await pressKeyWithModifier( 'primary', 'b' );
Expand Down