@testing-library/react-native 13.0.0 → 13.1.0

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.
Files changed (192) hide show
  1. package/README.md +1 -2
  2. package/build/act.d.ts +1 -1
  3. package/build/act.js +1 -3
  4. package/build/act.js.map +1 -1
  5. package/build/config.d.ts +1 -1
  6. package/build/config.js.map +1 -1
  7. package/build/event-handler.d.ts +7 -0
  8. package/build/event-handler.js +30 -0
  9. package/build/event-handler.js.map +1 -0
  10. package/build/fire-event.d.ts +3 -3
  11. package/build/fire-event.js +4 -14
  12. package/build/fire-event.js.map +1 -1
  13. package/build/helpers/accessibility.d.ts +1 -1
  14. package/build/helpers/accessibility.js.map +1 -1
  15. package/build/helpers/component-tree.d.ts +1 -1
  16. package/build/helpers/component-tree.js.map +1 -1
  17. package/build/helpers/debug.d.ts +3 -3
  18. package/build/helpers/debug.js +8 -11
  19. package/build/helpers/debug.js.map +1 -1
  20. package/build/helpers/errors.js +4 -4
  21. package/build/helpers/errors.js.map +1 -1
  22. package/build/helpers/find-all.d.ts +2 -2
  23. package/build/helpers/find-all.js.map +1 -1
  24. package/build/helpers/format-element.d.ts +18 -0
  25. package/build/helpers/format-element.js +81 -0
  26. package/build/helpers/format-element.js.map +1 -0
  27. package/build/helpers/host-component-names.d.ts +2 -2
  28. package/build/helpers/host-component-names.js.map +1 -1
  29. package/build/helpers/logger.d.ts +6 -0
  30. package/build/helpers/logger.js +37 -0
  31. package/build/helpers/logger.js.map +1 -0
  32. package/build/helpers/{format-default.d.ts → map-props.d.ts} +1 -0
  33. package/build/helpers/{format-default.js → map-props.js} +2 -2
  34. package/build/helpers/map-props.js.map +1 -0
  35. package/build/helpers/matchers/match-accessibility-state.d.ts +1 -1
  36. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  37. package/build/helpers/matchers/match-accessibility-value.d.ts +2 -2
  38. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  39. package/build/helpers/matchers/match-label-text.d.ts +2 -2
  40. package/build/helpers/matchers/match-label-text.js.map +1 -1
  41. package/build/helpers/matchers/match-string-prop.d.ts +1 -1
  42. package/build/helpers/matchers/match-string-prop.js.map +1 -1
  43. package/build/helpers/matchers/match-text-content.d.ts +1 -1
  44. package/build/helpers/matchers/match-text-content.js.map +1 -1
  45. package/build/helpers/object.d.ts +1 -1
  46. package/build/helpers/object.js.map +1 -1
  47. package/build/helpers/pointer-events.d.ts +1 -1
  48. package/build/helpers/pointer-events.js.map +1 -1
  49. package/build/helpers/string-validation.d.ts +1 -1
  50. package/build/helpers/string-validation.js.map +1 -1
  51. package/build/helpers/text-input.d.ts +1 -1
  52. package/build/helpers/text-input.js.map +1 -1
  53. package/build/helpers/timers.d.ts +1 -1
  54. package/build/helpers/timers.js.map +1 -1
  55. package/build/index.flow.js +28 -32
  56. package/build/index.js +3 -4
  57. package/build/index.js.map +1 -1
  58. package/build/matchers/extend-expect.js +2 -2
  59. package/build/matchers/extend-expect.js.map +1 -1
  60. package/build/matchers/index.d.ts +1 -1
  61. package/build/matchers/index.js.map +1 -1
  62. package/build/matchers/to-be-busy.d.ts +1 -1
  63. package/build/matchers/to-be-busy.js +4 -1
  64. package/build/matchers/to-be-busy.js.map +1 -1
  65. package/build/matchers/to-be-checked.js +4 -1
  66. package/build/matchers/to-be-checked.js.map +1 -1
  67. package/build/matchers/to-be-disabled.js +5 -2
  68. package/build/matchers/to-be-disabled.js.map +1 -1
  69. package/build/matchers/to-be-empty-element.d.ts +1 -1
  70. package/build/matchers/to-be-empty-element.js +4 -1
  71. package/build/matchers/to-be-empty-element.js.map +1 -1
  72. package/build/matchers/to-be-expanded.d.ts +1 -1
  73. package/build/matchers/to-be-expanded.js +5 -2
  74. package/build/matchers/to-be-expanded.js.map +1 -1
  75. package/build/matchers/to-be-on-the-screen.js +4 -1
  76. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  77. package/build/matchers/to-be-partially-checked.js +4 -1
  78. package/build/matchers/to-be-partially-checked.js.map +1 -1
  79. package/build/matchers/to-be-selected.d.ts +1 -1
  80. package/build/matchers/to-be-selected.js +4 -1
  81. package/build/matchers/to-be-selected.js.map +1 -1
  82. package/build/matchers/to-be-visible.js +5 -2
  83. package/build/matchers/to-be-visible.js.map +1 -1
  84. package/build/matchers/to-contain-element.d.ts +1 -1
  85. package/build/matchers/to-contain-element.js +4 -1
  86. package/build/matchers/to-contain-element.js.map +1 -1
  87. package/build/matchers/to-have-accessibility-value.d.ts +1 -1
  88. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  89. package/build/matchers/to-have-accessible-name.d.ts +1 -1
  90. package/build/matchers/to-have-accessible-name.js.map +1 -1
  91. package/build/matchers/to-have-display-value.d.ts +1 -1
  92. package/build/matchers/to-have-display-value.js +1 -1
  93. package/build/matchers/to-have-display-value.js.map +1 -1
  94. package/build/matchers/to-have-prop.js.map +1 -1
  95. package/build/matchers/to-have-style.d.ts +1 -1
  96. package/build/matchers/to-have-style.js.map +1 -1
  97. package/build/matchers/to-have-text-content.d.ts +1 -1
  98. package/build/matchers/to-have-text-content.js.map +1 -1
  99. package/build/matchers/types.d.ts +3 -3
  100. package/build/matchers/types.js.map +1 -1
  101. package/build/matchers/utils.d.ts +1 -8
  102. package/build/matchers/utils.js +0 -41
  103. package/build/matchers/utils.js.map +1 -1
  104. package/build/native-state.d.ts +3 -3
  105. package/build/native-state.js +1 -1
  106. package/build/native-state.js.map +1 -1
  107. package/build/queries/display-value.d.ts +1 -1
  108. package/build/queries/display-value.js.map +1 -1
  109. package/build/queries/hint-text.d.ts +2 -2
  110. package/build/queries/hint-text.js.map +1 -1
  111. package/build/queries/label-text.d.ts +2 -2
  112. package/build/queries/label-text.js.map +1 -1
  113. package/build/queries/make-queries.js +5 -8
  114. package/build/queries/make-queries.js.map +1 -1
  115. package/build/queries/options.d.ts +1 -1
  116. package/build/queries/options.js.map +1 -1
  117. package/build/queries/placeholder-text.d.ts +1 -1
  118. package/build/queries/placeholder-text.js +1 -1
  119. package/build/queries/placeholder-text.js.map +1 -1
  120. package/build/queries/role.d.ts +5 -5
  121. package/build/queries/role.js.map +1 -1
  122. package/build/queries/test-id.d.ts +1 -1
  123. package/build/queries/test-id.js.map +1 -1
  124. package/build/queries/text.d.ts +1 -1
  125. package/build/queries/text.js.map +1 -1
  126. package/build/queries/unsafe-props.d.ts +6 -12
  127. package/build/queries/unsafe-props.js.map +1 -1
  128. package/build/queries/unsafe-type.d.ts +2 -1
  129. package/build/queries/unsafe-type.js +2 -0
  130. package/build/queries/unsafe-type.js.map +1 -1
  131. package/build/render-act.js +2 -2
  132. package/build/render-act.js.map +1 -1
  133. package/build/render-hook.d.ts +16 -6
  134. package/build/render-hook.js +21 -21
  135. package/build/render-hook.js.map +1 -1
  136. package/build/render.d.ts +12 -12
  137. package/build/render.js +9 -18
  138. package/build/render.js.map +1 -1
  139. package/build/screen.d.ts +1 -1
  140. package/build/screen.js.map +1 -1
  141. package/build/tsconfig.release.tsbuildinfo +1 -1
  142. package/build/user-event/clear.d.ts +2 -2
  143. package/build/user-event/clear.js +2 -2
  144. package/build/user-event/clear.js.map +1 -1
  145. package/build/user-event/event-builder/base.d.ts +2 -2
  146. package/build/user-event/event-builder/base.js.map +1 -1
  147. package/build/user-event/event-builder/scroll-view.d.ts +1 -1
  148. package/build/user-event/event-builder/scroll-view.js.map +1 -1
  149. package/build/user-event/event-builder/text-input.d.ts +2 -2
  150. package/build/user-event/event-builder/text-input.js.map +1 -1
  151. package/build/user-event/index.d.ts +4 -4
  152. package/build/user-event/index.js.map +1 -1
  153. package/build/user-event/paste.d.ts +2 -2
  154. package/build/user-event/paste.js.map +1 -1
  155. package/build/user-event/press/index.d.ts +1 -1
  156. package/build/user-event/press/index.js.map +1 -1
  157. package/build/user-event/press/press.d.ts +2 -2
  158. package/build/user-event/press/press.js +42 -42
  159. package/build/user-event/press/press.js.map +1 -1
  160. package/build/user-event/scroll/index.d.ts +1 -1
  161. package/build/user-event/scroll/index.js.map +1 -1
  162. package/build/user-event/scroll/scroll-to.d.ts +3 -3
  163. package/build/user-event/scroll/scroll-to.js +1 -1
  164. package/build/user-event/scroll/scroll-to.js.map +1 -1
  165. package/build/user-event/scroll/utils.d.ts +1 -1
  166. package/build/user-event/scroll/utils.js.map +1 -1
  167. package/build/user-event/setup/setup.d.ts +4 -4
  168. package/build/user-event/setup/setup.js.map +1 -1
  169. package/build/user-event/type/type.d.ts +2 -2
  170. package/build/user-event/type/type.js +3 -3
  171. package/build/user-event/type/type.js.map +1 -1
  172. package/build/user-event/utils/content-size.d.ts +1 -1
  173. package/build/user-event/utils/content-size.js.map +1 -1
  174. package/build/user-event/utils/dispatch-event.d.ts +1 -1
  175. package/build/user-event/utils/dispatch-event.js +2 -12
  176. package/build/user-event/utils/dispatch-event.js.map +1 -1
  177. package/build/user-event/utils/wait.d.ts +6 -2
  178. package/build/user-event/utils/wait.js +1 -1
  179. package/build/user-event/utils/wait.js.map +1 -1
  180. package/build/wait-for-element-to-be-removed.js +1 -1
  181. package/build/wait-for-element-to-be-removed.js.map +1 -1
  182. package/build/wait-for.js +1 -4
  183. package/build/wait-for.js.map +1 -1
  184. package/build/within.d.ts +4 -4
  185. package/build/within.js +5 -5
  186. package/build/within.js.map +1 -1
  187. package/package.json +15 -13
  188. package/typings/index.flow.js +28 -32
  189. package/build/helpers/format-default.js.map +0 -1
  190. package/build/helpers/format.d.ts +0 -7
  191. package/build/helpers/format.js +0 -31
  192. package/build/helpers/format.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"render-hook.js","names":["_react","_interopRequireDefault","require","_render","e","__esModule","default","renderHook","renderCallback","options","initialProps","wrapper","result","React","createRef","TestComponent","renderCallbackProps","renderResult","useEffect","current","rerender","baseRerender","unmount","renderInternal","createElement","rerenderCallbackProps"],"sources":["../src/render-hook.tsx"],"sourcesContent":["import React from 'react';\nimport type { ComponentType } from 'react';\nimport { renderInternal } from './render';\n\nexport type RenderHookResult<Result, Props> = {\n rerender: (props: Props) => void;\n result: { current: Result };\n unmount: () => void;\n};\n\nexport type RenderHookOptions<Props> = {\n initialProps?: Props;\n wrapper?: ComponentType<any>;\n};\n\nexport function renderHook<Result, Props>(\n renderCallback: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): RenderHookResult<Result, Props> {\n const initialProps = options?.initialProps;\n const wrapper = options?.wrapper;\n\n const result: React.MutableRefObject<Result | null> = React.createRef();\n\n function TestComponent({ renderCallbackProps }: { renderCallbackProps: Props }) {\n const renderResult = renderCallback(renderCallbackProps);\n\n React.useEffect(() => {\n result.current = renderResult;\n });\n\n return null;\n }\n\n const { rerender: baseRerender, unmount } = renderInternal(\n // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt\n <TestComponent renderCallbackProps={initialProps} />,\n {\n wrapper,\n },\n );\n\n function rerender(rerenderCallbackProps: Props) {\n return baseRerender(<TestComponent renderCallbackProps={rerenderCallbackProps} />);\n }\n\n // @ts-expect-error result is ill typed because ref is initialized to null\n return { result, rerender, unmount };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA0C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAanC,SAASG,UAAUA,CACxBC,cAAwC,EACxCC,OAAkC,EACD;EACjC,MAAMC,YAAY,GAAGD,OAAO,EAAEC,YAAY;EAC1C,MAAMC,OAAO,GAAGF,OAAO,EAAEE,OAAO;EAEhC,MAAMC,MAA6C,gBAAGC,cAAK,CAACC,SAAS,CAAC,CAAC;EAEvE,SAASC,aAAaA,CAAC;IAAEC;EAAoD,CAAC,EAAE;IAC9E,MAAMC,YAAY,GAAGT,cAAc,CAACQ,mBAAmB,CAAC;IAExDH,cAAK,CAACK,SAAS,CAAC,MAAM;MACpBN,MAAM,CAACO,OAAO,GAAGF,YAAY;IAC/B,CAAC,CAAC;IAEF,OAAO,IAAI;EACb;EAEA,MAAM;IAAEG,QAAQ,EAAEC,YAAY;IAAEC;EAAQ,CAAC,GAAG,IAAAC,sBAAc;EAAA;EACxD;EACAvB,MAAA,CAAAM,OAAA,CAAAkB,aAAA,CAACT,aAAa;IAACC,mBAAmB,EAAEN;EAAa,CAAE,CAAC,EACpD;IACEC;EACF,CACF,CAAC;EAED,SAASS,QAAQA,CAACK,qBAA4B,EAAE;IAC9C,OAAOJ,YAAY,cAACrB,MAAA,CAAAM,OAAA,CAAAkB,aAAA,CAACT,aAAa;MAACC,mBAAmB,EAAES;IAAsB,CAAE,CAAC,CAAC;EACpF;;EAEA;EACA,OAAO;IAAEb,MAAM;IAAEQ,QAAQ;IAAEE;EAAQ,CAAC;AACtC","ignoreList":[]}
