Programmatically click on a button inside one of the cells in ag-grid

1k Views Asked by At

How can I simulate a click on a button rendered on the last column of the first row in Ag-Grid? I am able to get the first row using getDisplayedRowAtIndex(0). But have no clue how to proceed further

Any pointers?

** Trying to simulate a click using enzyme wrapper for testing purposes.

1

There are 1 best solutions below

0
On

I just add a unique id to my button then find it and simulate a click.

const component = mount(<bla..>);
component.find('button#id').simulate('click', {});