From cc87b0cf1c75dfbb66d5766cde9afdbb74fb0149 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 30 Oct 2019 08:50:18 +0100 Subject: [PATCH] feat: Add docs for defaultHidden config --- docs/dom-testing-library/api-configuration.md | 7 +++++-- docs/dom-testing-library/api-queries.md | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/dom-testing-library/api-configuration.md b/docs/dom-testing-library/api-configuration.md index aeae58d25..e14bbd0d7 100644 --- a/docs/dom-testing-library/api-configuration.md +++ b/docs/dom-testing-library/api-configuration.md @@ -15,8 +15,11 @@ The library can be configured via the `configure` function, which accepts: Configuration options: -`testIdAttribute`: The attribute used by `getByTestId` and related queries. -Defaults to `data-testid`. See [`getByTestId`](#getbytestid). +`defaultHidden`: The default value for the `hidden` option used by +[`getByRole`](api-queries#byrole). Defaults to `false`. + +`testIdAttribute`: The attribute used by [`getByTestId`](api-queries#bytestid) +and related queries. Defaults to `data-testid`. diff --git a/docs/dom-testing-library/api-queries.md b/docs/dom-testing-library/api-queries.md index 1be322750..7bcdb71dd 100644 --- a/docs/dom-testing-library/api-queries.md +++ b/docs/dom-testing-library/api-queries.md @@ -533,7 +533,7 @@ getByRole( role: TextMatch, options?: { exact?: boolean = true, - hidden?: boolean = false, + hidden?: boolean = true, normalizer?: NormalizerFn, }): HTMLElement ``` @@ -569,6 +569,8 @@ 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). + ```html
...
```