Skip to content

Commit a412a30

Browse files
alexkrolickeps1lon
andauthored
accept change simulates => dispatches
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
1 parent 5166e5a commit a412a30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/user-event/intro.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ with any framework as long as there is a DOM.
2020

2121
## Differences from `fireEvent`
2222

23-
`fireEvent` simulates _browser events_, whereas `user-event` simulates full *interactions*, which may fire multiple events and do additional checks along the way.
23+
`fireEvent` dispatches _browser events_, whereas `user-event` simulates full *interactions*, which may fire multiple events and do additional checks along the way.
2424

2525
Testing Library's built-in [`fireEvent`](dom-testing-library/api-events.mdx#fireevent) is a lightweight wrapper around the browser's low-level `dispatchEvent` API, which allows developers to trigger any event on any element. This is often sufficient for testing simple behavior, e.g., checking that a click event triggers the right callback, but there are cases where the browser does more than just trigger one event for one interaction. For example, when a user types into a text box, the element is first focused, and then input events are fired as they type. `user-event` also adds visibility and interactability checks before triggering the flow, to simulate how a user wouldn't click an element they can't see, and the browser wouldn't let them type in a disabled text box.
2626

0 commit comments

Comments
 (0)