You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/UserEvent.md
+14-2
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,18 @@ title: User Event
9
9
-[Options](#options)
10
10
-[`press()`](#press)
11
11
-[`longPress()`](#longpress)
12
+
-[Options](#options-1)
12
13
-[`type()`](#type)
13
-
-[Options:](#options-1)
14
+
-[Options](#options-2)
14
15
-[Sequence of events](#sequence-of-events)
15
16
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
+
:::
16
24
17
25
## `userEvent.setup`
18
26
@@ -68,6 +76,9 @@ await user.longPress(element);
68
76
69
77
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.
70
78
79
+
### Options
80
+
-`duration` - duration of the press in miliseconds. Default value is 500 ms.
81
+
71
82
## `type()`
72
83
73
84
```ts
@@ -90,7 +101,7 @@ This helper simulates user focusing on `TextInput` element, typing `text` one ch
90
101
91
102
This function supports only host `TextInput` elements. Passing other element type will result in throwing error.
92
103
93
-
### Options:
104
+
### Options
94
105
- `skipPress` - if true, `pressIn` and `pressOut` events will not be triggered.
95
106
- `submitEditing` - if true, `submitEditing` event will be triggered after typing the text.
96
107
@@ -122,3 +133,4 @@ Leaving the element:
122
133
- `blur`
123
134
124
135
The `submitEditing` event is skipped by default. It can sent by setting `submitEditing: true` option.
0 commit comments