Skip to content

Commit cc87b0c

Browse files
committed
feat: Add docs for defaultHidden config
1 parent 0218ea7 commit cc87b0c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/dom-testing-library/api-configuration.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ The library can be configured via the `configure` function, which accepts:
1515

1616
Configuration options:
1717

18-
`testIdAttribute`: The attribute used by `getByTestId` and related queries.
19-
Defaults to `data-testid`. See [`getByTestId`](#getbytestid).
18+
`defaultHidden`: The default value for the `hidden` option used by
19+
[`getByRole`](api-queries#byrole). Defaults to `false`.
20+
21+
`testIdAttribute`: The attribute used by [`getByTestId`](api-queries#bytestid)
22+
and related queries. Defaults to `data-testid`.
2023

2124
<!--DOCUSAURUS_CODE_TABS-->
2225

docs/dom-testing-library/api-queries.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ getByRole(
533533
role: TextMatch,
534534
options?: {
535535
exact?: boolean = true,
536-
hidden?: boolean = false,
536+
hidden?: boolean = true,
537537
normalizer?: NormalizerFn,
538538
}): HTMLElement
539539
```
@@ -569,6 +569,8 @@ case. For example in
569569
assertions about the `Open dialog`-button you would need to use
570570
`getAllByRole('button', { hidden: true })`.
571571

572+
The default value can [be configured](api-configuration#configuration).
573+
572574
```html
573575
<div role="dialog">...</div>
574576
```

0 commit comments

Comments
 (0)