Skip to content

Add Fantom integration tests for usePressability hook#55865

Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D94943768
Closed

Add Fantom integration tests for usePressability hook#55865
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D94943768

Conversation

@sammy-SC
Copy link
Copy Markdown
Contributor

@sammy-SC sammy-SC commented Mar 3, 2026

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

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
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 3, 2026

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94943768.

@react-native-bot
Copy link
Copy Markdown
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?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 3, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants