diff --git a/docs/queries/byrole.mdx b/docs/queries/byrole.mdx index 265d741d1..488fde6b7 100644 --- a/docs/queries/byrole.mdx +++ b/docs/queries/byrole.mdx @@ -21,6 +21,7 @@ getByRole( name?: TextMatch, description?: TextMatch, selected?: boolean, + busy?: boolean, checked?: boolean, pressed?: boolean, suggest?: boolean, @@ -115,6 +116,27 @@ 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). +### `busy` + +You can filter the returned elements by their busy state by setting `busy: true` +or `busy: false`. + +For example in + +```html + +
+
Login failed
+
Error: Loading message...
+
+ +``` + +you can get the "Login failed" alert by calling +`getByRole('alert', { busy: false })`. To learn more about the busy state see +[ARIA `aria-busy`](https://www.w3.org/TR/wai-aria-1.2/#aria-busy) and +[MDN `aria-busy` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-busy). + ### `checked` You can filter the returned elements by their checked state by setting