Reputation: 5020
I know that we can test the component label test using the React Testing Library. But from my curiosity, I want to know that is there any way to do an end-to-end test on the react components using this library.
I'll be grateful if I get some nice information on it.
Upvotes: 5
Views: 6350
Reputation: 2452
There's an example of using React Router within the RTL docs: https://testing-library.com/docs/example-react-router/ so it looks like it's possible. However, I'd recommend using a dedicated e2e testing library such as Cypress to do the job. There is an RTL integration for Cypress so you can follow the same testing principles that RTL advocates.
Upvotes: 6