diff --git a/docs/dom-testing-library/api-queries.md b/docs/dom-testing-library/api-queries.md index dc8788079..977579ee6 100644 --- a/docs/dom-testing-library/api-queries.md +++ b/docs/dom-testing-library/api-queries.md @@ -605,6 +605,7 @@ getByRole( name?: TextMatch, normalizer?: NormalizerFn, selected?: boolean, + checked?: boolean, queryFallbacks?: boolean, }): HTMLElement ``` @@ -684,6 +685,29 @@ you can get the "Native"-tab by calling `getByRole('tab', { selected: true })`. To learn more about the selected state and which elements can have this state see [ARIA `aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected). +Certain roles can have a checked state. You can filter the returned elements by +their checked state by setting `checked: true` or `checked: false`. + +For example in + +```html +
+