-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Disabled property not rendered correctly #517
Comments
After you call |
Still fails for me, no change in behaviour or output |
I think after the update, you'll need to re-find the button you want to check. |
Passes now. Thanks. Is this intended and/or good behaviour? As someone having used this lib for a few weeks only it was natural to me that when the component was actually rerendered (as the console output proves?) the wrapper would reflect this. |
The component doesn't re-render automatically when you set state, is all. Separately, once it's rerendered, previous references to wrapper children are invalid, and need to be refetched. There's been some discussion about setState automatically triggering update, but you'd still need to re-find the button. |
I would as mentioned find it natural for update to be triggered automatically. The need to re-find makes more sense, refreshing references when you remove old and add new components/data/something is an action you do all the time in a lot of languages/situations so that's not new or unreasonable. I do also realise that my understanding is limited and that I do not know all the consequences of auto-triggering update. There's probably good reasons for it not being default. |
I think #360 might be relevant, and should both help answer questions as well as be the right place to ask further :-) |
First of all I'm using chai-enzyme, but the nature of the error I'm experiencing suggests to me that the issue lies with the rendering and not the assertions.
Code:
Tests:
test output:
It seems to me like an error that
disabled={false}
in the react rendering code results indisabled=""
. In the browser DOM the state successfully changes and the button no longer has thedisabled
property at all. Also note that the class name has not changed from disabled either (should not be there), which is even harder for me to understand.The text was updated successfully, but these errors were encountered: