Skip to content

Forward extra data to press event #828

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

Merged

Conversation

AugustinLF
Copy link
Collaborator

Summary

Currently the onPress callbacks are called with undefined. While I think there should probably be a default value being passed, let's at least align the API with scroll and changeText

Test plan

The added tests show exactly what changes, if you pass extra parameters to fireEvent.press, they'll be forwarded to the onPress callback.

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, I'm surprised this wasn't there. Thank you!

@thymikee thymikee merged commit 3735b0e into callstack:main Oct 15, 2021
@AugustinLF AugustinLF deleted the forward-event-to-fireEvent-press branch October 20, 2021 09:30
thymikee added a commit to AugustinLF/react-native-testing-library that referenced this pull request Nov 23, 2021
* origin/main: (24 commits)
  v8.0.0
  chore(deps): bump dns-packet from 1.3.1 to 1.3.4 in /website (callstack#742)
  chore(deps-dev): bump @babel/preset-flow from 7.13.13 to 7.14.5 (callstack#765)
  chore(deps-dev): bump typescript from 4.4.2 to 4.4.4 (callstack#845)
  chore(deps-dev): bump release-it from 14.6.1 to 14.11.6 (callstack#830)
  chore(deps-dev): bump @babel/plugin-proposal-class-properties (callstack#846)
  chore(deps-dev): bump @babel/cli from 7.13.16 to 7.15.7 (callstack#833)
  chore(deps-dev): bump @testing-library/jest-native from 3.4.3 to 4.0.2 (callstack#842)
  chore(deps): bump color-string from 1.5.3 to 1.6.0 in /website (callstack#844)
  chore(deps): bump prismjs from 1.23.0 to 1.25.0 in /website (callstack#843)
  Forward extra data to press event (callstack#828)
  chore(deps-dev): bump @babel/preset-react from 7.13.13 to 7.14.5 (callstack#839)
  chore(deps): bump url-parse from 1.5.1 to 1.5.3 in /website (callstack#813)
  chore(deps-dev): bump @types/react from 17.0.2 to 17.0.30 (callstack#838)
  chore(deps): bump postcss from 7.0.29 to 7.0.36 in /website (callstack#756)
  chore(deps): bump prismjs from 1.23.0 to 1.25.0 in /website (callstack#823)
  chore(deps): bump path-parse from 1.0.6 to 1.0.7 in /website (callstack#796)
  chore(deps): bump merge-deep from 3.0.2 to 3.0.3 in /website (callstack#754)
  chore(deps): bump ws from 6.2.1 to 6.2.2 in /website (callstack#752)
  chore(deps): bump path-parse from 1.0.6 to 1.0.7 (callstack#795)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants