Skip to content

Commit

Permalink
Fix RTL e2e tests (#26508)
Browse files Browse the repository at this point in the history
* Fix RTL e2e tests

* try different approach
  • Loading branch information
ellatrix authored Nov 2, 2020
1 parent ba7527f commit a45c00a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ exports[`RTL should arrow navigate 1`] = `

exports[`RTL should arrow navigate between blocks 1`] = `
"<!-- wp:paragraph -->
<p>٠</p>
<p>٠<br>١</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p><br>١١٠<br><br>٢</p>
<p>٠<br>١<br>٢</p>
<!-- /wp:paragraph -->"
`;
Expand All @@ -24,11 +24,7 @@ exports[`RTL should merge backward 1`] = `
exports[`RTL should merge forward 1`] = `
"<!-- wp:paragraph -->
<p>٠</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p></p>
<p>٠١</p>
<!-- /wp:paragraph -->"
`;
Expand Down
9 changes: 3 additions & 6 deletions packages/e2e-tests/specs/editor/various/rtl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ const ARABIC_TWO = '٢';
describe( 'RTL', () => {
beforeEach( async () => {
await createNewPost();
await page.evaluate( () => {
document.querySelector( '.is-root-container' ).dir = 'rtl';
} );
} );

it( 'should arrow navigate', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

// We need at least three characters as arrow navigation *from* the
Expand All @@ -36,7 +38,6 @@ describe( 'RTL', () => {
} );

it( 'should split', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

await page.keyboard.type( ARABIC_ZERO );
Expand All @@ -48,7 +49,6 @@ describe( 'RTL', () => {
} );

it( 'should merge backward', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

await page.keyboard.type( ARABIC_ZERO );
Expand All @@ -61,7 +61,6 @@ describe( 'RTL', () => {
} );

it( 'should merge forward', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

await page.keyboard.type( ARABIC_ZERO );
Expand All @@ -75,7 +74,6 @@ describe( 'RTL', () => {
} );

it( 'should arrow navigate between blocks', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

await page.keyboard.type( ARABIC_ZERO );
Expand All @@ -101,7 +99,6 @@ describe( 'RTL', () => {
} );

it( 'should navigate inline boundaries', async () => {
await page.evaluate( () => ( document.dir = 'rtl' ) );
await page.keyboard.press( 'Enter' );

// Wait for rich text editor to load.
Expand Down

0 comments on commit a45c00a

Please sign in to comment.