@testing-library/user-event
- Version 14.4.3
- Published
- 420 kB
- No dependencies
- MIT license
Install
npm i @testing-library/user-event
yarn add @testing-library/user-event
pnpm add @testing-library/user-event
Overview
Fire events the same way the user does
Index
Variables
variable userEvent
const userEvent: { readonly setup: typeof setupMain; readonly clear: typeof directApi.clear; readonly click: typeof directApi.click; readonly copy: typeof directApi.copy; readonly cut: typeof directApi.cut; readonly dblClick: typeof directApi.dblClick; readonly deselectOptions: typeof directApi.deselectOptions; readonly hover: typeof directApi.hover; readonly keyboard: typeof directApi.keyboard; readonly pointer: typeof directApi.pointer; readonly paste: typeof directApi.paste; readonly selectOptions: typeof directApi.selectOptions; readonly tripleClick: typeof directApi.tripleClick; readonly type: typeof directApi.type; readonly unhover: typeof directApi.unhover; readonly upload: typeof directApi.upload; readonly tab: typeof directApi.tab;};
Interfaces
interface keyboardKey
interface keyboardKey {}
property altGr
altGr?: boolean;
Does the character in
key
require/imply AltRight to be pressed?
property code
code?: string;
Physical location on a keyboard
property key
key?: string;
Character or functional key descriptor
property location
location?: DOM_KEY_LOCATION;
Location on the keyboard for keys with multiple representation
property shift
shift?: boolean;
Does the character in
key
require/imply a shiftKey to be pressed?
interface pointerKey
interface pointerKey {}
property button
button?: MouseButton;
Type of button
property name
name: string;
Name of the pointer key
property pointerType
pointerType: 'mouse' | 'pen' | 'touch';
Type of the pointer device
Enums
enum PointerEventsCheckLevel
enum PointerEventsCheckLevel { EachTrigger = 4, EachApiCall = 2, EachTarget = 1, Never = 0,}
member EachApiCall
EachApiCall = 2
Check each target once per call to pointer (related) API
member EachTarget
EachTarget = 1
Check each event target once
member EachTrigger
EachTrigger = 4
Check pointer events on every user interaction that triggers a bunch of events. E.g. once for releasing a mouse button even though this triggers
pointerup
,mouseup
,click
, etc...
member Never
Never = 0
No pointer events check
Package Files (5)
Dependencies (0)
No dependencies.
Dev Dependencies (20)
- @ph.fritsche/scripts-config
- @testing-library/dom
- @testing-library/jest-dom
- @testing-library/react
- @types/jest-in-case
- @types/react
- eslint-import-resolver-typescript
- eslint-plugin-local-rules
- is-ci
- jest-in-case
- jest-serializer-ansi
- kcd-scripts
- react
- react-dom
- react17
- reactDom17
- reactIs17
- reactTesting17
- shared-scripts
- typescript
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@testing-library/user-event
.
- Markdown[](https://www.jsdocs.io/package/@testing-library/user-event)
- HTML<a href="https://www.jsdocs.io/package/@testing-library/user-event"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3050 ms. - Missing or incorrect documentation? Open an issue for this package.