@testing-library/user-event

  • Version 13.5.0
  • Published
  • 165 kB
  • 1 dependency
  • 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 specialChars

const specialChars: {
readonly arrowLeft: '{arrowleft}';
readonly arrowRight: '{arrowright}';
readonly arrowDown: '{arrowdown}';
readonly arrowUp: '{arrowup}';
readonly enter: '{enter}';
readonly escape: '{esc}';
readonly delete: '{del}';
readonly backspace: '{backspace}';
readonly home: '{home}';
readonly end: '{end}';
readonly selectAll: '{selectall}';
readonly space: '{space}';
readonly whitespace: ' ';
readonly pageUp: '{pageUp}';
readonly pageDown: '{pageDown}';
};
  • See Also

    • https://testing-library.com/docs/ecosystem-user-event#keyboardtext-options

    Deprecated

    This list of strings with special meaning is no longer necessary as we've introduced a standardized way to describe any keystroke for userEvent.

variable userEvent

const userEvent: {
click: typeof click;
dblClick: typeof dblClick;
type: typeof type;
clear: typeof clear;
tab: typeof tab;
hover: typeof hover;
unhover: typeof unhover;
upload: typeof upload;
selectOptions: (
args_0: Element,
args_1: string | string[] | HTMLElement | HTMLElement[],
args_2?: MouseEventInit | undefined,
args_3?: import('./utils').PointerOptions | undefined
) => void;
deselectOptions: (
args_0: Element,
args_1: string | string[] | HTMLElement | HTMLElement[],
args_2?: MouseEventInit | undefined,
args_3?: import('./utils').PointerOptions | undefined
) => void;
paste: typeof paste;
keyboard: typeof keyboard;
};

    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 keyCode

      keyCode?: number;
      • keyCode for legacy support

      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?

      Namespaces

      namespace @testing-library/dom/dist/helpers

      module '@testing-library/dom/dist/helpers' {}

        function getWindowFromNode

        getWindowFromNode: (node: Node) => Window;

          Package Files (4)

          Dependencies (1)

          Dev Dependencies (13)

          Peer Dependencies (1)

          Badge

          To add a badge like this onejsDocs.io badgeto 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
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>