Relative Content

Tag Archive for reactjsreact-testing-library

Testing onClick on sidebar item Received number of calls 0

I’m trying to make a call to the navigate function inside an item in my sidebar. In practice, the button is working normally, but when I test it, user.click isn’t working, what’s wrong in my test code? Note: ItemsContainer and Item are styled components.

Testing onClick on sidebar item Received number of calls 0

I’m trying to make a call to the navigate function inside an item in my sidebar. In practice, the button is working normally, but when I test it, user.click isn’t working, what’s wrong in my test code? Note: ItemsContainer and Item are styled components.

Testing onClick on sidebar item Received number of calls 0

I’m trying to make a call to the navigate function inside an item in my sidebar. In practice, the button is working normally, but when I test it, user.click isn’t working, what’s wrong in my test code? Note: ItemsContainer and Item are styled components.

React prevent default on link not working

I am trying to implement a link that will refresh the current page. I’m confused as to none of this is working to actually working as in it keeps going to the href destination.

I cant seem to be able to navigate to a page in my test

I really need to find a solution to this issue i am facing with my test. i should render my app and my route needs to be ‘/not-found’ page for this certain test. if i am not logged in (if i dont have a token) i need to be routed back to main ‘/’ and if i have a token it needs to show the ‘not-found’ page.
this is my test

testing for open Modal

My app has a button in navbar where when clicked opens a change password modal. I need to test this. I cant seem to be able to find the contents when i click the button in the test.
here is my Changepassword test.