diff --git a/docs/dom-testing-library/api-queries.md b/docs/dom-testing-library/api-queries.md index dbd00e469..fc0bb08f8 100644 --- a/docs/dom-testing-library/api-queries.md +++ b/docs/dom-testing-library/api-queries.md @@ -585,6 +585,7 @@ getByRole( hidden?: boolean = true, name?: TextMatch, normalizer?: NormalizerFn, + selected?: boolean, }): HTMLElement ``` @@ -637,7 +638,27 @@ case. For example in assertions about the `Open dialog`-button you would need to use `getAllByRole('button', { hidden: true })`. -The default value can [be configured](api-configuration#configuration). +The default value for `hidden` can [be configured](api-configuration#configuration). + +Certain roles can have a selected state. You can filter the +returned elements that by their selected state +by setting `selected: true` or `selected: false`. + +For example in + +```html +
+