diff --git a/README.md b/README.md index 3dbce070..92cf4833 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ From [testing-library/dom-testing-library#107](https://github.com/testing-library/dom-testing-library/issues/107): > [...] it is becoming apparent the need to express user actions on a web page -> using a higher-level abstraction than `fireEvent` +> using a higher-level abstraction than [`fireEvent`][fire-event] ## The solution @@ -62,6 +62,7 @@ change the state of the checkbox. - [`unhover(element)`](#unhoverelement) - [`paste(element, text, eventInit, options)`](#pasteelement-text-eventinit-options) - [`specialChars`](#specialchars) +- [Known limitations](#known-limitations) - [Issues](#issues) - [🐛 Bugs](#-bugs) - [💡 Feature Requests](#-feature-requests) @@ -75,13 +76,13 @@ change the state of the checkbox. With NPM: ```sh -npm install @testing-library/user-event @testing-library/dom --save-dev +npm install --save-dev @testing-library/user-event @testing-library/dom ``` With Yarn: ```sh -yarn add @testing-library/user-event @testing-library/dom --dev +yarn add --dev @testing-library/user-event @testing-library/dom ``` Now simply import it in your tests: @@ -97,8 +98,9 @@ const {default: userEvent} = require('@testing-library/user-event') ## API Note: All userEvent methods are synchronous with one exception: when `delay` -with `userEvent.type` as described below). We also discourage using `userEvent` -inside `before/after` blocks at all, for important reasons described in +option used with `userEvent.type` as described below. We also discourage using +`userEvent` inside `before/after` blocks at all, for important reasons described +in ["Avoid Nesting When You're Testing"](https://kentcdodds.com/blog/avoid-nesting-when-youre-testing). ### `click(element, eventInit, options)` @@ -244,7 +246,7 @@ test('delete characters within the selectedRange', () => { }) ``` -#### support +#### `` support The following is an example of usage of this library with `` @@ -340,8 +342,8 @@ userEvent.keyboard('?', {keyboardMap: myOwnLocaleKeyboardMap}) ### `upload(element, file, [{ clickInit, changeInit }], [options])` Uploads file to an ``. For uploading multiple files use `` with -`multiple` attribute and the second `upload` argument must be array then. Also -it's possible to initialize click or change event with using third argument. +the `multiple` attribute and the second `upload` argument as an array. It's also +possible to initialize a click or change event using a third argument. If `options.applyAccept` is set to `true` and there is an `accept` attribute on the element, files that don't match will be discarded. @@ -401,8 +403,8 @@ import userEvent from '@testing-library/user-event' test('clear', () => { render(