REact Testing #3
Testing providers
1) using material ui to cteate dark theme palette
2) using theme provider from mui -> we can use any provoder
Wrapped app provider
Create a componet and imported it to app.jsx
Dark mode
if light colors are inverted
Howverr we are gettimg an error as indvidula mui componet doenst has wrapper component
So to fix this what rtl does it provides a warpper object. so it will wrap before rendering of muimode
However, we want to get appprovider for every component so we need to add wrapper to all component so to fix this.,,
Custom Render function
https://testing-library.com/docs/react-testing-library/setup/
Now import it from test-utils
our test passes
hh
Comments
Post a Comment