Skip to content
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

Ensure that the insertBlock command works properly in all cases. #128

Merged
merged 10 commits into from
Jul 8, 2024

Conversation

iamdharmesh
Copy link
Member

Description of the Change

This PR removes the expect check from the insert block command. Currently, after inserting a block, we check that there is one block in the editor. However, this fails in cases where we need to add more than one block or when the editor already has blocks present and we add another block. In such cases, the block count becomes more than one, and the tests eventually fail. This PR makes changes to remove the expect assertion and respond with the ID from the last block.

How to test the Change

Make sure the insertBlock command's E2E tests are passing.

Changelog Entry

Fixed - Ensure that the insertBlock command works properly in all cases.

Credits

Props @iamdharmesh

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@iamdharmesh iamdharmesh requested a review from a team as a code owner June 30, 2024 05:54
@iamdharmesh iamdharmesh requested review from faisal-alvi and removed request for a team June 30, 2024 05:54
@iamdharmesh iamdharmesh self-assigned this Jun 30, 2024
src/commands/wp-cli.ts Fixed Show fixed Hide fixed
@iamdharmesh iamdharmesh marked this pull request as draft June 30, 2024 09:29
@jeffpaul jeffpaul added this to the 0.4.0 milestone Jul 1, 2024
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@iamdharmesh I noticed the E2E failure on this PR for WP trunk. Should we look into it?

@iamdharmesh
Copy link
Member Author

Yes @faisal-alvi. That is due to changes in WP 6.6. I will check on it and fix it. That's why I converted PR to Draft to hold a review on PR.

Thanks.

@iamdharmesh iamdharmesh marked this pull request as ready for review July 5, 2024 10:21
@iamdharmesh
Copy link
Member Author

@faisal-alvi This is ready for review now.

@jeffpaul jeffpaul requested a review from faisal-alvi July 5, 2024 13:40
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@iamdharmesh Thanks for the work, LGTM!

@jeffpaul jeffpaul merged commit f22595a into develop Jul 8, 2024
14 checks passed
@jeffpaul jeffpaul deleted the fix/insert-blocks branch July 8, 2024 15:40
github-actions bot pushed a commit that referenced this pull request Jul 8, 2024
Ensure that the `insertBlock` command works properly in all cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants