-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
* Update changelog release date * Bundle 2.13.0
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test as base, expect } from '@playwright/test'; | ||
|
||
const test = base.extend( { | ||
page: async ( { page }, use ) => { | ||
// Assert no console errors/warnings | ||
const consoleIssues = []; | ||
page.on( 'console', ( msg ) => { | ||
if ( [ 'error', 'warning' ].includes( msg.type() ) ) { | ||
consoleIssues.push( `[${ msg.type() }] ${ msg.text() }` ); | ||
} | ||
} ); | ||
await use( page ); | ||
expect( consoleIssues ).toHaveLength( 0 ); | ||
}, | ||
} ); | ||
|
||
test.describe( 'Editor content', () => { | ||
test( 'should allow typing', async ( { page } ) => { | ||
await page.goto( '?path=/story/isolated-block-editor--default' ); | ||
const iframe = page.frameLocator( '#storybook-preview-iframe' ); | ||
const editorContent = iframe.locator( 'role=region[name="Editor content"]' ); | ||
await editorContent.locator( 'role=button[name=/^Add default/]' ).click(); | ||
await editorContent.locator( 'role=document' ).type( 'Hello' ); | ||
await expect( editorContent.locator( 'role=document' ) ).toHaveText( 'Hello' ); | ||
} ); | ||
|
||
test( 'should isolate content between editors', async ( { page } ) => { | ||
await page.goto( '?path=/story/isolated-block-editor--multiple-editors' ); | ||
const iframe = page.frameLocator( '#storybook-preview-iframe' ); | ||
const alice = iframe.locator( 'role=region[name="Editor content"]' ).nth( 0 ); | ||
const bob = iframe.locator( 'role=region[name="Editor content"]' ).nth( 1 ); | ||
await alice.locator( 'role=button[name=/^Add default/]' ).click(); | ||
await alice.locator( 'role=document' ).type( 'Hello' ); | ||
await bob.locator( 'role=button[name=/^Add default/]' ).click(); | ||
await bob.locator( 'role=document' ).type( 'World' ); | ||
|
||
await expect( alice.locator( 'role=document' ) ).toHaveText( 'Hello' ); | ||
await expect( bob.locator( 'role=document' ) ).toHaveText( 'World' ); | ||
} ); | ||
} ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.describe( 'Toolbar settings button', () => { | ||
test( 'should open and close popover', async ( { page } ) => { | ||
await page.goto( '/?path=/story/isolated-block-editor--toolbar-settings' ); | ||
const editor = page.frameLocator( '#storybook-preview-iframe' ); | ||
|
||
await editor.locator( 'role=button[name="Settings"]' ).click(); | ||
|
||
await expect( editor.locator( 'role=button[name="Document (selected)"]' ) ).toBeVisible(); | ||
await expect( editor.locator( 'role=button[name="Block"]' ) ).toBeVisible(); | ||
|
||
await editor.locator( 'role=button[name="Close settings"]' ).click(); | ||
|
||
await expect( editor.locator( 'role=button[name="Document (selected)"]' ) ).not.toBeVisible(); | ||
await expect( editor.locator( 'role=button[name="Block"]' ) ).not.toBeVisible(); | ||
} ); | ||
} ); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.