Skip to content

Commit

Permalink
Add e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jul 26, 2024
1 parent 804981e commit 4395b60
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,31 @@ test.describe( 'iframed block editor settings styles', () => {
// Expect a 2px border because theme styles are enabled.
await expect( defaultBlock ).toHaveCSS( 'border-width', '2px' );
} );

test( 'should set iframe html attributes based on locale through block editor settings', async ( {
editor,
page,
} ) => {
await page.evaluate( () => {
const settings = window.wp.data
.select( 'core/editor' )
.getEditorSettings();
window.wp.data.dispatch( 'core/editor' ).updateEditorSettings( {
...settings,
locale: {
site: {
lang: 'ar',
isRTL: true,
},
user: {
lang: 'en_US',
isRTL: false,
},
},
} );
} );
const htmlElement = editor.canvas.locator( 'css=html' );
await expect( htmlElement ).toHaveAttribute( 'lang', 'ar' );
await expect( htmlElement ).toHaveAttribute( 'dir', 'rtl' );
} );
} );

0 comments on commit 4395b60

Please sign in to comment.