-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Column Block: enable global template_lock inheritance #42677
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,22 +119,22 @@ describe( 'cpt locking', () => { | |
); | ||
} ); | ||
|
||
it( 'can use the global inserter in inner blocks', async () => { | ||
it( 'should not allow blocks to be inserted in inner blocks', async () => { | ||
await page.click( 'button[aria-label="Two columns; equal split"]' ); | ||
await page.click( | ||
'.wp-block-column .block-editor-button-block-appender' | ||
); | ||
await page.type( '.block-editor-inserter__search input', 'image' ); | ||
await pressKeyTimes( 'Tab', 2 ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.click( '.edit-post-header-toolbar__inserter-toggle' ); | ||
await page.type( | ||
'.block-editor-inserter__search input', | ||
'gallery' | ||
); | ||
await pressKeyTimes( 'Tab', 2 ); | ||
await page.keyboard.press( 'Enter' ); | ||
expect( await page.$( '.wp-block-gallery' ) ).not.toBeNull(); | ||
expect( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test expects that the inserter in the column block is not available. |
||
await page.$( | ||
'.wp-block-column .block-editor-button-block-appender' | ||
) | ||
).toBeNull(); | ||
|
||
expect( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added a test to confirm that the global inserter is also disabled. This code is the same as what we do in it( 'should not allow blocks to be inserted in inner blocks', async () => {
await page.click( 'button[aria-label="Two columns; equal split"]' );
expect(
await page.$(
'.wp-block-column .block-editor-button-block-appender'
)
).toBeNull();
// Hard to know if we are actually testing or trying to perform some action.
shouldDisableTheInserter();
} ); |
||
await page.evaluate( () => { | ||
const inserter = document.querySelector( | ||
'.edit-post-header [aria-label="Add block"], .edit-post-header [aria-label="Toggle block inserter"]' | ||
); | ||
return inserter.getAttribute( 'disabled' ); | ||
} ) | ||
).not.toBeNull(); | ||
} ); | ||
} ); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name of this test is more easier to understand.