mardi 16 février 2021

Conditional React rendering, unit test

I am new to testing and I dont know how to write unit test for conditional rendering.

I am taking from API Contract and checking if type of that contract is Dealer, or User and depending of that page is displayed

contract.type === 'Dealer' ? ( (render one page) ): contract.type === 'User' ? ( (render another page) )

How can I write unit test, that will be checking if right page is displaying, or with correct contract type etc? Thank you

Aucun commentaire:

Enregistrer un commentaire