Skip to content

Tests: Add unit tests for image rendering#66010

Merged
SantosGuillamot merged 1 commit into
trunkfrom
test/add-unit-tests-for-image-rendering
Oct 15, 2024
Merged

Tests: Add unit tests for image rendering#66010
SantosGuillamot merged 1 commit into
trunkfrom
test/add-unit-tests-for-image-rendering

Conversation

@SantosGuillamot
Copy link
Copy Markdown
Contributor

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.

@SantosGuillamot SantosGuillamot added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Block] Image Affects the Image Block labels Oct 10, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 10, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org>
Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Flaky tests detected in e4af6b6.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11272056775
📝 Reported issues:

@cbravobernal cbravobernal added the Needs PHP backport Needs PHP backport to Core label Oct 14, 2024
Copy link
Copy Markdown
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

LGTM, I guess these ones should be backported to Core.

@SantosGuillamot
Copy link
Copy Markdown
Contributor Author

I can see there are PHP unit tests for blocks in Core and in Gutenberg, but they don't seem to be replicated:

  • Core.
  • Gutenberg.
    From what I saw, the Gutenberg ones receive more updates and, as the code related to blocks lives in Gutenberg, I assume that was the proper place.

Is this something that should be replicated as well in core?

@SantosGuillamot SantosGuillamot merged commit 9262906 into trunk Oct 15, 2024
@SantosGuillamot SantosGuillamot deleted the test/add-unit-tests-for-image-rendering branch October 15, 2024 08:27
@github-actions github-actions Bot added this to the Gutenberg 19.5 milestone Oct 15, 2024
@cbravobernal
Copy link
Copy Markdown
Contributor

Is this something that should be replicated as well in core?

That case let's keep them here. As is code related to blocks.

karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
- Add initial tests for image rendering

Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org>
Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Image Affects the Image Block Needs PHP backport Needs PHP backport to Core [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants