Tests: Add unit tests for image rendering#66010
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in e4af6b6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11272056775
|
cbravobernal
left a comment
There was a problem hiding this comment.
LGTM, I guess these ones should be backported to Core.
|
I can see there are PHP unit tests for blocks in Core and in Gutenberg, but they don't seem to be replicated:
Is this something that should be replicated as well in core? |
That case let's keep them here. As is code related to blocks. |
- Add initial tests for image rendering Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org> Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
What?
In this pull request I'm adding a first suite of unit tests to ensure the image is rendered (or not rendered) appropriately. This can be use as a reference to add lightbox tests or other changes made in the PHP rendering in the future.
Why?
It will help cover different use cases, especially related to block bindings, and ensure changes won't break the user experience. For example this one.
How?
I added a new file in the blocks unit tests and followed the patterns there.
Testing Instructions
The new unit tests should pass.
I also checked that removing this conditional in the image rendering the tests fail.