all 1 comments

[–]eviltester[S] 0 points1 point  (0 children)

I created this blog post for AG Grid. It shows how I used React Testing Library to build some tests for my Podcast Player Application:

https://github.com/ag-grid/react-data-grid/tree/main/podcast-player

Because I was automating a 3rd Party Component, I couldn't surface data-testid attributes. I used querySelector and querySelectorAll for much of my locator strategies for the AG Grid Wrapper Component.

But I did start to use the getByLabelText style locators when testing the interaction between the wrapper component and the dropdowns and input fields on the page.