Closed Victorien-Tardif closed 6 years ago
This thread explains how to disabled to <TouchableOpacity />
https://stackoverflow.com/questions/33407665/disabling-buttons-on-react-native
and you can use wrapper.find('TouchableOpacity').props().disabled
Ok thanks, I wondered if there was a way to test if the button is actually disabled and not only if it has the prop disabled but I guess this is not my job but React-Native job to test that :) As long as the <TouchableOpacity />
has prop disabled I think I can be confident with the fact it is disabled :)
I'd like to test if my
<TouchableOpacity />
is actually disabled but I don't know how. I'm aware of how to test props but in case of a "disabled" prop, I don't really want to test if the prop is passed but if the button is actually disabled.How could I do that?
With a React component I would do
but I can't find a way to test a react-native component.
Thanks!