Skip to content

Conversation

@mattstobbs
Copy link
Contributor

The examples in the docs currently use .toHaveAttribute('disabled'). However, jest-dom provides toBeDisabled(), which does the same thing but is more expressive and gives a better failure message.

The examples in the docs currently use `.toHaveAttribute('disabled')`. However, jest-dom provides `toBeDisabled()`, which does the same thing but is more expressive and gives a better failure message.
@MatanBobi
Copy link
Member

Hi @mattstobbs! Thanks for taking the time to doing this :)
Maybe we should also add a comment so people will know that this matcher is taken from jest-dom?

@mattstobbs
Copy link
Contributor Author

Hi @MatanBobi, thanks for the idea. I think the other function, toHaveTextContent, is also from jest-dom so I've added a comment for that as well. Let me know what you think! :)

@MatanBobi
Copy link
Member

Sorry it took me some time, thanks @mattstobbs!

@MatanBobi MatanBobi merged commit ca2e941 into testing-library:main May 23, 2021
@MatanBobi
Copy link
Member

@all-contributors please add @mattstobbs for docs :)

@allcontributors
Copy link
Contributor

@MatanBobi

I've put up a pull request to add @mattstobbs! 🎉

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

Successfully merging this pull request may close these issues.

2 participants