vendredi 18 octobre 2019

e.target.parentNode.getAttribute("id") / e.targe.getAttribute("id") unit test jest enzyem

Does anyone have a jest/enzyme test example for event.target.getAttribute?

handleButtonsClicks=()=>{
if(e.target.parentNode.getAttribute("id")=== "id1") {} else if (e.target.getAttribute("id") === "id2")}
<Button id="id1" onClick={handleButtonsClicks}/>
<Button id="id2" onClick={handleButtonsClicks}/>

Thanks

Aucun commentaire:

Enregistrer un commentaire