Add Fantom integration tests for usePressability hook#55865
Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Closed
Add Fantom integration tests for usePressability hook#55865sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: Add Fantom integration tests for the `usePressability` hook that verify it integrates correctly with real component rendering and native event dispatch via the Fabric renderer. The existing Jest unit test (Pressability-test.js) tests the Pressability class in isolation by directly invoking handler methods with mock events. These new integration tests verify the hook works end-to-end when wired up to a real component using Fantom. Tests added: - onPress fires on click event - onPress does not fire when disabled is true - onPress fires after re-enabling (disabled true → false) - onFocus fires on focus event - onBlur fires on blur event - Config updates are picked up after re-render - Cleanup on unmount prevents stale callbacks Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D94943768
Collaborator
|
This pull request was successfully merged by Nick Wilson in fdd1f6e When will my fix make it into a release? | How to file a pick request? |
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: facebook#55865 Add Fantom integration tests for the `usePressability` hook that verify it integrates correctly with real component rendering and native event dispatch via the Fabric renderer. The existing Jest unit test (Pressability-test.js) tests the Pressability class in isolation by directly invoking handler methods with mock events. These new integration tests verify the hook works end-to-end when wired up to a real component using Fantom. Tests added: - onPress fires on click event - onPress does not fire when disabled is true - onPress fires after re-enabling (disabled true → false) - onFocus fires on focus event - onBlur fires on blur event - Config updates are picked up after re-render - Cleanup on unmount prevents stale callbacks Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D94943768 fbshipit-source-id: 7d6dcb12c6125f031c56ad42ff4fe04b9b633af5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add Fantom integration tests for the
usePressabilityhook that verify itintegrates correctly with real component rendering and native event dispatch
via the Fabric renderer.
The existing Jest unit test (Pressability-test.js) tests the Pressability
class in isolation by directly invoking handler methods with mock events.
These new integration tests verify the hook works end-to-end when wired up
to a real component using Fantom.
Tests added:
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D94943768