Closed Blacktiger closed 4 years ago
Doing some jest debugging, even though the disabled attribute is not on the html, if I ask for .prop('disabled')
I get a true value.
I would need to see more code to be able to help. At it's simplest form, toBeDisabled
is just a wrapper around .prop('disabled')
see, https://github.com/FormidableLabs/enzyme-matchers/blob/master/packages/enzyme-matchers/src/assertions/toBeDisabled.js#L15
So if you have are getting true with the direct prop()
call, it must be an issue with your code. I'm going to close this issue because i'm 100% confident there is no bug in this library related to this. But happy to dive into this if you provide more code
@Blacktiger this is likely that you're misusing enzyme; specifically, you can't reuse found wrappers. You have to re-find from the root every time.
Ah, that's probably what's wrong. Thanks @ljharb!
Not sure why this is happening, but the button is definitely not disabled.