Writing Jest Enzyme Test Case

Viewed 18

I need to write a test case

for example I have a component wrapped under Fragment which is calling another Button

<Fragment>
          <CancelButton
            onClick={this.cancelCalled}
            userName={this.state.userName}
          />
 </Fragment>

were cancelCalled is a normal function cancelCalled { //doing something } I need to cover the onclick functionality so how can I do so, help we be really appreciated

0 Answers
Related