Skip to content
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

How to simulate the Switch Component OnValueChange prop in react-native #607

Closed
symmetriccurve opened this issue Sep 24, 2016 · 2 comments
Closed

Comments

@symmetriccurve
Copy link

wrapper.find(Switch).at(0).simulate('onValueChange',true); expect(wrapper.state('switchStatus')).to.equal(true);

Fails the test.

@joemckie
Copy link

joemckie commented Oct 7, 2016

Just drop the "on" to find the event name, like so:

wrapper.find(Switch).at(0).simulate('valueChange')

@ljharb
Copy link
Member

ljharb commented Jul 6, 2018

You'd need a react native adapter to use enzyme with React Native.

Closing this in favor of #1436.

@ljharb ljharb closed this as completed Jul 6, 2018
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

No branches or pull requests

3 participants