lundi 19 octobre 2020

Test nested methods in react using react testing library

for example we have a component like

 const handleOnChange = address => {
        setIsDelivery(false)
        const data = {
         ...deliveryLocation,
        address: address
        };
      setDeliveryLocation(data);
 };

how to write test for this if it in component that i want to test

enter image description here enter image description here

red: not tested green: pass test

Aucun commentaire:

Enregistrer un commentaire