Testing Library

Testing Library

  • Docs
  • Recipes
  • Help
  • Blog

›Ecosystem

Getting Started

  • Introduction
  • Guiding Principles

Frameworks

    DOM Testing Library

    • Introduction
    • Install
    • Example
    • Setup
    • Queries
    • Firing Events
    • Async Utilities
    • Helpers
    • Configuration
    • FAQ
    • Cheatsheet

    React Testing Library

    • Introduction
    • Example
    • Setup
    • API
    • FAQ
    • Cheatsheet

    ReasonReact Testing Library

    • Introduction
    • Examples

    Native Testing Library

    • Intro
    • Example
    • Setup
    • API

    Vue Testing Library

    • Intro
    • Examples
    • Setup
    • API
  • Cypress Testing Library
  • Svelte Testing Library
  • Angular Testing Library
  • Puppeteer Testing Library
  • Testcafe Testing Library

Ecosystem

  • user-event
  • jest-dom
  • bs-jest-dom
  • jest-native
  • react-select-event
Edit

user-event

user-event is a companion library for React Testing Library that provides more advanced simulation of browser interactions than the built-in fireEvent method.

npm install --save-dev user-event
import React from 'react'
import { render } from '@testing-library/react'
import userEvent from 'user-event'

const { getByText } = test('click', () => {
  render(<textarea data-testid="email" />)
})

userEvent.type(getByTestId('email'), 'Hello, World!')
expect(getByTestId('email')).toHaveAttribute('value', 'Hello, World!')
  • user-event on GitHub
Last updated on 6/1/2019
← Testcafe Testing Libraryjest-dom →
Testing Library
Docs
Getting StartedExamplesAPIHelp
Community
BlogStack OverflowReactiflux on DiscordSpectrum
More
StarGitHubEdit Docs on GitHub
Copyright © 2018-2019 Kent C. Dodds and contributors