Skip to content

Commit bd4dcfb

Browse files
docs(user-event): append every link with .mdx for a better navigation (#1007)
1 parent ddf60f7 commit bd4dcfb

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

docs/user-event/api-clipboard.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Note that the
77
[Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard) is
88
usually not available outside of secure context.
99
To enable testing of workflows involving the clipboard,
10-
[`userEvent.setup()`](setup) replaces `window.navigator.clipboard` with a stub.
10+
[`userEvent.setup()`](setup.mdx) replaces `window.navigator.clipboard` with a stub.
1111

1212
## copy()
1313

@@ -17,7 +17,7 @@ copy(): Promise<DataTransfer|undefined>
1717

1818
Copy the current selection.
1919

20-
If [`writeToClipboard`](options#writetoclipboard) is `true`, this will also
20+
If [`writeToClipboard`](options.mdx#writetoclipboard) is `true`, this will also
2121
write the data to the `Clipboard`.
2222

2323
## cut()
@@ -28,7 +28,7 @@ cut(): Promise<DataTransfer|undefined>
2828

2929
Cut the current selection.
3030

31-
If [`writeToClipboard`](options#writetoclipboard) is `true`, this will also
31+
If [`writeToClipboard`](options.mdx#writetoclipboard) is `true`, this will also
3232
write the data to the `Clipboard`.
3333

3434
When performed in editable context, it removes the selected content from the

docs/user-event/api-convenience.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Convenience APIs
44
---
55

66
The following APIs are shortcuts for equivalent calls to the underlying
7-
[`pointer()`](pointer) and [`keyboard()`](keyboard) APIs.
7+
[`pointer()`](api-pointer.mdx) and [`keyboard()`](api-keyboard.mdx) APIs.
88

99
## Clicks
1010

@@ -18,7 +18,7 @@ click(element: Element): Promise<void>
1818
pointer([{target: element}, {keys: '[MouseLeft]', target: element}])
1919
```
2020

21-
The first action might be skipped per [`skipHover`](options#skiphover).
21+
The first action might be skipped per [`skipHover`](options.mdx#skiphover).
2222

2323
### dblClick()
2424

docs/user-event/api-keyboard.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ keyboard('{Shift>}A{/Shift}') // translates to: Shift(down), A, Shift(up)
7171
The mapping of `key` to `code` is performed by a
7272
[default key map](https://github.com/testing-library/user-event/blob/beta/src/keyboard/keyMap.ts)
7373
portraying a "default" US-keyboard. You can provide your own local keyboard
74-
mapping per [`keyboardMap`](options#keyboardmap) option.
74+
mapping per [`keyboardMap`](options.mdx#keyboardmap) option.
7575

7676
Currently the different `key` meanings of single keys are treated as different
7777
keys.
7878

7979
> Future versions might try to interpolate the modifiers needed to reach a
8080
> printable key on the keyboard. E.g. Automatically pressing `{Shift}` when
8181
> CapsLock is not active and `A` is referenced. If you don't wish this behavior,
82-
> you can deactivate the [`autoModify`](options#automodify) option to opt out
82+
> you can deactivate the [`autoModify`](options.mdx#automodify) option to opt out
8383
> of this non-breaking change.

docs/user-event/api-pointer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pointer('[MouseLeft>]') // press the left mouse button
5252
pointer('[/MouseLeft]') // release the left mouse button
5353
```
5454
55-
Which buttons are available depends on the [`pointerMap`](options#pointermap).
55+
Which buttons are available depends on the [`pointerMap`](options.mdx#pointermap).
5656
5757
### <a name="move" href="#"/>Moving a pointer
5858

docs/user-event/api-utility.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ test('deselectOptions', async () => {
9696
```
9797

9898
Note that this API triggers pointer events and is therefore subject to
99-
[pointerEventsCheck](options#pointereventscheck).
99+
[pointerEventsCheck](options.mdx#pointereventscheck).
100100

101101
## type()
102102

@@ -115,16 +115,16 @@ type(
115115

116116
Type into an input element.
117117

118-
> You should use [`keyboard()`](keyboard) if you want to just simulate pressing
118+
> You should use [`keyboard()`](api-keyboard.mdx) if you want to just simulate pressing
119119
> buttons on the keyboard.
120120
> You can use `type()` if you just want to conveniently insert some text into an
121121
> input field or textarea.
122122
123-
1. Unless [`skipClick`](options#skipclick) is `true`, click the element.
123+
1. Unless [`skipClick`](options.mdx#skipclick) is `true`, click the element.
124124
1. If `initialSelectionStart` is set, set the selection on the element. If
125125
`initialSelectionEnd` is not set, this results in a collapsed selection.
126-
1. Type the given `text` per [`keyboard()`](keyboard).
127-
1. Unless [`skipAutoClose`](options#skipautoclose) is `true`, release all
126+
1. Type the given `text` per [`keyboard()`](api-keyboard.mdx).
127+
1. Unless [`skipAutoClose`](options.mdx#skipautoclose) is `true`, release all
128128
pressed keys.
129129

130130
```jsx

docs/user-event/install.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ yarn add --dev @testing-library/user-event@^14.0.0-beta
2929
Note that `@testing-library/user-event` requires `@testing-library/dom`.
3030

3131
If you use one of the
32-
[framework wrappers](../dom-testing-library/install#wrappers), it is important
32+
[framework wrappers](../dom-testing-library/install.mdx#wrappers), it is important
3333
that `@testing-library/dom` is resolved to the same installation required by the
3434
framework wrapper of your choice.
3535
Usually this means that if you use one of the framework wrappers, you should not

docs/user-event/options.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: Options
44
---
55

66
The following options allow to adjust the behavior of `user-event` APIs.
7-
They can be applied per [`setup()`](setup).
7+
They can be applied per [`setup()`](setup.mdx).
88

99
### applyAccept
1010

11-
When using [`upload()`](utility#upload), automatically discard files that don't
11+
When using [`upload()`](api-utility.mdx#upload), automatically discard files that don't
1212
match an `accept` property if such property exists on the element.
1313

1414
`default`: `true`
@@ -41,7 +41,7 @@ This moves the next changes at least to the next macro task and allows other
4141
The document.
4242

4343
This defaults to the owner document of an element if an API is called
44-
[directly](setup#direct-api) with an element and without setup. Otherwise it
44+
[directly](setup.mdx#direct-api) with an element and without setup. Otherwise it
4545
falls back to the global document.
4646

4747
`default`: `element.ownerDocument ?? global.document`
@@ -90,22 +90,22 @@ This allows to plug in different pointer devices.
9090

9191
### skipAutoClose
9292

93-
[`type()`](utility#type) automatically releases any keys still pressed at the
93+
[`type()`](api-utility.mdx#type) automatically releases any keys still pressed at the
9494
end of the call.
9595
This option allows to opt out of this feature.
9696

9797
`default`: false
9898

9999
### skipClick
100100

101-
[`type()`](utility#type) implies a click on the element.
101+
[`type()`](api-utility.mdx#type) implies a click on the element.
102102
This option allows to opt out of this feature.
103103

104104
`default`: false
105105

106106
### skipHover
107107

108-
[`click()`](utility#click) implies moving the cursor to the target element
108+
[`click()`](api-utility.mdx#click) implies moving the cursor to the target element
109109
first.
110110
This options allows to opt out of this feature.
111111

@@ -114,8 +114,8 @@ This options allows to opt out of this feature.
114114
Write selected data to
115115
[Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard) when
116116
a `cut` or `copy` is triggered. The Clipboard API is usually not available to
117-
test code. Our [`setup()`](setup) replaces the `navigator.clipboard` property
117+
test code. Our [`setup()`](setup.mdx) replaces the `navigator.clipboard` property
118118
with a stub.
119119

120-
`default` when calling the APIs [directly](setup#direct-api): `false`
120+
`default` when calling the APIs [directly](setup.mdx#direct-api): `false`
121121
`default` when calling the APIs on an instance from `setup()`: `true`

docs/user-event/setup.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ setup(options?: Options): UserEvent
1919
```
2020

2121
The `userEvent.setup()` API applies these workarounds to the document and allows
22-
you to [configure](options) an "instance" of `user-event`.
22+
you to [configure](options.mdx) an "instance" of `user-event`.
2323
Methods on this instance share one input device state, e.g. which keys are
2424
pressed.
2525

@@ -39,7 +39,7 @@ instance that shares the same input device state.
3939
The [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard)
4040
is usually not available outside of secure context.
4141
To enable testing of workflows involving the clipboard,
42-
[`userEvent.setup()`](setup) replaces `window.navigator.clipboard` with a stub.
42+
[`userEvent.setup()`](setup.mdx) replaces `window.navigator.clipboard` with a stub.
4343

4444
## Direct APIs
4545

0 commit comments

Comments
 (0)