Skip to content

Commit c4e45e3

Browse files
committed
docs: tweaks, add beta notice
1 parent a9717c7 commit c4e45e3

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

website/docs/UserEvent.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ title: User Event
99
- [Options](#options)
1010
- [`press()`](#press)
1111
- [`longPress()`](#longpress)
12+
- [Options](#options-1)
1213
- [`type()`](#type)
13-
- [Options:](#options-1)
14+
- [Options](#options-2)
1415
- [Sequence of events](#sequence-of-events)
1516

17+
:::caution
18+
User Event API is in beta stage.
19+
20+
This means that we intend for the public API signatures to remain stable,
21+
but we might introduce breaking behavioural changes, e.g. concerning ordering or timing of emitted events, without a major version update. Hopefully, well written
22+
test code should not rely on such specific details.
23+
:::
1624

1725
## `userEvent.setup`
1826

@@ -68,6 +76,9 @@ await user.longPress(element);
6876

6977
Simulates a long press user interaction. In React Native the `longPress` event is emitted when the press duration exceeds long press threshold (by default 500 ms). In other aspects this actions behaves similar to regular `press` action, e.g. by emitting `pressIn` and `pressOut` events. The press duration is customisable through the options. This should be useful if you use the `delayLongPress` prop. When using real timers this will take 500 ms so it is highly recommended to use that API with fake timers to prevent test taking a long time to run.
7078

79+
### Options
80+
- `duration` - duration of the press in miliseconds. Default value is 500 ms.
81+
7182
## `type()`
7283

7384
```ts
@@ -90,7 +101,7 @@ This helper simulates user focusing on `TextInput` element, typing `text` one ch
90101
91102
This function supports only host `TextInput` elements. Passing other element type will result in throwing error.
92103
93-
### Options:
104+
### Options
94105
- `skipPress` - if true, `pressIn` and `pressOut` events will not be triggered.
95106
- `submitEditing` - if true, `submitEditing` event will be triggered after typing the text.
96107
@@ -122,3 +133,4 @@ Leaving the element:
122133
- `blur`
123134
124135
The `submitEditing` event is skipped by default. It can sent by setting `submitEditing: true` option.
136+

0 commit comments

Comments
 (0)