1
+ {"version":3,"file":"render-hook.js","names":["React","_interopRequireWildcard","require","_render","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","renderHook","hookToRender","options","initialProps","renderOptions","result","createRef","TestComponent","hookProps","renderResult","useEffect","current","rerender","componentRerender","unmount","renderInternal","createElement"],"sources":["../src/render-hook.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { renderInternal } from './render';\n\nexport type RenderHookResult<Result, Props> = {\n rerender: (props: Props) => void;\n result: React.MutableRefObject<Result>;\n unmount: () => void;\n};\n\nexport type RenderHookOptions<Props> = {\n /**\n * The initial props to pass to the hook.\n */\n initialProps?: Props;\n\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `renderHook` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n};\n\nexport function renderHook<Result, Props>(\n hookToRender: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): RenderHookResult<Result, Props> {\n const { initialProps, ...renderOptions } = options ?? {};\n\n const result: React.MutableRefObject<Result | null> = React.createRef();\n\n function TestComponent({ hookProps }: { hookProps: Props }) {\n const renderResult = hookToRender(hookProps);\n\n React.useEffect(() => {\n result.current = renderResult;\n });\n\n return null;\n }\n\n const { rerender: componentRerender, unmount } = renderInternal(\n // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt\n <TestComponent hookProps={initialProps} />,\n renderOptions,\n );\n\n function rerender(hookProps: Props) {\n return componentRerender(<TestComponent hookProps={hookProps} />);\n }\n\n return {\n // Result should already be set after the first render effects are run.\n result: result as React.MutableRefObject<Result>,\n rerender,\n unmount,\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA0C,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAA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package/build/render.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import type { ReactTestInstance } from 'react-test-renderer';
2
1
  import * as React from 'react';
3
- import { DebugOptions } from './helpers/debug';
2
+ import type { ReactTestInstance } from 'react-test-renderer';
3
+ import type { DebugOptions } from './helpers/debug';
4
4
  export interface RenderOptions {
5
5
  /**
6
6
  * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating
7
- * reusable custom render functions for common data providers.
7
+ * reusable custom render functions for common data providers.
8
8
  */
9
9
  wrapper?: React.ComponentType<any>;
10
10
  /**
@@ -29,16 +29,16 @@ export default function render<T>(component: React.ReactElement<T>, options?: Re
29
29
  root: ReactTestInstance;
30
30
  UNSAFE_root: ReactTestInstance;
31
31
  UNSAFE_getByProps: (props: {
32
- [key: string]: any;
32
+ [x: string]: unknown;
33
33
  }) => ReactTestInstance;
34
34
  UNSAFE_getAllByProps: (props: {
35
- [key: string]: any;
35
+ [x: string]: unknown;
36
36
  }) => Array<ReactTestInstance>;
37
37
  UNSAFE_queryByProps: (props: {
38
- [key: string]: any;
38
+ [x: string]: unknown;
39
39
  }) => ReactTestInstance | null;
40
40
  UNSAFE_queryAllByProps: (props: {
41
- [key: string]: any;
41
+ [x: string]: unknown;
42
42
  }) => Array<ReactTestInstance>;
43
43
  UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
44
44
  UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
@@ -108,16 +108,16 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
108
108
  root: ReactTestInstance;
109
109
  UNSAFE_root: ReactTestInstance;
110
110
  UNSAFE_getByProps: (props: {
111
- [key: string]: any;
111
+ [x: string]: unknown;
112
112
  }) => ReactTestInstance;
113
113
  UNSAFE_getAllByProps: (props: {
114
- [key: string]: any;
114
+ [x: string]: unknown;
115
115
  }) => Array<ReactTestInstance>;
116
116
  UNSAFE_queryByProps: (props: {
117
- [key: string]: any;
117
+ [x: string]: unknown;
118
118
  }) => ReactTestInstance | null;
119
119
  UNSAFE_queryAllByProps: (props: {
120
- [key: string]: any;
120
+ [x: string]: unknown;
121
121
  }) => Array<ReactTestInstance>;
122
122
  UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
123
123
  UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
@@ -178,4 +178,4 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
178
178
  findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
179
179
  findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
180
180
  };
181
- export type DebugFunction = (options?: DebugOptions | string) => void;
181
+ export type DebugFunction = (options?: DebugOptions) => void;
package/build/render.js CHANGED
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = render;
7
7
  exports.renderInternal = renderInternal;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var React = _react;
8
+ var React = _interopRequireWildcard(require("react"));
10
9
  var _act = _interopRequireDefault(require("./act"));
11
10
  var _cleanup = require("./cleanup");
12
11
  var _config = require("./config");
@@ -49,21 +48,20 @@ function renderInternal(component, options) {
49
48
  return buildRenderResult(renderer, wrap);
50
49
  }
51
50
  function renderWithStringValidation(component, options = {}) {
52
- let renderer;
53
51
  const {
54
52
  wrapper: Wrapper,
55
53
  ...testRendererOptions
56
54
  } = options ?? {};
55
+ const wrap = element => /*#__PURE__*/React.createElement(React.Profiler, {
56
+ id: "renderProfiler",
57
+ onRender: handleRender
58
+ }, Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element);
57
59
  const handleRender = (_, phase) => {
58
60
  if (renderer && phase === 'update') {
59
61
  (0, _stringValidation.validateStringsRenderedWithinText)(renderer.toJSON());
60
62
  }
61
63
  };
62
- const wrap = element => /*#__PURE__*/React.createElement(_react.Profiler, {
63
- id: "renderProfiler",
64
- onRender: handleRender
65
- }, Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element);
66
- renderer = (0, _renderAct.renderWithAct)(wrap(component), testRendererOptions);
64
+ const renderer = (0, _renderAct.renderWithAct)(wrap(component), testRendererOptions);
67
65
  (0, _stringValidation.validateStringsRenderedWithinText)(renderer.toJSON());
68
66
  return buildRenderResult(renderer, wrap);
69
67
  }
@@ -83,7 +81,7 @@ function buildRenderResult(renderer, wrap) {
83
81
  rerender: update,
84
82
  // alias for `update`
85
83
  toJSON: renderer.toJSON,
86
- debug: makeDebug(instance, renderer),
84
+ debug: makeDebug(renderer),
87
85
  get root() {
88
86
  return (0, _componentTree.getHostSelves)(instance)[0];
89
87
  },
@@ -108,22 +106,15 @@ function updateWithAct(renderer, wrap) {
108
106
  });
109
107
  };
110
108
  }
