@testing-library/user-event 14.0.3 → 14.1.1

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.
@@ -5,6 +5,6 @@ declare global {
5
5
  }
6
6
  }
7
7
  export declare function prepareDocument(document: Document): void;
8
- export { getUIValue, setUIValue, startTrackValue, endTrackValue } from './value';
8
+ export { getUIValue, setUIValue, startTrackValue, endTrackValue, clearInitialValue, } from './value';
9
9
  export { getUISelection, setUISelection } from './selection';
10
10
  export type { UISelectionRange } from './selection';
@@ -11,5 +11,6 @@ export declare function prepareInterceptor<ElementType extends Node, PropName ex
11
11
  */
12
12
  applyNative?: boolean;
13
13
  realArgs?: ImplReturn<ElementType[PropName]>;
14
+ then?: () => void;
14
15
  }): void;
15
16
  export {};
@@ -15,7 +15,7 @@ declare global {
15
15
  export declare function prepareValueInterceptor(element: HTMLInputElement): void;
16
16
  export declare function setUIValue(element: HTMLInputElement | HTMLTextAreaElement, value: string): void;
17
17
  export declare function getUIValue(element: HTMLInputElement | HTMLTextAreaElement): string;
18
- export declare function setInitialValue(element: HTMLInputElement | HTMLTextAreaElement): void;
18
+ export declare function clearInitialValue(element: HTMLInputElement | HTMLTextAreaElement): void;
19
19
  export declare function getInitialValue(element: HTMLInputElement | HTMLTextAreaElement): string | undefined;
20
20
  export declare function startTrackValue(element: HTMLInputElement | HTMLTextAreaElement): void;
21
21
  /**
@@ -48,7 +48,7 @@ export interface Options {
48
48
  * This defaults to the owner document of an element if an API is called directly with an element and without setup.
49
49
  * Otherwise it falls back to the global document.
50
50
  *
51
- * @default element.ownerDocument??global.document
51
+ * @default element.ownerDocument??globalThis.document
52
52
  */
53
53
  document?: Document;
54
54
  /**
@@ -106,6 +106,12 @@ export interface Options {
106
106
  * Defaults to `true` when calling the APIs per `setup`.
107
107
  */
108
108
  writeToClipboard?: boolean;
109
+ /**
110
+ * A function to be called internally to advance your fake timers (if applicable)
111
+ *
112
+ * @example jest.advanceTimersByTime
113
+ */
114
+ advanceTimers?: ((delay: number) => Promise<void>) | ((delay: number) => void);
109
115
  }
110
116
  /**
111
117
  * Default options applied when API is called per `userEvent.anyApi()`
@@ -1 +1,2 @@
1
- export declare function wait(time?: number): Promise<void>;
1
+ import { Config } from '../../setup';
2
+ export declare function wait(config: Config): Promise<[void, void]> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/user-event",
3
- "version": "14.0.3",
3
+ "version": "14.1.1",
4
4
  "description": "Fire events the same way the user does",
5
5
  "keywords": [
6
6
  "react-testing-library",
@@ -52,6 +52,7 @@
52
52
  "@types/react": "^17.0.42",
53
53
  "esbuild": "^0.14.27",
54
54
  "eslint-import-resolver-typescript": "^2.7.0",
55
+ "eslint-plugin-local-rules": "^1.1.0",
55
56
  "is-ci": "^3.0.1",
56
57
  "jest-in-case": "^1.0.2",
57
58
  "jest-serializer-ansi": "^1.0.3",