<tbody data-testid="offers-list-tablebody">
{ offers.map((Offer) => (
<tr onClick={this.handleTermsAndConditionsBtnClick} style={{ cursor: "pointer" }} key={index}>
}
I tried in this way
const tableBody = list.find("[data-testid='offers-list-tablebody']");
const tableRow1 = tableBody.childAt(0);
const clickElement1 = (tableRow1.key());
expect(clickElement1.onclick).toBeTruthy();
expect(clickElement1).toHaveStyle("cursor: pointer");
The error is Property "onclick does not exist on type string" and it is hsowing value of index when tested. How to test this?