-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
test: Fix failing integration tests #59047
test: Fix failing integration tests #59047
Conversation
This existing warning was reworded.
Restore mock to its original implementation rather than resetting it to an empty function. It is not entirely clear why this test began failing after upgrading to React Native 0.73.
We already invoke `jest.mock()` for this module within the Jest environment setup file. We do so as _not_ mocking this module causes widespread failures in tests due to its relationship to native modules. So, in a way, it makes sense to globally mock it. For whatever reason, attempting to invoke `jest.mock()` twice for this module stopped working after upgrading to React Native 0.73. The mock function passed to the second invocation was ignored. This change now updates the existing mock instead.
The specific cause for this update was not determined, but seemingly the ref is no longer passed to the navigation `Stack.Screen` component. There is no reason to believe this is an issue at this time.
This was done to fix failing automated tests. The guard was originally added to prevent invoking the animation end callback, so this should be safe to change.
Without fake timers, the callbacks are never invoked as the animation never completes. This outcome started happening after upgrading to `[email protected]`.
Addresses an act warning during the test run that started after upgrading to React Native 0.73.
The navigation container test failed due to `act` warnings and broken mocked timers. Wrapping timer runs with `act` address the former. The latter is addressed by no longer relying upon "legacy" mock timers, simplifying the approach for advancing the timers for animations, and removing the global `requestAnimationFrame` override. All of these same actions were applied to the Reanimated library in a refactor: software-mansion/react-native-reanimated@99573c3
Align the implementation with the Reanimated version. It is worth noting the Reanimated utility is marked as deprecated.
Size Change: 0 B Total Size: 1.71 MB ℹ️ View Unchanged
|
@@ -63,7 +63,7 @@ const Draggable = ( { | |||
useAnimatedReaction( | |||
() => isDragging.value, | |||
( result, previous ) => { | |||
if ( result === previous || previous === null ) { | |||
if ( result === previous ) { |
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.
Noting that we need to manually test the drag-and-drop features to ensure this does not cause regressions.
Flaky tests detected in 370ce71. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7921137260
|
f590c13
to
cc15f18
Compare
The previous approach using `jest.isMockFunction` failed after upgrading to React Native 0.73. While it is not clear why it began failing, the new approach is sourced from the `@testing-library/react-native` source. https://github.com/callstack/react-native-testing-library/blob/a670b2d4c1fb4df5326a63cb2852f4d6e37756da/src/helpers/timers.ts#L24-L58
cc15f18
to
370ce71
Compare
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. |
1ac08b2
into
build/upgrade-to-react-native-0.73
What?
Fix failing integration tests.
Why?
Forwards #58475.
How?
Address various breakages from upgrading to React Native 0.73, along with other
dependency upgrades. Each commit in this PR explains the rationale for each change.
Testing Instructions
N/A, no user facing changes.
Testing Instructions for Keyboard
N/A, no user facing changes.
Screenshots or screencast
N/A, no user facing changes.