111
- function makeDebug(instance, renderer) {
109
+ function makeDebug(renderer) {
112
110
  function debugImpl(options) {
113
111
  const {
114
112
  defaultDebugOptions
115
113
  } = (0, _config.getConfig)();
116
- const debugOptions = typeof options === 'string' ? {
117
- ...defaultDebugOptions,
118
- message: options
119
- } : {
114
+ const debugOptions = {
120
115
  ...defaultDebugOptions,
121
116
  ...options
122
117
  };
123
- if (typeof options === 'string') {
124
- // eslint-disable-next-line no-console
125
- console.warn('Using debug("message") is deprecated and will be removed in future release, please use debug({ message: "message" }) instead.');
126
- }
127
118
  const json = renderer.toJSON();
128
119
  if (json) {
129
120
  return (0, _debug.debug)(json, debugOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["_react","_interopRequireWildcard","require","React","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debug","_stringValidation","_renderAct","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","concurrentRoot","unstable_validateStringsRenderedWithinText","rest","testRendererOptions","unstable_isConcurrent","getConfig","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","handleRender","_","phase","validateStringsRenderedWithinText","toJSON","Profiler","id","onRender","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","makeDebug","getHostSelves","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","debugOptions","message","console","warn","json"],"sources":["../src/render.tsx"],"sourcesContent":["import type {\n ReactTestInstance,\n ReactTestRenderer,\n TestRendererOptions,\n} from 'react-test-renderer';\nimport * as React from 'react';\nimport { Profiler } from 'react';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostSelves } from './helpers/component-tree';\nimport { debug, DebugOptions } from './helpers/debug';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `render` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions) {\n const {\n wrapper: Wrapper,\n concurrentRoot,\n unstable_validateStringsRenderedWithinText,\n ...rest\n } = options || {};\n\n const testRendererOptions: TestRendererOptions = {\n ...rest,\n // @ts-expect-error incomplete typing on RTR package\n unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,\n };\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n let renderer: ReactTestRenderer;\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const handleRender: React.ProfilerOnRenderCallback = (_, phase) => {\n if (renderer && phase === 'update') {\n validateStringsRenderedWithinText(renderer.toJSON());\n }\n };\n\n const wrap = (element: React.ReactElement) => (\n <Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </Profiler>\n );\n\n renderer = renderWithAct(wrap(component), testRendererOptions);\n\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: makeDebug(instance, renderer),\n get root(): ReactTestInstance {\n return getHostSelves(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport type DebugFunction = (options?: DebugOptions | string) => void;\n\nfunction makeDebug(instance: ReactTestInstance, renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message: \"message\" }) instead.',\n );\n }\n\n const json = renderer.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAAgD,SAAAG,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAA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YAAG,EAAC,MAAM;MACbhB,QAAQ,CAACW,MAAM,CAACd,IAAI,CAACZ,SAAS,CAAC,CAAC;IAClC,CAAC,CAAC;EACJ,CAAC;AACH;AAIA,SAASqC,SAASA,CAACT,QAA2B,EAAEb,QAA2B,EAAiB;EAC1F,SAAS4B,SAASA,CAAC1C,OAA+B,EAAE;IAClD,MAAM;MAAE2C;IAAoB,CAAC,GAAG,IAAAlC,iBAAS,EAAC,CAAC;IAC3C,MAAMmC,YAAY,GAChB,OAAO5C,OAAO,KAAK,QAAQ,GACvB;MAAE,GAAG2C,mBAAmB;MAAEE,OAAO,EAAE7C;IAAQ,CAAC,GAC5C;MAAE,GAAG2C,mBAAmB;MAAE,GAAG3C;IAAQ,CAAC;IAE5C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B;MACA8C,OAAO,CAACC,IAAI,CACV,+HACF,CAAC;IACH;IAEA,MAAMC,IAAI,GAAGlC,QAAQ,CAACO,MAAM,CAAC,CAAC;IAC9B,IAAI2B,IAAI,EAAE;MACR,OAAO,IAAAb,YAAK,EAACa,IAAI,EAAEJ,YAAY,CAAC;IAClC;EACF;EACA,OAAOF,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["React","_interopRequireWildcard","require","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debug","_stringValidation","_renderAct","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","concurrentRoot","unstable_validateStringsRenderedWithinText","rest","testRendererOptions","unstable_isConcurrent","getConfig","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","Profiler","id","onRender","handleRender","_","phase","validateStringsRenderedWithinText","toJSON","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","makeDebug","getHostSelves","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","debugOptions","json"],"sources":["../src/render.tsx"],"sourcesContent":["import * as React from 'react';\nimport type {\n ReactTestInstance,\n ReactTestRenderer,\n TestRendererOptions,\n} from 'react-test-renderer';\n\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostSelves } from './helpers/component-tree';\nimport type { DebugOptions } from './helpers/debug';\nimport { debug } from './helpers/debug';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `render` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions) {\n const {\n wrapper: Wrapper,\n concurrentRoot,\n unstable_validateStringsRenderedWithinText,\n ...rest\n } = options || {};\n\n const testRendererOptions: TestRendererOptions = {\n ...rest,\n // @ts-expect-error incomplete typing on RTR package\n unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,\n };\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const wrap = (element: React.ReactElement) => (\n <React.Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </React.Profiler>\n );\n\n const handleRender: React.ProfilerOnRenderCallback = (_, phase) => {\n if (renderer && phase === 'update') {\n validateStringsRenderedWithinText(renderer.toJSON());\n }\n };\n\n const renderer: ReactTestRenderer = renderWithAct(wrap(component), testRendererOptions);\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => React.JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: makeDebug(renderer),\n get root(): ReactTestInstance {\n return getHostSelves(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport type DebugFunction = (options?: DebugOptions) => void;\n\nfunction makeDebug(renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions = { ...defaultDebugOptions, ...options };\n const json = renderer.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAAgD,SAAAE,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf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OAAO,IAAAV,YAAK,EAACU,IAAI,EAAED,YAAY,CAAC;IAClC;EACF;EACA,OAAOF,SAAS;AAClB","ignoreList":[]}
package/build/screen.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RenderResult } from './render';
1
+ import type { RenderResult } from './render';
2
2
  interface Screen extends RenderResult {
3
3
  isDetached?: boolean;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAGA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAMD,MAAMI,aAAqB,GAAG;EAC5BC,UAAU,EAAE,IAAI;EAChB,IAAIC,IAAIA,CAAA,EAAsB;IAC5B,MAAM,IAAIJ,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACD,IAAIO,WAAWA,CAAA,EAAsB;IACnC,MAAM,IAAIL,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACDQ,KAAK,EAAEL,mBAAmB;EAC1BM,MAAM,EAAER,cAAc;EACtBS,OAAO,EAAET,cAAc;EACvBU,QAAQ,EAAEV,cAAc;EACxBW,MAAM,EAAEX,cAAc;EACtBY,cAAc,EAAEZ,cAAc;EAC9Ba,iBAAiB,EAAEb,cAAc;EACjCc,gBAAgB,EAAEd,cAAc;EAChCe,mBAAmB,EAAEf,cAAc;EACnCgB,eAAe,EAAEhB,cAAc;EAC/BiB,kBAAkB,EAAE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AAc;EACpC0D,mBAAmB,EAAE1D,cAAc;EACnC2D,sBAAsB,EAAE3D,cAAc;EACtC4D,kBAAkB,EAAE5D,cAAc;EAClC6D,qBAAqB,EAAE7D,cAAc;EACrC8D,WAAW,EAAE9D,cAAc;EAC3B+D,cAAc,EAAE/D,cAAc;EAC9BgE,aAAa,EAAEhE,cAAc;EAC7BiE,gBAAgB,EAAEjE,cAAc;EAChCkE,YAAY,EAAElE,cAAc;EAC5BmE,eAAe,EAAEnE,cAAc;EAC/BoE,SAAS,EAAEpE,cAAc;EACzBqE,YAAY,EAAErE,cAAc;EAC5BsE,WAAW,EAAEtE,cAAc;EAC3BuE,cAAc,EAAEvE,cAAc;EAC9BwE,UAAU,EAAExE,cAAc;EAC1ByE,aAAa,EAAEzE;AACjB,CAAC;AAEM,IAAI0E,MAAc,GAAAC,OAAA,CAAAD,MAAA,GAAGvE,aAAa;AAElC,SAASyE,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGvE,aAAa;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport type { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAIA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAMD,MAAMI,a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AAA,GAAAA,MAAM,GAAGvE,aAAa;AACxB","ignoreList":[]}
@@ -1 +1 @@
1
- {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-default.ts","../src/helpers/format.ts","../src/helpers/host-component-names.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/string-validation.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/queries/unsafe-props.ts","../src/queries/unsafe-type.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.6.3"}
1
+ {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/event-handler.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-element.ts","../src/helpers/host-component-names.ts","../src/helpers/logger.ts","../src/helpers/map-props.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/string-validation.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/queries/unsafe-props.ts","../src/queries/unsafe-type.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.7.3"}
@@ -1,3 +1,3 @@
1
- import { ReactTestInstance } from 'react-test-renderer';
2
- import { UserEventInstance } from './setup';
1
+ import type { ReactTestInstance } from 'react-test-renderer';
2
+ import type { UserEventInstance } from './setup';
3
3
  export declare function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void>;
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.clear = clear;
7
7
  var _errors = require("../helpers/errors");
8
8
  var _hostComponentNames = require("../helpers/host-component-names");
9
- var _textInput = require("../helpers/text-input");
10
9
  var _pointerEvents = require("../helpers/pointer-events");
10
+ var _textInput = require("../helpers/text-input");
11
11
  var _eventBuilder = require("./event-builder");
12
- var _utils = require("./utils");
13
12
  var _type = require("./type/type");
13
+ var _utils = require("./utils");
14
14
  async function clear(element) {
15
15
  if (!(0, _hostComponentNames.isHostTextInput)(element)) {
16
16
  throw new _errors.ErrorWithStack(`clear() only supports host "TextInput" elements. Passed element has type: "${element.type}".`, clear);
@@ -1 +1 @@
1
- {"version":3,"file":"clear.js","names":["_errors","require","_hostComponentNames","_textInput","_pointerEvents","_eventBuilder","_utils","_type","clear","element","isHostTextInput","ErrorWithStack","type","isEditableTextInput","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","textToClear","getTextInputValue","selectionRange","start","end","length","TextInput","selectionChange","emptyText","emitTypingEvents","config","key","text","wait","endEditing","blur"],"sources":["../../src/user-event/clear.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { getTextInputValue, isEditableTextInput } from '../helpers/text-input';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { EventBuilder } from './event-builder';\nimport { UserEventInstance } from './setup';\nimport { dispatchEvent, wait } from './utils';\nimport { emitTypingEvents } from './type/type';\n\nexport async function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `clear() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n clear,\n );\n }\n\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const textToClear = getTextInputValue(element);\n const selectionRange = {\n start: 0,\n end: textToClear.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // 3. Press backspace with selected text\n const emptyText = '';\n await emitTypingEvents(element, {\n config: this.config,\n key: 'Backspace',\n text: emptyText,\n });\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(emptyText));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEO,eAAeO,KAAKA,CAA0BC,OAA0B,EAAiB;EAC9F,IAAI,CAAC,IAAAC,mCAAe,EAACD,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIE,sBAAc,CACtB,8EAA8EF,OAAO,CAACG,IAAI,IAAI,EAC9FJ,KACF,CAAC;EACH;EAEA,IAAI,CAAC,IAAAK,8BAAmB,EAACJ,OAAO,CAAC,IAAI,CAAC,IAAAK,oCAAqB,EAACL,OAAO,CAAC,EAAE;IACpE;EACF;;EAEA;EACA,IAAAM,oBAAa,EAACN,OAAO,EAAE,OAAO,EAAEO,0BAAY,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC,CAAC;;EAE5D;EACA,MAAMC,WAAW,GAAG,IAAAC,4BAAiB,EAACX,OAAO,CAAC;EAC9C,MAAMY,cAAc,GAAG;IACrBC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAEJ,WAAW,CAACK;EACnB,CAAC;EACD,IAAAT,oBAAa,EAACN,OAAO,EAAE,iBAAiB,EAAEO,0BAAY,CAACS,SAAS,CAACC,eAAe,CAACL,cAAc,CAAC,CAAC;;EAEjG;EACA,MAAMM,SAAS,GAAG,EAAE;EACpB,MAAM,IAAAC,sBAAgB,EAACnB,OAAO,EAAE;IAC9BoB,MAAM,EAAE,IAAI,CAACA,MAAM;IACnBC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAEJ;EACR,CAAC,CAAC;;EAEF;EACA,MAAM,IAAAK,WAAI,EAAC,IAAI,CAACH,MAAM,CAAC;EACvB,IAAAd,oBAAa,EAACN,OAAO,EAAE,YAAY,EAAEO,0BAAY,CAACS,SAAS,CAACQ,UAAU,CAACN,SAAS,CAAC,CAAC;EAClF,IAAAZ,oBAAa,EAACN,OAAO,EAAE,MAAM,EAAEO,0BAAY,CAACC,MAAM,CAACiB,IAAI,CAAC,CAAC,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"file":"clear.js","names":["_errors","require","_hostComponentNames","_pointerEvents","_textInput","_eventBuilder","_type","_utils","clear","element","isHostTextInput","ErrorWithStack","type","isEditableTextInput","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","textToClear","getTextInputValue","selectionRange","start","end","length","TextInput","selectionChange","emptyText","emitTypingEvents","config","key","text","wait","endEditing","blur"],"sources":["../../src/user-event/clear.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { getTextInputValue, isEditableTextInput } from '../helpers/text-input';\nimport { EventBuilder } from './event-builder';\nimport type { UserEventInstance } from './setup';\nimport { emitTypingEvents } from './type/type';\nimport { dispatchEvent, wait } from './utils';\n\nexport async function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `clear() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n clear,\n );\n }\n\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const textToClear = getTextInputValue(element);\n const selectionRange = {\n start: 0,\n end: textToClear.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // 3. Press backspace with selected text\n const emptyText = '';\n await emitTypingEvents(element, {\n config: this.config,\n key: 'Backspace',\n text: emptyText,\n });\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(emptyText));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEO,eAAeO,KAAKA,CAA0BC,OAA0B,EAAiB;EAC9F,IAAI,CAAC,IAAAC,mCAAe,EAACD,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIE,sBAAc,CACtB,8EAA8EF,OAAO,CAACG,IAAI,IAAI,EAC9FJ,KACF,CAAC;EACH;EAEA,IAAI,CAAC,IAAAK,8BAAmB,EAACJ,OAAO,CAAC,IAAI,CAAC,IAAAK,oCAAqB,EAACL,OAAO,CAAC,EAAE;IACpE;EACF;;EAEA;EACA,IAAAM,oBAAa,EAACN,OAAO,EAAE,OAAO,EAAEO,0BAAY,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC,CAAC;;EAE5D;EACA,MAAMC,WAAW,GAAG,IAAAC,4BAAiB,EAACX,OAAO,CAAC;EAC9C,MAAMY,cAAc,GAAG;IACrBC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAEJ,WAAW,CAACK;EACnB,CAAC;EACD,IAAAT,oBAAa,EAACN,OAAO,EAAE,iBAAiB,EAAEO,0BAAY,CAACS,SAAS,CAACC,eAAe,CAACL,cAAc,CAAC,CAAC;;EAEjG;EACA,MAAMM,SAAS,GAAG,EAAE;EACpB,MAAM,IAAAC,sBAAgB,EAACnB,OAAO,EAAE;IAC9BoB,MAAM,EAAE,IAAI,CAACA,MAAM;IACnBC,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAEJ;EACR,CAAC,CAAC;;EAEF;EACA,MAAM,IAAAK,WAAI,EAAC,IAAI,CAACH,MAAM,CAAC;EACvB,IAAAd,oBAAa,EAACN,OAAO,EAAE,YAAY,EAAEO,0BAAY,CAACS,SAAS,CAACQ,UAAU,CAACN,SAAS,CAAC,CAAC;EAClF,IAAAZ,oBAAa,EAACN,OAAO,EAAE,MAAM,EAAEO,0BAAY,CAACC,MAAM,CAACiB,IAAI,CAAC,CAAC,CAAC;AAC5D","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { BaseSyntheticEvent } from 'react';
1
+ import type { BaseSyntheticEvent } from 'react';
2
2
  /** Builds base syntentic event stub, with prop values as inspected in RN runtime. */
3
- export declare function baseSyntheticEvent(): Partial<BaseSyntheticEvent<{}, unknown, unknown>>;
3
+ export declare function baseSyntheticEvent(): Partial<BaseSyntheticEvent<object, unknown, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":["baseSyntheticEvent","currentTarget","target","preventDefault","isDefaultPrevented","stopPropagation","isPropagationStopped","persist","isPersistent","timeStamp"],"sources":["../../../src/user-event/event-builder/base.ts"],"sourcesContent":["import { BaseSyntheticEvent } from 'react';\n\n/** Builds base syntentic event stub, with prop values as inspected in RN runtime. */\nexport function baseSyntheticEvent(): Partial<BaseSyntheticEvent<{}, unknown, unknown>> {\n return {\n currentTarget: {},\n target: {},\n preventDefault: () => {},\n isDefaultPrevented: () => false,\n stopPropagation: () => {},\n isPropagationStopped: () => false,\n persist: () => {},\n // @ts-expect-error: `isPersistent` is not a standard prop, but it's used in RN runtime. See: https://react.dev/reference/react-dom/components/common#react-event-object-methods\n isPersistent: () => false,\n timeStamp: 0,\n };\n}\n"],"mappings":";;;;;;AAEA;AACO,SAASA,kBAAkBA,CAAA,EAAsD;EACtF,OAAO;IACLC,aAAa,EAAE,CAAC,CAAC;IACjBC,MAAM,EAAE,CAAC,CAAC;IACVC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;IACxBC,kBAAkB,EAAEA,CAAA,KAAM,KAAK;IAC/BC,eAAe,EAAEA,CAAA,KAAM,CAAC,CAAC;IACzBC,oBAAoB,EAAEA,CAAA,KAAM,KAAK;IACjCC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjB;IACAC,YAAY,EAAEA,CAAA,KAAM,KAAK;IACzBC,SAAS,EAAE;EACb,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"base.js","names":["baseSyntheticEvent","currentTarget","target","preventDefault","isDefaultPrevented","stopPropagation","isPropagationStopped","persist","isPersistent","timeStamp"],"sources":["../../../src/user-event/event-builder/base.ts"],"sourcesContent":["import type { BaseSyntheticEvent } from 'react';\n\n/** Builds base syntentic event stub, with prop values as inspected in RN runtime. */\nexport function baseSyntheticEvent(): Partial<BaseSyntheticEvent<object, unknown, unknown>> {\n return {\n currentTarget: {},\n target: {},\n preventDefault: () => {},\n isDefaultPrevented: () => false,\n stopPropagation: () => {},\n isPropagationStopped: () => false,\n persist: () => {},\n // @ts-expect-error: `isPersistent` is not a standard prop, but it's used in RN runtime. See: https://react.dev/reference/react-dom/components/common#react-event-object-methods\n isPersistent: () => false,\n timeStamp: 0,\n };\n}\n"],"mappings":";;;;;;AAEA;AACO,SAASA,kBAAkBA,CAAA,EAA0D;EAC1F,OAAO;IACLC,aAAa,EAAE,CAAC,CAAC;IACjBC,MAAM,EAAE,CAAC,CAAC;IACVC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;IACxBC,kBAAkB,EAAEA,CAAA,KAAM,KAAK;IAC/BC,eAAe,EAAEA,CAAA,KAAM,CAAC,CAAC;IACzBC,oBAAoB,EAAEA,CAAA,KAAM,KAAK;IACjCC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjB;IACAC,YAAY,EAAEA,CAAA,KAAM,KAAK;IACzBC,SAAS,EAAE;EACb,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { Point, Size } from '../../types';
1
+ import type { Point, Size } from '../../types';
2
2
  /**
3
3
  * Other options for constructing a scroll event.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-view.js","names":["_base","require","ScrollViewEventBuilder","exports","scroll","offset","y","x","options","baseSyntheticEvent","nativeEvent","contentInset","bottom","left","right","top","contentOffset","contentSize","height","width","layoutMeasurement","responderIgnoreScroll","target","velocity"],"sources":["../../../src/user-event/event-builder/scroll-view.ts"],"sourcesContent":["import { Point, Size } from '../../types';\nimport { baseSyntheticEvent } from './base';\n\n/**\n * Other options for constructing a scroll event.\n */\nexport type ScrollEventOptions = {\n contentSize?: Size;\n layoutMeasurement?: Size;\n};\n\n/**\n * Experimental values:\n * - iOS: `{\"contentInset\": {\"bottom\": 0, \"left\": 0, \"right\": 0, \"top\": 0}, \"contentOffset\": {\"x\": 0, \"y\": 5.333333333333333}, \"contentSize\": {\"height\": 1676.6666259765625, \"width\": 390}, \"layoutMeasurement\": {\"height\": 753, \"width\": 390}, \"zoomScale\": 1}`\n * - Android: `{\"contentInset\": {\"bottom\": 0, \"left\": 0, \"right\": 0, \"top\": 0}, \"contentOffset\": {\"x\": 0, \"y\": 31.619047164916992}, \"contentSize\": {\"height\": 1624.761962890625, \"width\": 411.4285583496094}, \"layoutMeasurement\": {\"height\": 785.5238037109375, \"width\": 411.4285583496094}, \"responderIgnoreScroll\": true, \"target\": 139, \"velocity\": {\"x\": -1.3633992671966553, \"y\": -1.3633992671966553}}`\n */\nexport const ScrollViewEventBuilder = {\n scroll: (offset: Point = { y: 0, x: 0 }, options?: ScrollEventOptions) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: {\n contentInset: { bottom: 0, left: 0, right: 0, top: 0 },\n contentOffset: { y: offset.y, x: offset.x },\n contentSize: {\n height: options?.contentSize?.height ?? 0,\n width: options?.contentSize?.width ?? 0,\n },\n layoutMeasurement: {\n height: options?.layoutMeasurement?.height ?? 0,\n width: options?.layoutMeasurement?.width ?? 0,\n },\n responderIgnoreScroll: true,\n target: 0,\n velocity: { y: 0, x: 0 },\n },\n };\n },\n};\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACpCE,MAAM,EAAEA,CAACC,MAAa,GAAG;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,EAAEC,OAA4B,KAAK;IACxE,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QACXC,YAAY,EAAE;UAAEC,MAAM,EAAE,CAAC;UAAEC,IAAI,EAAE,CAAC;UAAEC,KAAK,EAAE,CAAC;UAAEC,GAAG,EAAE;QAAE,CAAC;QACtDC,aAAa,EAAE;UAAEV,CAAC,EAAED,MAAM,CAACC,CAAC;UAAEC,CAAC,EAAEF,MAAM,CAACE;QAAE,CAAC;QAC3CU,WAAW,EAAE;UACXC,MAAM,EAAEV,OAAO,EAAES,WAAW,EAAEC,MAAM,IAAI,CAAC;UACzCC,KAAK,EAAEX,OAAO,EAAES,WAAW,EAAEE,KAAK,IAAI;QACxC,CAAC;QACDC,iBAAiB,EAAE;UACjBF,MAAM,EAAEV,OAAO,EAAEY,iBAAiB,EAAEF,MAAM,IAAI,CAAC;UAC/CC,KAAK,EAAEX,OAAO,EAAEY,iBAAiB,EAAED,KAAK,IAAI;QAC9C,CAAC;QACDE,qBAAqB,EAAE,IAAI;QAC3BC,MAAM,EAAE,CAAC;QACTC,QAAQ,EAAE;UAAEjB,CAAC,EAAE,CAAC;UAAEC,CAAC,EAAE;QAAE;MACzB;IACF,CAAC;EACH;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"scroll-view.js","names":["_base","require","ScrollViewEventBuilder","exports","scroll","offset","y","x","options","baseSyntheticEvent","nativeEvent","contentInset","bottom","left","right","top","contentOffset","contentSize","height","width","layoutMeasurement","responderIgnoreScroll","target","velocity"],"sources":["../../../src/user-event/event-builder/scroll-view.ts"],"sourcesContent":["import type { Point, Size } from '../../types';\nimport { baseSyntheticEvent } from './base';\n\n/**\n * Other options for constructing a scroll event.\n */\nexport type ScrollEventOptions = {\n contentSize?: Size;\n layoutMeasurement?: Size;\n};\n\n/**\n * Experimental values:\n * - iOS: `{\"contentInset\": {\"bottom\": 0, \"left\": 0, \"right\": 0, \"top\": 0}, \"contentOffset\": {\"x\": 0, \"y\": 5.333333333333333}, \"contentSize\": {\"height\": 1676.6666259765625, \"width\": 390}, \"layoutMeasurement\": {\"height\": 753, \"width\": 390}, \"zoomScale\": 1}`\n * - Android: `{\"contentInset\": {\"bottom\": 0, \"left\": 0, \"right\": 0, \"top\": 0}, \"contentOffset\": {\"x\": 0, \"y\": 31.619047164916992}, \"contentSize\": {\"height\": 1624.761962890625, \"width\": 411.4285583496094}, \"layoutMeasurement\": {\"height\": 785.5238037109375, \"width\": 411.4285583496094}, \"responderIgnoreScroll\": true, \"target\": 139, \"velocity\": {\"x\": -1.3633992671966553, \"y\": -1.3633992671966553}}`\n */\nexport const ScrollViewEventBuilder = {\n scroll: (offset: Point = { y: 0, x: 0 }, options?: ScrollEventOptions) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: {\n contentInset: { bottom: 0, left: 0, right: 0, top: 0 },\n contentOffset: { y: offset.y, x: offset.x },\n contentSize: {\n height: options?.contentSize?.height ?? 0,\n width: options?.contentSize?.width ?? 0,\n },\n layoutMeasurement: {\n height: options?.layoutMeasurement?.height ?? 0,\n width: options?.layoutMeasurement?.width ?? 0,\n },\n responderIgnoreScroll: true,\n target: 0,\n velocity: { y: 0, x: 0 },\n },\n };\n },\n};\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACpCE,MAAM,EAAEA,CAACC,MAAa,GAAG;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC,EAAEC,OAA4B,KAAK;IACxE,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QACXC,YAAY,EAAE;UAAEC,MAAM,EAAE,CAAC;UAAEC,IAAI,EAAE,CAAC;UAAEC,KAAK,EAAE,CAAC;UAAEC,GAAG,EAAE;QAAE,CAAC;QACtDC,aAAa,EAAE;UAAEV,CAAC,EAAED,MAAM,CAACC,CAAC;UAAEC,CAAC,EAAEF,MAAM,CAACE;QAAE,CAAC;QAC3CU,WAAW,EAAE;UACXC,MAAM,EAAEV,OAAO,EAAES,WAAW,EAAEC,MAAM,IAAI,CAAC;UACzCC,KAAK,EAAEX,OAAO,EAAES,WAAW,EAAEE,KAAK,IAAI;QACxC,CAAC;QACDC,iBAAiB,EAAE;UACjBF,MAAM,EAAEV,OAAO,EAAEY,iBAAiB,EAAEF,MAAM,IAAI,CAAC;UAC/CC,KAAK,EAAEX,OAAO,EAAEY,iBAAiB,EAAED,KAAK,IAAI;QAC9C,CAAC;QACDE,qBAAqB,EAAE,IAAI;QAC3BC,MAAM,EAAE,CAAC;QACTC,QAAQ,EAAE;UAAEjB,CAAC,EAAE,CAAC;UAAEC,CAAC,EAAE;QAAE;MACzB;IACF,CAAC;EACH;AACF,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { Size } from '../../types';
2
- import { TextRange } from '../utils/text-range';
1
+ import type { Size } from '../../types';
2
+ import type { TextRange } from '../utils/text-range';
3
3
  export declare const TextInputEventBuilder: {
4
4
  /**
5
5
  * Experimental values:
@@ -1 +1 @@
1
- {"version":3,"file":"text-input.js","names":["_base","require","TextInputEventBuilder","exports","change","text","baseSyntheticEvent","nativeEvent","target","eventCount","keyPress","key","submitEditing","endEditing","selectionChange","start","end","selection","contentSizeChange","width","height","contentSize"],"sources":["../../../src/user-event/event-builder/text-input.ts"],"sourcesContent":["import { Size } from '../../types';\nimport { TextRange } from '../utils/text-range';\nimport { baseSyntheticEvent } from './base';\n\nexport const TextInputEventBuilder = {\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"eventCount\": 6, \"target\": 53, \"text\": \"Tes\"}`\n */\n change: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0, eventCount: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 3, \"key\": \"a\", \"target\": 75}`\n * - Android: `{\"key\": \"a\"}`\n */\n keyPress: (key: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { key },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n submitEditing: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n endEditing: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"selection\": {\"end\": 4, \"start\": 4}, \"target\": 75}`\n * - Android: `{\"selection\": {\"end\": 4, \"start\": 4}}`\n */\n selectionChange: ({ start, end }: TextRange) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { selection: { start, end } },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"contentSize\": {\"height\": 21.666666666666668, \"width\": 11.666666666666666}, \"target\": 75}`\n * - Android: `{\"contentSize\": {\"height\": 61.45454406738281, \"width\": 352.7272644042969}, \"target\": 53}`\n */\n contentSizeChange: ({ width, height }: Size) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { contentSize: { width, height }, target: 0 },\n };\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACnC;AACF;AACA;AACA;AACA;EACEE,MAAM,EAAGC,IAAY,IAAK;IACxB,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE,CAAC;QAAEC,UAAU,EAAE;MAAE;IAChD,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,GAAW,IAAK;IACzB,OAAO;MACL,GAAG,IAAAL,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEI;MAAI;IACrB,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,aAAa,EAAGP,IAAY,IAAK;IAC/B,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEK,UAAU,EAAGR,IAAY,IAAK;IAC5B,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEM,eAAe,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAe,CAAC,KAAK;IAC9C,OAAO;MACL,GAAG,IAAAV,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEU,SAAS,EAAE;UAAEF,KAAK;UAAEC;QAAI;MAAE;IAC3C,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEE,iBAAiB,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAC9C,OAAO;MACL,GAAG,IAAAd,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEc,WAAW,EAAE;UAAEF,KAAK;UAAEC;QAAO,CAAC;QAAEZ,MAAM,EAAE;MAAE;IAC3D,CAAC;EACH;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"text-input.js","names":["_base","require","TextInputEventBuilder","exports","change","text","baseSyntheticEvent","nativeEvent","target","eventCount","keyPress","key","submitEditing","endEditing","selectionChange","start","end","selection","contentSizeChange","width","height","contentSize"],"sources":["../../../src/user-event/event-builder/text-input.ts"],"sourcesContent":["import type { Size } from '../../types';\nimport type { TextRange } from '../utils/text-range';\nimport { baseSyntheticEvent } from './base';\n\nexport const TextInputEventBuilder = {\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"eventCount\": 6, \"target\": 53, \"text\": \"Tes\"}`\n */\n change: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0, eventCount: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 3, \"key\": \"a\", \"target\": 75}`\n * - Android: `{\"key\": \"a\"}`\n */\n keyPress: (key: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { key },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n submitEditing: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n endEditing: (text: string) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"selection\": {\"end\": 4, \"start\": 4}, \"target\": 75}`\n * - Android: `{\"selection\": {\"end\": 4, \"start\": 4}}`\n */\n selectionChange: ({ start, end }: TextRange) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { selection: { start, end } },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"contentSize\": {\"height\": 21.666666666666668, \"width\": 11.666666666666666}, \"target\": 75}`\n * - Android: `{\"contentSize\": {\"height\": 61.45454406738281, \"width\": 352.7272644042969}, \"target\": 53}`\n */\n contentSizeChange: ({ width, height }: Size) => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: { contentSize: { width, height }, target: 0 },\n };\n },\n};\n"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACnC;AACF;AACA;AACA;AACA;EACEE,MAAM,EAAGC,IAAY,IAAK;IACxB,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE,CAAC;QAAEC,UAAU,EAAE;MAAE;IAChD,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,GAAW,IAAK;IACzB,OAAO;MACL,GAAG,IAAAL,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEI;MAAI;IACrB,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,aAAa,EAAGP,IAAY,IAAK;IAC/B,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEK,UAAU,EAAGR,IAAY,IAAK;IAC5B,OAAO;MACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEF,IAAI;QAAEG,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEM,eAAe,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAe,CAAC,KAAK;IAC9C,OAAO;MACL,GAAG,IAAAV,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEU,SAAS,EAAE;UAAEF,KAAK;UAAEC;QAAI;MAAE;IAC3C,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEE,iBAAiB,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAC9C,OAAO;MACL,GAAG,IAAAd,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;QAAEc,WAAW,EAAE;UAAEF,KAAK;UAAEC;QAAO,CAAC;QAAEZ,MAAM,EAAE;MAAE;IAC3D,CAAC;EACH;AACF,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { ReactTestInstance } from 'react-test-renderer';
1
+ import type { ReactTestInstance } from 'react-test-renderer';
2
+ import type { PressOptions } from './press';
3
+ import type { ScrollToOptions } from './scroll';
2
4
  import { setup } from './setup';
3
- import { PressOptions } from './press';
4
- import { TypeOptions } from './type';
5
- import { ScrollToOptions } from './scroll';
5
+ import type { TypeOptions } from './type';
6
6
  export { UserEventConfig } from './setup';
7
7
  export declare const userEvent: {
8
8
  setup: typeof setup;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_setup","require","userEvent","exports","setup","press","element","longPress","options","type","text","clear","paste","scrollTo"],"sources":["../../src/user-event/index.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { setup } from './setup';\nimport { PressOptions } from './press';\nimport { TypeOptions } from './type';\nimport { ScrollToOptions } from './scroll';\n\nexport { UserEventConfig } from './setup';\n\nexport const userEvent = {\n setup,\n\n // Direct access for User Event v13 compatibility\n press: (element: ReactTestInstance) => setup().press(element),\n longPress: (element: ReactTestInstance, options?: PressOptions) =>\n setup().longPress(element, options),\n type: (element: ReactTestInstance, text: string, options?: TypeOptions) =>\n setup().type(element, text, options),\n clear: (element: ReactTestInstance) => setup().clear(element),\n paste: (element: ReactTestInstance, text: string) => setup().paste(element, text),\n scrollTo: (element: ReactTestInstance, options: ScrollToOptions) =>\n setup().scrollTo(element, options),\n};\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAOO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvBE,KAAK,EAALA,YAAK;EAEL;EACAC,KAAK,EAAGC,OAA0B,IAAK,IAAAF,YAAK,EAAC,CAAC,CAACC,KAAK,CAACC,OAAO,CAAC;EAC7DC,SAAS,EAAEA,CAACD,OAA0B,EAAEE,OAAsB,KAC5D,IAAAJ,YAAK,EAAC,CAAC,CAACG,SAAS,CAACD,OAAO,EAAEE,OAAO,CAAC;EACrCC,IAAI,EAAEA,CAACH,OAA0B,EAAEI,IAAY,EAAEF,OAAqB,KACpE,IAAAJ,YAAK,EAAC,CAAC,CAACK,IAAI,CAACH,OAAO,EAAEI,IAAI,EAAEF,OAAO,CAAC;EACtCG,KAAK,EAAGL,OAA0B,IAAK,IAAAF,YAAK,EAAC,CAAC,CAACO,KAAK,CAACL,OAAO,CAAC;EAC7DM,KAAK,EAAEA,CAACN,OAA0B,EAAEI,IAAY,KAAK,IAAAN,YAAK,EAAC,CAAC,CAACQ,KAAK,CAACN,OAAO,EAAEI,IAAI,CAAC;EACjFG,QAAQ,EAAEA,CAACP,OAA0B,EAAEE,OAAwB,KAC7D,IAAAJ,YAAK,EAAC,CAAC,CAACS,QAAQ,CAACP,OAAO,EAAEE,OAAO;AACrC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_setup","require","userEvent","exports","setup","press","element","longPress","options","type","text","clear","paste","scrollTo"],"sources":["../../src/user-event/index.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport type { PressOptions } from './press';\nimport type { ScrollToOptions } from './scroll';\nimport { setup } from './setup';\nimport type { TypeOptions } from './type';\n\nexport { UserEventConfig } from './setup';\n\nexport const userEvent = {\n setup,\n\n // Direct access for User Event v13 compatibility\n press: (element: ReactTestInstance) => setup().press(element),\n longPress: (element: ReactTestInstance, options?: PressOptions) =>\n setup().longPress(element, options),\n type: (element: ReactTestInstance, text: string, options?: TypeOptions) =>\n setup().type(element, text, options),\n clear: (element: ReactTestInstance) => setup().clear(element),\n paste: (element: ReactTestInstance, text: string) => setup().paste(element, text),\n scrollTo: (element: ReactTestInstance, options: ScrollToOptions) =>\n setup().scrollTo(element, options),\n};\n"],"mappings":";;;;;;;;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AAKO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvBE,KAAK,EAALA,YAAK;EAEL;EACAC,KAAK,EAAGC,OAA0B,IAAK,IAAAF,YAAK,EAAC,CAAC,CAACC,KAAK,CAACC,OAAO,CAAC;EAC7DC,SAAS,EAAEA,CAACD,OAA0B,EAAEE,OAAsB,KAC5D,IAAAJ,YAAK,EAAC,CAAC,CAACG,SAAS,CAACD,OAAO,EAAEE,OAAO,CAAC;EACrCC,IAAI,EAAEA,CAACH,OAA0B,EAAEI,IAAY,EAAEF,OAAqB,KACpE,IAAAJ,YAAK,EAAC,CAAC,CAACK,IAAI,CAACH,OAAO,EAAEI,IAAI,EAAEF,OAAO,CAAC;EACtCG,KAAK,EAAGL,OAA0B,IAAK,IAAAF,YAAK,EAAC,CAAC,CAACO,KAAK,CAACL,OAAO,CAAC;EAC7DM,KAAK,EAAEA,CAACN,OAA0B,EAAEI,IAAY,KAAK,IAAAN,YAAK,EAAC,CAAC,CAACQ,KAAK,CAACN,OAAO,EAAEI,IAAI,CAAC;EACjFG,QAAQ,EAAEA,CAACP,OAA0B,EAAEE,OAAwB,KAC7D,IAAAJ,YAAK,EAAC,CAAC,CAACS,QAAQ,CAACP,OAAO,EAAEE,OAAO;AACrC,CAAC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { ReactTestInstance } from 'react-test-renderer';
2
- import { UserEventInstance } from './setup';
1
+ import type { ReactTestInstance } from 'react-test-renderer';
2
+ import type { UserEventInstance } from './setup';
3
3
  export declare function paste(this: UserEventInstance, element: ReactTestInstance, text: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"paste.js","names":["_errors","require","_hostComponentNames","_pointerEvents","_textInput","_nativeState","_eventBuilder","_utils","paste","element","text","isHostTextInput","ErrorWithStack","type","isEditableTextInput","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","textToClear","getTextInputValue","rangeToClear","start","end","length","TextInput","selectionChange","nativeState","valueForElement","set","change","rangeAfter","isMultiline","props","multiline","contentSize","getTextContentSize","contentSizeChange","wait","config","endEditing","blur"],"sources":["../../src/user-event/paste.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { getTextInputValue, isEditableTextInput } from '../helpers/text-input';\nimport { nativeState } from '../native-state';\nimport { EventBuilder } from './event-builder';\nimport { UserEventInstance } from './setup';\nimport { dispatchEvent, getTextContentSize, wait } from './utils';\n\nexport async function paste(\n this: UserEventInstance,\n element: ReactTestInstance,\n text: string,\n): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `paste() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n paste,\n );\n }\n\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const textToClear = getTextInputValue(element);\n const rangeToClear = { start: 0, end: textToClear.length };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(rangeToClear));\n\n // 3. Paste the text\n nativeState.valueForElement.set(element, text);\n dispatchEvent(element, 'change', EventBuilder.TextInput.change(text));\n dispatchEvent(element, 'changeText', text);\n\n const rangeAfter = { start: text.length, end: text.length };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(rangeAfter));\n\n // According to the docs only multiline TextInput emits contentSizeChange event\n // @see: https://reactnative.dev/docs/textinput#oncontentsizechange\n const isMultiline = element.props.multiline === true;\n if (isMultiline) {\n const contentSize = getTextContentSize(text);\n dispatchEvent(\n element,\n 'contentSizeChange',\n EventBuilder.TextInput.contentSizeChange(contentSize),\n );\n }\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(text));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAEO,eAAeO,KAAKA,CAEzBC,OAA0B,EAC1BC,IAAY,EACG;EACf,IAAI,CAAC,IAAAC,mCAAe,EAACF,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIG,sBAAc,CACtB,8EAA8EH,OAAO,CAACI,IAAI,IAAI,EAC9FL,KACF,CAAC;EACH;EAEA,IAAI,CAAC,IAAAM,8BAAmB,EAACL,OAAO,CAAC,IAAI,CAAC,IAAAM,oCAAqB,EAACN,OAAO,CAAC,EAAE;IACpE;EACF;;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,OAAO,EAAE,YAAY,EAAEQ,0BAAY,CAACS,SAAS,CAACe,UAAU,CAAC/B,IAAI,CAAC,CAAC;EAC7E,IAAAM,oBAAa,EAACP,OAAO,EAAE,MAAM,EAAEQ,0BAAY,CAACC,MAAM,CAACwB,IAAI,CAAC,CAAC,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"file":"paste.js","names":["_errors","require","_hostComponentNames","_pointerEvents","_textInput","_nativeState","_eventBuilder","_utils","paste","element","text","isHostTextInput","ErrorWithStack","type","isEditableTextInput","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","textToClear","getTextInputValue","rangeToClear","start","end","length","TextInput","selectionChange","nativeState","valueForElement","set","change","rangeAfter","isMultiline","props","multiline","contentSize","getTextContentSize","contentSizeChange","wait","config","endEditing","blur"],"sources":["../../src/user-event/paste.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { getTextInputValue, isEditableTextInput } from '../helpers/text-input';\nimport { nativeState } from '../native-state';\nimport { EventBuilder } from './event-builder';\nimport type { UserEventInstance } from './setup';\nimport { dispatchEvent, getTextContentSize, wait } from './utils';\n\nexport async function paste(\n this: UserEventInstance,\n element: ReactTestInstance,\n text: string,\n): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `paste() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n paste,\n );\n }\n\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const textToClear = getTextInputValue(element);\n const rangeToClear = { start: 0, end: textToClear.length };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(rangeToClear));\n\n // 3. Paste the text\n nativeState.valueForElement.set(element, text);\n dispatchEvent(element, 'change', EventBuilder.TextInput.change(text));\n dispatchEvent(element, 'changeText', text);\n\n const rangeAfter = { start: text.length, end: text.length };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(rangeAfter));\n\n // According to the docs only multiline TextInput emits contentSizeChange event\n // @see: https://reactnative.dev/docs/textinput#oncontentsizechange\n const isMultiline = element.props.multiline === true;\n if (isMultiline) {\n const contentSize = getTextContentSize(text);\n dispatchEvent(\n element,\n 'contentSizeChange',\n EventBuilder.TextInput.contentSizeChange(contentSize),\n );\n }\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(text));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAEO,eAAeO,KAAKA,CAEzBC,OAA0B,EAC1BC,IAAY,EACG;EACf,IAAI,CAAC,IAAAC,mCAAe,EAACF,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIG,sBAAc,CACtB,8EAA8EH,OAAO,CAACI,IAAI,IAAI,EAC9FL,KACF,CAAC;EACH;EAEA,IAAI,CAAC,IAAAM,8BAAmB,EAACL,OAAO,CAAC,IAAI,CAAC,IAAAM,oCAAqB,EAACN,OAAO,CAAC,EAAE;IACpE;EACF;;EAEA;EACA,IAAAO,oBAAa,EAACP,OAAO,EAAE,OAAO,EAAEQ,0BAAY,CAACC,MAAM,CAACC,KAAK,CAAC,CAAC,CAAC;;EAE5D;EACA,MAAMC,WAAW,GAAG,IAAAC,4BAAiB,EAACZ,OAAO,CAAC;EAC9C,MAAMa,YAAY,GAAG;IAAEC,KAAK,EAAE,CAAC;I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export { PressOptions, press, longPress } from './press';
1
+ export { longPress, press, PressOptions } from './press';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_press","require"],"sources":["../../../src/user-event/press/index.ts"],"sourcesContent":["export { PressOptions, press, longPress } from './press';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_press","require"],"sources":["../../../src/user-event/press/index.ts"],"sourcesContent":["export { longPress, press, PressOptions } from './press';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { ReactTestInstance } from 'react-test-renderer';
2
- import { UserEventInstance } from '../setup';
1
+ import type { ReactTestInstance } from 'react-test-renderer';
2
+ import type { UserEventInstance } from '../setup';
3
3
  export declare const DEFAULT_MIN_PRESS_DURATION = 130;
4
4
  export declare const DEFAULT_LONG_PRESS_DELAY_MS = 500;
5
5
  export interface PressOptions {