Skip to content

Commit 72c2243

Browse files
authored
fix(docs): fixing old links and adding new ones for quick access to references (#1508)
1 parent 9ae8c03 commit 72c2243

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ second argument. If you're using testing-library in a browser you almost always
9090
want to set this to `true`. Only very old browser don't support this property
9191
(such as IE 8 and earlier). However, `jsdom` does not support the second
9292
argument currently. This includes versions of `jsdom` prior to `16.4.0` and any
93-
version that logs a `not implemented` warning when calling `getComputedStyle`
93+
version that logs a `not implemented` warning when calling
94+
[`getComputedStyle`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle)
9495
with a second argument e.g.
9596
`window.getComputedStyle(document.createElement('div'), '::after')`. Defaults to
9697
`false`
9798

9899
### `defaultHidden`
99100

100-
The default value for the `hidden` option used by
101+
The default value for the [`hidden` option](queries/byrole#hidden) used by
101102
[`getByRole`](queries/byrole.mdx). Defaults to `false`.
102103

103104
### `defaultIgnore`
@@ -110,12 +111,12 @@ Defaults to `script, style`.
110111

111112
### `showOriginalStackTrace`
112113

113-
By default, `waitFor` will ensure that the stack trace for errors thrown by
114-
Testing Library is cleaned up and shortened so it's easier for you to identify
115-
the part of your code that resulted in the error (async stack traces are hard to
116-
debug). If you want to disable this, then set`showOriginalStackTrace` to
117-
`false`. You can also disable this for a specific call in the options you pass
118-
to `waitFor`.
114+
By default, [`waitFor`](api-async#waitfor) will ensure that the stack trace for
115+
errors thrown by Testing Library is cleaned up and shortened so it's easier for
116+
you to identify the part of your code that resulted in the error (async stack
117+
traces are hard to debug). If you want to disable this, then
118+
set`showOriginalStackTrace` to `false`. You can also disable this for a specific
119+
call in the options you pass to `waitFor`.
119120

120121
### `throwSuggestions` (experimental)
121122

@@ -132,8 +133,8 @@ screen.getByTestId('foo', {suggest: false}) // will not throw a suggestion
132133

133134
:::note
134135

135-
When this option is enabled, it may provide suggestions that lack an
136-
intuitive implementation. Typically this happens for
136+
When this option is enabled, it may provide suggestions that lack an intuitive
137+
implementation. Typically this happens for
137138
[roles which cannot be named](https://w3c.github.io/aria/#namefromprohibited),
138139
most notably paragraphs. For instance, if you attempt to use
139140
[`getByText`](queries/bytext.mdx), you may encounter the following error:
@@ -143,12 +144,13 @@ TestingLibraryElementError: A better query is available, try this:
143144
getByRole('paragraph')
144145
```
145146

146-
However, there is no direct way to query paragraphs using the config object parameter, such as in
147-
`getByRole('paragraph', { name: 'Hello World' })`.
147+
However, there is no direct way to query paragraphs using the config object
148+
parameter, such as in `getByRole('paragraph', { name: 'Hello World' })`.
148149

149150
To address this issue, you can leverage a custom function to validate the
150-
element's structure, as shown in the example below.
151-
More information can be found in the [GitHub issue](https://github.com/testing-library/dom-testing-library/issues/1306)
151+
element's structure, as shown in the example below. More information can be
152+
found in the
153+
[GitHub issue](https://github.com/testing-library/dom-testing-library/issues/1306)
152154

153155
```js
154156
getByRole('paragraph', {
@@ -171,5 +173,5 @@ message and container object as arguments.
171173

172174
### `asyncUtilTimeout`
173175

174-
The global timeout value in milliseconds used by `waitFor` utilities. Defaults
175-
to 1000ms.
176+
The global timeout value in milliseconds used by [`waitFor`](api-async#waitfor)
177+
utilities. Defaults to 1000ms.

docs/dom-testing-library/api-debugging.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ you'd like a solution that works for both, see
5757
## `prettyDOM`
5858

5959
Built on top of
60-
[`pretty-format`](https://github.com/facebook/jest/tree/master/packages/pretty-format),
60+
[`pretty-format`](https://github.com/jestjs/jest/tree/main/packages/pretty-format),
6161
this helper function can be used to print out readable representation of the DOM
6262
tree of a node. This can be helpful for instance when debugging tests.
6363

@@ -79,7 +79,7 @@ It receives the root node to print out, an optional extra parameter to limit the
7979
size of the resulting string, for cases when it becomes too large. It has a last
8080
parameter which allows you to configure your formatting. In addition to the
8181
options listed you can also pass the
82-
[options](https://github.com/facebook/jest/tree/master/packages/pretty-format#usage-with-options)
82+
[options](https://github.com/jestjs/jest/tree/main/packages/pretty-format#usage-with-options)
8383
of `pretty-format`.
8484

8585
By default, `<style />`, `<script />` and comment nodes are ignored. You can
@@ -101,7 +101,7 @@ console.log(prettyDOM(div))
101101
```
102102
103103
This function is what also powers
104-
[the automatic debugging output described above](#debugging).
104+
[the automatic debugging output described above](#automatic-logging).
105105
106106
## `screen.debug()`
107107

0 commit comments

Comments
 (0)