@testing-library/user-event 14.0.0-alpha.5 → 14.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/click.d.ts CHANGED
@@ -6,3 +6,4 @@ export declare interface clickOptions {
6
6
  }
7
7
  export declare function click(this: UserEvent, element: Element, init?: MouseEventInit, { skipHover, skipPointerEventsCheck, }?: clickOptions & PointerOptions): void;
8
8
  export declare function dblClick(this: UserEvent, element: Element, init?: MouseEventInit, { skipPointerEventsCheck }?: clickOptions & PointerOptions): void;
9
+ export declare function tripleClick(this: UserEvent, element: Element, init?: MouseEventInit, { skipPointerEventsCheck }?: clickOptions & PointerOptions): void;
package/dist/click.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.click = click;
7
7
  exports.dblClick = dblClick;
8
+ exports.tripleClick = tripleClick;
8
9
 
9
10
  var _utils = require("./utils");
10
11
 
@@ -42,4 +43,20 @@ function dblClick(element, init, {
42
43
  keys: '[MouseLeft][MouseLeft]',
43
44
  target: element
44
45
  });
46
+ }
47
+
48
+ function tripleClick(element, init, {
49
+ skipPointerEventsCheck = false
50
+ } = {}) {
51
+ if (!skipPointerEventsCheck && !(0, _utils.hasPointerEvents)(element)) {
52
+ throw new Error('unable to triple-click element as it has or inherits pointer-events set to "none".');
53
+ }
54
+
55
+ this.hover(element, init, {
56
+ skipPointerEventsCheck: true
57
+ });
58
+ this.pointer({
59
+ keys: '[MouseLeft][MouseLeft][MouseLeft]',
60
+ target: element
61
+ });
45
62
  }
package/dist/setup.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { clear } from './clear';
2
- import { click, clickOptions, dblClick } from './click';
2
+ import { click, clickOptions, dblClick, tripleClick } from './click';
3
3
  import { hover, unhover } from './hover';
4
4
  import { keyboard, keyboardOptions } from './keyboard';
5
5
  import type { keyboardState } from './keyboard/types';
@@ -22,6 +22,7 @@ export declare const userEventApis: {
22
22
  pointer: typeof pointer;
23
23
  selectOptions: typeof selectOptions;
24
24
  tab: typeof tab;
25
+ tripleClick: typeof tripleClick;
25
26
  type: typeof type;
26
27
  unhover: typeof unhover;
27
28
  upload: typeof upload;
@@ -54,6 +55,7 @@ export declare function setup(options?: SetupOptions): {
54
55
  pointer: typeof pointer;
55
56
  selectOptions: typeof selectOptions;
56
57
  tab: typeof tab;
58
+ tripleClick: typeof tripleClick;
57
59
  type: typeof type;
58
60
  unhover: typeof unhover;
59
61
  upload: typeof upload;
@@ -72,6 +74,7 @@ export declare function setup(options?: SetupOptions): {
72
74
  pointer: typeof pointer;
73
75
  selectOptions: typeof selectOptions;
74
76
  tab: typeof tab;
77
+ tripleClick: typeof tripleClick;
75
78
  type: typeof type;
76
79
  unhover: typeof unhover;
77
80
  upload: typeof upload;
package/dist/setup.js CHANGED
@@ -39,6 +39,7 @@ const userEventApis = {
39
39
  pointer: _pointer.pointer,
40
40
  selectOptions: _selectOptions.selectOptions,
41
41
  tab: _tab.tab,
42
+ tripleClick: _click.tripleClick,
42
43
  type: _type.type,
43
44
  unhover: _hover.unhover,
44
45
  upload: _upload.upload
@@ -175,6 +176,9 @@ function _setup({
175
176
  tab: (...args) => {
176
177
  return _tab.tab.call(userEvent, ...args);
177
178
  },
179
+ tripleClick: (...args) => {
180
+ return _click.tripleClick.call(userEvent, ...args);
181
+ },
178
182
  // type needs typecasting because of the overloading
179
183
  type: (...args) => {
180
184
  args[2] = { ...typeDefaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/user-event",
3
- "version": "14.0.0-alpha.5",
3
+ "version": "14.0.0-alpha.6",
4
4
  "description": "Fire events the same way the user does",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [