When writing unit tests with React Testing Library, we can access elements by their role with getByRole
.
For example, if the element is heading
, it has level
option:
const headingNode = screen.getByRole('heading', { level: 3 });
Or if it's radio
it has name
:
const radioNode = screen.getByRole('radio', { name: 'high'});
My question is, where can be found all the possible options for each type? Is there a documentation for this? Didn't find it.