Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

fireEvent or some other utility for RN specific events #78

Closed
ajsmth opened this issue Nov 7, 2019 · 1 comment
Closed

fireEvent or some other utility for RN specific events #78

ajsmth opened this issue Nov 7, 2019 · 1 comment

Comments

@ajsmth
Copy link
Contributor

ajsmth commented Nov 7, 2019

Describe the feature you'd like:

I want to be able to fire some RN specific events -- namely Linking and BackButton. In the past I've mocked these out with an imperative API similar to fireEvent, I thought it would make a nice addition to the library, as I'm not sure it's possible at the moment

Suggested implementation:

Something to the effect of fireEvent.backButton() and fireEvent.linkChanged('url') would be the desired end result

@bcarroll22
Copy link
Collaborator

Sorry I took a while to think about this... I'd be open to seeing a PR to implement some of these mocks, but I think we'd have to be really careful about which ones we make to be sure we're sticking to the guiding principles of testing library and not mocking things that enable testing implementation details.

If you'd like, you can open a RFC PR for the feature, I'd love to see it! Otherwise I'm going to go ahead and close this for housekeeping purposes, but note that if anyone wants to give this a try I'm open to it. I think the natural place to include it is in the jest preset.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants