diff --git a/docs/dom-testing-library/api-events.mdx b/docs/dom-testing-library/api-events.mdx index 8801f9c24..62578151d 100644 --- a/docs/dom-testing-library/api-events.mdx +++ b/docs/dom-testing-library/api-events.mdx @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem' > > Most projects have a few use cases for `fireEvent`, but the majority of the > time you should probably use -> [`@testing-library/user-event`](ecosystem-user-event.mdx). +> [`@testing-library/user-event`](user-event/intro.mdx). ## `fireEvent` diff --git a/docs/dom-testing-library/install.mdx b/docs/dom-testing-library/install.mdx index 781517aa9..a39c42cf5 100644 --- a/docs/dom-testing-library/install.mdx +++ b/docs/dom-testing-library/install.mdx @@ -33,7 +33,7 @@ install the wrapper: `DOM Testing Library` works well with these companion libraries: -- [user-event](ecosystem-user-event.mdx) browser event simulation +- [user-event](user-event/intro.mdx) browser event simulation - [jest-dom](ecosystem-jest-dom.mdx) custom Jest matchers - [bs-jest-dom](ecosystem-bs-jest-dom.mdx) companion library for `bs-react-testing-library` diff --git a/docs/ecosystem-user-event.mdx b/docs/ecosystem-user-event.mdx index 2446b8336..44d84a48c 100644 --- a/docs/ecosystem-user-event.mdx +++ b/docs/ecosystem-user-event.mdx @@ -10,9 +10,14 @@ import TabItem from '@theme/TabItem' advanced simulation of browser interactions than the built-in [`fireEvent`](dom-testing-library/api-events.mdx#fireevent) method. -> This page describes `user-event@13.5.0`. -If you are starting or actively working on a project, -we recommend to use [`user-event@14.0.0-beta`](user-event/intro.mdx) instead, as it includes important bug fixes and new features. +:::caution End of life + +This page describes `user-event@13.5.0`. +This version is no longer maintained. Please use +[`user-event@14`](user-event/intro.mdx) instead, as it includes important bug +fixes and new features. + +::: ## Installation @@ -222,7 +227,7 @@ import {render, screen} from '@testing-library/react' import userEvent from '@testing-library/user-event' test('prepend text', () => { - render() + render() const element = screen.getByRole('textbox') // Prepend text diff --git a/docs/example-findByText.md b/docs/example-findByText.md index bb62c789f..f2b02b2d6 100644 --- a/docs/example-findByText.md +++ b/docs/example-findByText.md @@ -8,13 +8,14 @@ title: Using findByText // This is an example of how to use findByText to query for text that // is not visible right away -import {getByRole, findByText, getByPlaceholderText} from '@testing-library/dom' +import {screen} from '@testing-library/dom' import userEvent from '@testing-library/user-event' // provides a set of custom jest matchers that you can use to extend jest // i.e. `.toBeVisible` import '@testing-library/jest-dom' -const renderContent = el => { +function renderApp() { + const el = document.body.appendChild(document.createElement('div')) el.innerHTML = `