1 comment

[ 0.25 ms ] story [ 44.0 ms ] thread
I used React Testing Library for the first time and blogged about it for AG Grid.

I used more querySelector and querySelectorAll, than the Testing Library documentation suggests because when working with a 3rd Part component I don't have access to add data-testid attributes.

My previous experience with WebDriver helped because I was able to write CSS selectors fairly easily and add synchronisation code to handle the asynchronous nature of the grid rendering.

There are Github links in the post, but the code is here in case anyone wants to look at it: https://github.com/ag-grid/react-data-grid/tree/main/podcast...

I only have a few tests so I haven't really attempted to make the abstraction layers complete or very isolated, but if I added more automated execution code then I would refactor the abstraction layers into something more manageable.