-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Cover block edit media integration tests #30270
Conversation
12b0aaa
to
41ff8a1
Compare
Size Change: 0 B Total Size: 1.46 MB ℹ️ View Unchanged
|
aed977d
to
068baa1
Compare
Previously, running Jest unit tests outputted a React warning because the mock was overly simplified and could not accept the refs passed to it as it is a function component.
Add integration test for Cover block controls.
Simple render test of Cover edit.
Superseded by Cover edit tests.
Update component to only set state if it is still "mounted."
These tests pass, but output errors in the test log due to an open issue in RNTL. https://git.io/JYYGE
Avoid erroneously removing an a11y label.
8c9e976
to
f69c374
Compare
Awesome to see this evaluated! ❤️ And looking at the "Unit Tests / Mobile (pull request)" CI job, the execution of the test is quite speedy, most of the tests taking less than a second! 🎉 Any idea perhaps why the |
@hypest from my initial testing, it would appear to be related to the cache generated for the test suite and not the specific test itself. So, it is merely a penalty the first test in a given suite pays. I'm unsure if there is a way to improve it, but I can spend a little time investigating. No Media FirstNo Media SkippedNo Media Last |
I explored the longer test run a little more. There doesn't appear to be one aspect of the rendered tree that causes the test to take longer. The biggest offender appears to the the |
@geriux would you be willing to review the approach for these Cover block edit tests? There are few changes to the components themselves. The ones of note might be the string change in |
Of course! will do 👍 |
…-block-integration-tests
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.
Thanks for adding this @dcalhoun!
I guess we'll have to keep an eye on the async issue for the tests that are being skipped now.
I don't know if you saw this but there's a warning for this Cover test:
console.warn
Non-serializable values were found in the navigation state. Check:
FocalPoint > params.onFocalPointChange (Function)
This can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc.
@geriux yeah, unfortunately I believe that is the best path forward currently. The workarounds in the thread are fairly heavy handed (e.g. undoing a global
Yes, I was aware of this. It has actually been present and shows up at runtime since I merged #25810. The warning is also present for the Overlay Color nested bottom sheet for Cover blocks, which is why I chose to not address it at the time. Admittedly, it's a broken window of sorts. I am happy to repair it and have placed it on my todo list. Would you like me to repair the warning prior to merging this work or open up a follow up PR instead? |
I was about to reply after I tested the app and saw the warning was already there 😅 I think we can merge this and open a ticket to track that, what do you think? |
Yeah I saw those and I feel like we should just wait for an actual fix 👍 so having them as |
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! 🚀
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.
Really cool project @dcalhoun 👍 Nicely done. Code looks good to me as well.
Description
Add integration tests for the Cover block edit bottom sheet in the native editor. Specifically for the media settings. Sibling to #30306.
@testing-library/react-native
to improve ability to test user-facing interface of components and align with web project guidelines of favoring RTL.TextInput
inRangeTextInput
.Future Test Coverage Opportunities
Svg
.)BottomSheet.Cell
.)PanResponder
may be complex.)How has this been tested?
npm run test-unit:native
Screenshots
n/a
Types of changes
Automated tests
Checklist: