Skip to content

Commit a18d41b

Browse files
jegtneseps1lon
andauthored
🔧 Fix broken links across several doc pages (testing-library#770)
Co-authored-by: eps1lon <[email protected]>
1 parent 3f5720e commit a18d41b

File tree

11 files changed

+41
-42
lines changed

11 files changed

+41
-42
lines changed

docs/marko-testing-library/api.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ few properties:
8383
### `...queries`
8484

8585
The most important feature of `render` is that the queries from
86-
[DOM Testing Library](queries/about.mdx) are automatically returned with their
87-
first argument bound to the results of rendering your component.
86+
[the Core API](queries/about.mdx) are automatically returned with their first
87+
argument bound to the results of rendering your component.
8888

89-
See [Queries](queries/about.mdx) for a complete list.
89+
See [Queries](queries/about.mdx#types-of-queries) for a complete list.
9090

9191
**Example**
9292

docs/preact-testing-library/api.mdx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ sidebar_label: API
1515
## `@testing-library/dom`
1616

1717
This library re-exports everything from the DOM Testing Library
18-
(`@testing-library/dom`). See the
19-
[documentation](dom-testing-library/api-queries.mdx) to see what goodies you can
20-
use.
18+
(`@testing-library/dom`). See the [documentation](queries/about.mdx) to see what
19+
goodies you can use.
2120

2221
## `render`
2322

@@ -33,21 +32,21 @@ const {results} = render(<YourComponent />, {options})
3332
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
3433
| `container` | The HTML element the component is mounted to. | baseElement |
3534
| `baseElement` | The root HTML element to which the container is appended to. | document.body |
36-
| `queries` | Queries to bind to the baseElement. See [getQueriesForElement](dom-testing-library/api-helpers.mdx#within-and-getqueriesforelement-apis). | null |
35+
| `queries` | Queries to bind to the baseElement. See [within](dom-testing-library/api-within.mdx). | null |
3736
| `hydrate` | Used when the component has already been mounted and requires a rerender. Not needed for most people. The rerender function passed back to you does this already. | false |
3837
| `wrapper` | A parent component to wrap YourComponent. | null |
3938

4039
### Results
4140

42-
| Result | Description |
43-
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44-
| `container` | The HTML element the component is mounted to. |
45-
| `baseElement` | The root HTML element to which the container is appended to. |
46-
| `debug` | Logs the baseElement using [prettyDom](dom-testing-library/api-helpers.mdx#prettydom). |
47-
| `unmount` | Unmounts the component from the container. |
48-
| `rerender` | Calls render again passing in the original arguments and sets hydrate to true. |
49-
| `asFragment` | Returns the innerHTML of the container. |
50-
| `...queries` | Returns all [query functions](dom-testing-library/api-queries.mdx) to be used on the baseElement. If you pass in `query` arguments than this will be those, otherwise all. |
41+
| Result | Description |
42+
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| `container` | The HTML element the component is mounted to. |
44+
| `baseElement` | The root HTML element to which the container is appended to. |
45+
| `debug` | Logs the baseElement using [prettyDom](dom-testing-library/api-debugging.mdx#prettydom). |
46+
| `unmount` | Unmounts the component from the container. |
47+
| `rerender` | Calls render again passing in the original arguments and sets hydrate to true. |
48+
| `asFragment` | Returns the innerHTML of the container. |
49+
| `...queries` | Returns all [query functions](queries/about.mdx) to be used on the baseElement. If you pass in `query` arguments than this will be those, otherwise all. |
5150

5251
## `cleanup`
5352

docs/preact-testing-library/learn.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ If you're still hungry for more at this point than checkout:
1515

1616
- The dom-testing-library:
1717
- [Introduction](intro.mdx)
18-
- [Queries](dom-testing-library/api-queries.mdx)
18+
- [Queries](queries/about.mdx)
1919
- [Firing Events](dom-testing-library/api-events.mdx)
2020
- [Async Utilities](dom-testing-library/api-async.mdx)
21-
- [Helpers](dom-testing-library/api-helpers.mdx)
21+
- [Helpers](dom-testing-library/api-custom-queries.mdx)
2222
- [FAQ](dom-testing-library/faq.mdx)
2323
- The react-testing-library:
2424
- [API](react-testing-library/api.mdx)

docs/react-testing-library/cheatsheet.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,18 @@ See [Events API](dom-testing-library/api-events.mdx)
130130

131131
## Other
132132

133-
See [Helpers API](dom-testing-library/api-helpers.mdx),
134-
[Config API](dom-testing-library/api-configuration.mdx)
133+
See [Querying Within Elements](dom-testing-library/api-within.mdx),
134+
[Config API](dom-testing-library/api-configuration.mdx),
135+
[Cleanup](react-testing-library/api.mdx#cleanup),
135136

136137
- **within** take a node and return an object with all the queries bound to the
137138
node (used to return the queries from `React Testing Library`'s render
138139
method): `within(node).getByText("hello")`
139140
- **configure** change global options:
140141
`configure({testIdAttribute: 'my-data-test-id'})`
141-
- **cleanup** clears the DOM ([use with `afterEach`](setup.mdx#cleanup) to reset
142-
DOM between tests)
142+
- **cleanup** clears the DOM
143+
([use with `afterEach`](react-testing-library/api.mdx#cleanup) to reset DOM
144+
between tests)
143145

144146
## Text Match Options
145147

docs/react-testing-library/faq.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ test has already finished. There are 2 approaches to resolve it:
208208

209209
1. Wait for the result of the operation in your test by using one of
210210
[the async utilities](dom-testing-library/api-async.mdx) like
211-
[waitFor](dom-testing-library/api-async.mdx#waitFor) or a
212-
[`find*` query](dom-testing-library/api-queries.mdx#findby). For example:
211+
[waitFor](dom-testing-library/api-async.mdx#waitfor) or a
212+
[`find*` query](queries/about.mdx#types-of-queries). For example:
213213
`const userAddress = await findByLabel(/address/i)`.
214214
2. Mocking out the asynchronous operation so that it doesn't trigger state
215215
updates.

docs/react-testing-library/migrate-from-enzyme.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ automatically cleans up the output for each test, so you don't need to call
199199

200200
The other thing that you might notice is `getByRole` which has `heading` as its
201201
value. `heading` is the accessible role of the `h1` element. You can learn more
202-
about them on [queries](queries/byrole.mdx) documentation page. One of the
202+
about them on the [queries](queries/byrole.mdx) documentation page. One of the
203203
things people quickly learn to love about Testing Library is how it encourages
204204
you to write more accessible applications (because if it's not accessible, then
205205
it's harder to test).
@@ -242,9 +242,8 @@ default `role` values and you don't need to set one for them, but some others
242242
like `<div>` do not have one. You could use different approaches to access the
243243
`<div>` element, but we recommend trying to access elements by their implicit
244244
`role` to make sure your component is accessible by people with disabilities and
245-
those who are using screen readers. This
246-
[section](dom-testing-library/api-queries.mdx#byrole) of the query page might
247-
help you to understand better.
245+
those who are using screen readers. This [section](queries/byrole.mdx) of the
246+
query page might help you to understand better.
248247

249248
> Keep in mind that a `<form>` must have a `name` attribute in order to have an
250249
> implicit `role` of `form` (as required by the specification).
@@ -258,7 +257,7 @@ it's not recommended for the reasons stated in this paragraph).
258257

259258
We made some handy query APIs which help you to access the component elements
260259
very efficiently, and you can see the
261-
[list of available queries](queries/about.mdx) in detail.
260+
[list of available queries](queries/about.mdx#types-of-queries) in detail.
262261

263262
Something else that people have a problem with is that they're not sure which
264263
query should they use, luckily we have a great page which explains

docs/svelte-testing-library/api.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ sidebar_label: API
1515
## `@testing-library/dom`
1616

1717
This library re-exports everything from the DOM Testing Library
18-
(`@testing-library/dom`). See the
19-
[documentation](dom-testing-library/api-queries.mdx) to see what goodies you can
20-
use.
18+
(`@testing-library/dom`). See the [documentation](queries/about.mdx) to see what
19+
goodies you can use.
2120

2221
📝 `fireEvent` is an `async` method when imported from
2322
`@testing-library/svelte`. This is because it calls [`tick`][svelte-tick] which
@@ -53,21 +52,21 @@ const {results} = render(YourComponent, {myProp: 'value'})
5352

5453
### Render Options
5554

56-
| Option | Description | Default |
57-
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
58-
| `container` | The HTML element the component is mounted into. | `document.body` |
59-
| `queries` | Queries to bind to the container. See [getQueriesForElement](dom-testing-library/api-helpers.mdx#within-and-getqueriesforelement-apis). | `null` |
55+
| Option | Description | Default |
56+
| ----------- | ----------------------------------------------------------------------------------- | --------------- |
57+
| `container` | The HTML element the component is mounted into. | `document.body` |
58+
| `queries` | Queries to bind to the container. See [within](dom-testing-library/api-within.mdx). | `null` |
6059

6160
### Results
6261

6362
| Result | Description |
6463
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
6564
| `container` | The HTML element the component is mounted into. |
6665
| `component` | The newly created Svelte component. Generally, this should only be used when testing exported functions, or when you're testing developer facing API's. Outside of said cases avoid using the component directly to build tests, instead of interacting with the rendered Svelte component, work with the DOM. Have a read of [Avoid the Test User](https://kentcdodds.com/blog/avoid-the-test-user) by Kent C. Dodds to understand the difference between the **end user** and **developer user**. |
67-
| `debug` | Logs the `container` using [prettyDom](dom-testing-library/api-helpers.mdx#prettydom). |
66+
| `debug` | Logs the `container` using [prettyDom](dom-testing-library/api-debugging.mdx/#prettydom). |
6867
| `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. |
6968
| `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. |
70-
| `...queries` | Returns all [query functions](dom-testing-library/api-queries.mdx) that are bound to the `container`. If you pass in `query` arguments than this will be those, otherwise all. |
69+
| `...queries` | Returns all [query functions](queries/about.mdx) that are bound to the `container`. If you pass in `query` arguments than this will be those, otherwise all. |
7170

7271
## `cleanup`
7372

docs/testcafe-testing-library/intro.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ find[All]By\* selectors that you can use in your tests.
3939

4040
`import { screen } from '@testing-library/testcafe'`
4141

42-
[See `DOM Testing Library` API for reference](dom-testing-library/api-queries.mdx)
42+
[See `Queries` for reference](queries/about.mdx)
4343

4444
> A note about queries in testcafe. Testcafe has
4545
> [built in waiting](https://devexpress.github.io/testcafe/documentation/test-api/built-in-waiting-mechanisms.html#wait-mechanism-for-selectors),

docs/vue-testing-library/api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ debug()
188188
```
189189

190190
This is a simple wrapper around `prettyDOM` which is also exposed and comes from
191-
[`DOM Testing Library`](https://github.com/testing-library/dom-testing-library/blob/master/README.md#prettydom).
191+
[`DOM Testing Library`](dom-testing-library/api-debugging.mdx/#prettydom).
192192

193193
#### `unmount()`
194194

docs/vue-testing-library/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ re-exports it.
3030
<details>
3131
<summary>What queries does Vue Testing Library provide?</summary>
3232

33-
All queries from DOM Testing Library. See [Queries](cheatsheet#queries) for full
33+
All queries from DOM Testing Library. See [Queries](queries/about.mdx) for full
3434
list.
3535

3636
</details>

0 commit comments

Comments
 (0)