jeudi 11 juin 2020

I Want to test condition on button click using jest and enzyme

clicked=(e)=>{
    if(this.props.ButtonHandler && typeof this.props.ButtonHandler === 'function'){
        this.props.ButtonHandler(e);
    }

}
render(){
    return(
        <>
          <button className={"button "+this.props.className} style={this.props.style} onClick={this.clicked} >
              {this.props.children}
          </button>
        </>
    )
}

**I Want to test condition on button click using jest and enzyme **

Aucun commentaire:

Enregistrer un commentaire