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
Unable to test isFocused on TextInput #276
Comments
What happens if you |
|
Does |
If I use it in a regular component, it seems to work fine:
which logs |
Mhm, so the ref state is cleared after render I suppose. It's interesting that the this function is undefined, while blur is – likely an implementation detail, not sure how it's supposed to react though. Anyway, "focus" is something given by TextInput itself, so it's not something that you need to test (we assume it's tested by the framework). Unless, it controls some observable state of your component – then you should test what's observable, which you can do using query API. |
Ask your Question
I'm attempting to test the native methods of TextInput, but am unable to test
isFocused
orclear
, butfocus
andblur
work fine.My test file:
* blur
passes, but* isFocused
fails:package.json
has:Any ideas what's going on?
The text was updated successfully, but these errors were encountered: