-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[RNMobile] Add block transforms integration tests for Media blocks #48825
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
[RNMobile] Add block transforms integration tests for Media blocks #48825
Conversation
test/native/setup.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to mock react-native-video as it's the library used to render the video player in the Video block.
test/native/__mocks__/styleMock.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style is used by the Media & Text block in:
| styles.mediaAreaPadding.width |
|
Size Change: 0 B Total Size: 1.34 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 6d1997c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4373452450
|
277f367 to
3e6a14a
Compare
f80ab91 to
344a14b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me, nice work! I was able to successfully test the manual transforms from the app.
I did want to note one thing, however -- when testing the transform options on the Media & Text block on mobile, I noted that "Video" is present as a transform option, which also matches the web behavior. However, in the dropdown list of block transforms for manual testing and in the Media & Text transforms snapshot, the Video block is not present.
Perhaps the Video block is just missing as a test case transform option here for Media & Text, and the web and mobile behavior is correct? I just wanted to check in case the Video block should not be present as a transform option for the Media & Text block.
Good catch @derekblank. I overlooked the case where the Media & Text block has a video, in that case, it can be transformed into a Video block instead of an Image block. I'll update the test case and integration test, thanks! |
|
@derekblank I've just noticed that, when separating the integration tests into PRs, I forgot to include tests for the Cover block. I'll include it in this PR, sorry for the inconvenience 🙇 . |
|
Test cases for Media & Text and Cover blocks have been added in: @derekblank let me know if you could take a quick look, thanks for the help 🙇 ! |
derekblank
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! After the updates, I was able to test all transforms successfully. Thanks for adding these tests. 🚀
72ba1f6 to
6d1997c
Compare

What?
Add integration tests to cover the block transform functionality of Media blocks.
Why?
This PR is a follow-up of #48792 to cover with tests the block transform functionality.
How?
Integration tests have been added to the following Media blocks:
Testing Instructions
Unit tests pass
Unit Tests / Mobilejob pass.Manual test
Follow the change introduced in #48792 that enables more block transforms, it would be great to test the transformations manually to confirm that work as expected.
NOTE: The web version usually displays more options because it supports more blocks. We should only check the supported blocks in the native version.
Here you can check the potential block transformations for the blocks
Image
Video
Media & Text
Gallery
Cover
File
Audio
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A