Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useShowBlockTools() {
const hasSelectedBlock = !! clientId && !! block;
const isEmptyDefaultBlock =
hasSelectedBlock &&
isUnmodifiedDefaultBlock( block ) &&
isUnmodifiedDefaultBlock( block, 'content' ) &&
getBlockMode( clientId ) !== 'html';
const _showEmptyBlockSideInserter =
clientId &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function useInsertionPoint( {
if (
! isAppender &&
selectedBlock &&
isUnmodifiedDefaultBlock( selectedBlock )
isUnmodifiedDefaultBlock( selectedBlock, 'content' )
) {
replaceBlocks(
selectedBlock.clientId,
Expand Down
6 changes: 1 addition & 5 deletions packages/block-library/src/cover/test/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ async function createAndSelectBlock() {
name: 'Black',
} )
);
await userEvent.click(
screen.getByRole( 'button', {
name: 'Select parent block: Cover',
} )
);
await selectBlock( 'Block: Cover' );
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, so this changes the state for when we're within a freshly inserted Cover block, too, where there's no block toolbar visible, but we now see the inserter:

image

That feels like an improvement to the default state of the Cover block to me 👍

}

describe( 'Cover block', () => {
Expand Down
36 changes: 15 additions & 21 deletions test/e2e/specs/editor/plugins/post-type-locking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ test.describe( 'Post-type locking', () => {
name: 'Empty block',
} )
.first()
.click();
.fill( 'p1' );
await editor.showBlockToolbar();

await expect(
page
Expand Down Expand Up @@ -166,18 +167,15 @@ test.describe( 'Post-type locking', () => {
).toBeHidden();
} );

test( 'should allow blocks to be moved', async ( { editor, page } ) => {
test( 'should allow blocks to be moved', async ( { editor } ) => {
await editor.canvas
.getByRole( 'document', {
name: 'Empty block',
} )
.first()
.click();
.fill( 'p1' );

await page
.getByRole( 'toolbar', { name: 'Block tools' } )
.getByRole( 'button', { name: 'Move up' } )
.click();
await editor.clickBlockToolbarButton( 'Move up' );

await expect.poll( editor.getBlocks ).toMatchObject( [
{
Expand Down Expand Up @@ -248,18 +246,15 @@ test.describe( 'Post-type locking', () => {
] );
} );

test( 'should allow blocks to be moved', async ( { editor, page } ) => {
test( 'should allow blocks to be moved', async ( { editor } ) => {
await editor.canvas
.getByRole( 'document', {
name: 'Empty block',
} )
.first()
.click();
.fill( 'p1' );

await page
.getByRole( 'toolbar', { name: 'Block tools' } )
.getByRole( 'button', { name: 'Move up' } )
.click();
await editor.clickBlockToolbarButton( 'Move up' );

await expect.poll( editor.getBlocks ).toMatchObject( [
{
Expand Down Expand Up @@ -304,18 +299,15 @@ test.describe( 'Post-type locking', () => {
] );
} );

test( 'should allow blocks to be moved', async ( { editor, page } ) => {
test( 'should allow blocks to be moved', async ( { editor } ) => {
await editor.canvas
.getByRole( 'document', {
name: 'Empty block',
} )
.last()
.click();
.fill( 'p1' );

await page
.getByRole( 'toolbar', { name: 'Block tools' } )
.getByRole( 'button', { name: 'Move up' } )
.click();
await editor.clickBlockToolbarButton( 'Move up' );

await expect.poll( editor.getBlocks ).toMatchObject( [
{
Expand Down Expand Up @@ -409,7 +401,8 @@ test.describe( 'Post-type locking', () => {
name: 'Empty block',
} )
.last()
.click();
.fill( 'p1' );
await editor.showBlockToolbar();

await expect(
page
Expand Down Expand Up @@ -453,7 +446,8 @@ test.describe( 'Post-type locking', () => {
name: 'Empty block',
} )
.last()
.click();
.fill( 'p1' );
await editor.showBlockToolbar();

await expect(
page
Expand Down
Loading