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

Add regression test for spacer block breakage in themes without spacing.units support #37922

Closed
fullofcaffeine opened this issue Jan 12, 2022 · 0 comments · Fixed by #68913
Closed
Labels
[Package] E2E Tests /packages/e2e-tests [Type] Enhancement A suggestion for improvement.

Comments

@fullofcaffeine
Copy link
Member

fullofcaffeine commented Jan 12, 2022

What problem does this address?

Follow-up to: #37774

The core spacer block broke in themes on which the useSetting function returned false for the spacing.units settings. A regression test would make sure the same problem doesn't happen again in the future.

What is your proposed solution?

There are two approaches to testing this:

  1. An E2E test that changes to a theme, inserts the block on the editor, and makes sure it doesn't error;
  2. An unit test that stubs useSetting('spacing.units') to return false and makes sure the component renders without errors.

I tend to think the E2E is better as it reproduces what users saw and covers more ground, potentially, and doesn't require stubbing values, but I'm open to hearing your thoughts about it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants