Skip to content

Conversation

@ramonjd
Copy link
Member

@ramonjd ramonjd commented Apr 12, 2022

What?

Unregister the block in the tearDown method. 🔨

See discussion: WordPress/wordpress-develop#2500 (comment)

Why?

The block will be unregistered even if the test fails. 😱

Testing Instructions

The PHP unit tests should pass. ✅

Hummus recipe

  • 250g chick peas
  • 2 tablespoons unhulled tahini
  • Juice of 1 lemon
  • 1 teaspoon of apple cider vinegar
  • 1/2 teaspoon miso paste
  • Pepper and salt to taste
  • 1/3 cup olive oil
  • Water to suit your viscosity preference
  • Small clove of garlic

Blend well. Eat with carrots.

@ramonjd ramonjd added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality labels Apr 12, 2022
@ramonjd ramonjd self-assigned this Apr 12, 2022
@ramonjd ramonjd changed the title Border supports: unregister block in PHP unit tests Block supports: unregister block in PHP unit tests Apr 12, 2022
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @ramonjd 👍

✅ Border tests pass
✅ Color tests pass
✅ Spacing tests pass
✅ Typography tests pass

Everything LGTM 🚢

I have one minor question. The registration of blocks is pretty verbose and is obviously repeated in every test. Would this be an opportunity to refactor that as well? That said, it can just as easily be another follow-up if desired.

There was something along these lines included in the updated border block support PR: #37770. That proposed refactor obviously doesn't include the fix that this PR addresses but did drastically cut down the overall size of the border tests file.

@ramonjd
Copy link
Member Author

ramonjd commented Apr 12, 2022

Thanks for the review @aaronrobertshaw

Would this be an opportunity to refactor that as well? That said, it can just as easily be another follow-up if desired.

For sure. This PR is just to get things to line up with WordPress/wordpress-develop#2569 for now, but I agree.

Thanks for the example from the border block PR. I'll make a note to improve things accordingly after this one lands.

@ramonjd ramonjd merged commit 4165501 into trunk Apr 12, 2022
@ramonjd ramonjd deleted the update/border-support-unit-test-unregister-block branch April 12, 2022 02:19
@github-actions github-actions bot added this to the Gutenberg 13.1 milestone Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants