-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use button block appender on group block #14943
Changes from all commits
9c965e5
be263c3
926b2bf
473d62d
c5f27fa
443822c
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 |
---|---|---|
|
@@ -16,7 +16,6 @@ describe( 'Group', () => { | |
it( 'can be created using the block inserter', async () => { | ||
await searchForBlock( 'Group' ); | ||
await page.click( '.editor-block-list-item-group' ); | ||
await page.keyboard.type( 'Group block' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchSnapshot(); | ||
} ); | ||
|
@@ -25,7 +24,16 @@ describe( 'Group', () => { | |
await clickBlockAppender(); | ||
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. It wasn't introduced here, so not necessary to change, but I find that testing the block inserter and the slash inserter as distinct tasks is not something which should be done in tests for individual blocks, but rather specific to those inserter interactions. This could save us a fair amount of effort (and build runtime) to avoid running them for every combination of blocks. |
||
await page.keyboard.type( '/group' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( 'Group block' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchSnapshot(); | ||
} ); | ||
|
||
it( 'can have other blocks appended to it using the button appender', async () => { | ||
await searchForBlock( 'Group' ); | ||
await page.click( '.editor-block-list-item-group' ); | ||
await page.click( '.block-editor-button-block-appender' ); | ||
await page.click( '.editor-block-list-item-paragraph' ); | ||
await page.keyboard.type( 'Group Block with a Paragraph' ); | ||
|
||
expect( await getEditedPostContent() ).toMatchSnapshot(); | ||
} ); | ||
|
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 wouldn't mind to have seen this function be inlined.
Alternatively (separately), I would like to see as proposed in #14241 (comment) with
createElement
being used withrenderAppender
so this could be come: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.
Thanks for the review. I'll follow up with a PR that tries out
createElement
. The only concern I'd have is lack of consistency with other render props, but that would only be an issue ifrenderAppender
ever took arguments.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.
PR is here - #15259