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