@testing-library/react-native 14.0.0-alpha.6 → 14.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +30 -30
  2. package/build/config.js +10 -4
  3. package/build/config.js.map +1 -1
  4. package/build/event-builder/base.d.ts +7 -0
  5. package/build/{user-event/event-builder → event-builder}/base.js +1 -1
  6. package/build/event-builder/base.js.map +1 -0
  7. package/build/event-builder/common.d.ts +152 -0
  8. package/build/event-builder/common.js +80 -0
  9. package/build/event-builder/common.js.map +1 -0
  10. package/build/event-builder/index.d.ts +3 -0
  11. package/build/event-builder/index.js +39 -0
  12. package/build/event-builder/index.js.map +1 -0
  13. package/build/event-builder/scroll.d.ts +56 -0
  14. package/build/event-builder/scroll.js +51 -0
  15. package/build/event-builder/scroll.js.map +1 -0
  16. package/build/event-builder/text.d.ts +162 -0
  17. package/build/event-builder/text.js +113 -0
  18. package/build/event-builder/text.js.map +1 -0
  19. package/build/event-handler.d.ts +0 -1
  20. package/build/event-handler.js +0 -1
  21. package/build/event-handler.js.map +1 -1
  22. package/build/fire-event.d.ts +6 -7
  23. package/build/fire-event.js +47 -28
  24. package/build/fire-event.js.map +1 -1
  25. package/build/helpers/accessibility.d.ts +18 -15
  26. package/build/helpers/accessibility.js +64 -47
  27. package/build/helpers/accessibility.js.map +1 -1
  28. package/build/helpers/component-tree.d.ts +9 -9
  29. package/build/helpers/component-tree.js +17 -17
  30. package/build/helpers/component-tree.js.map +1 -1
  31. package/build/helpers/errors.d.ts +1 -3
  32. package/build/helpers/errors.js +3 -36
  33. package/build/helpers/errors.js.map +1 -1
  34. package/build/helpers/find-all.d.ts +2 -2
  35. package/build/helpers/find-all.js +1 -1
  36. package/build/helpers/find-all.js.map +1 -1
  37. package/build/helpers/format-element.d.ts +5 -5
  38. package/build/helpers/format-element.js +9 -9
  39. package/build/helpers/format-element.js.map +1 -1
  40. package/build/helpers/host-component-names.d.ts +13 -13
  41. package/build/helpers/host-component-names.js +18 -18
  42. package/build/helpers/host-component-names.js.map +1 -1
  43. package/build/helpers/matchers/match-accessibility-state.d.ts +2 -2
  44. package/build/helpers/matchers/match-accessibility-state.js +6 -6
  45. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  46. package/build/helpers/matchers/match-accessibility-value.d.ts +2 -2
  47. package/build/helpers/matchers/match-accessibility-value.js +2 -2
  48. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  49. package/build/helpers/matchers/match-label-text.d.ts +2 -2
  50. package/build/helpers/matchers/match-label-text.js +2 -2
  51. package/build/helpers/matchers/match-label-text.js.map +1 -1
  52. package/build/helpers/matchers/match-text-content.d.ts +5 -5
  53. package/build/helpers/matchers/match-text-content.js +5 -5
  54. package/build/helpers/matchers/match-text-content.js.map +1 -1
  55. package/build/helpers/pointer-events.d.ts +2 -2
  56. package/build/helpers/pointer-events.js +4 -4
  57. package/build/helpers/pointer-events.js.map +1 -1
  58. package/build/helpers/text-content.d.ts +2 -2
  59. package/build/helpers/text-content.js +5 -5
  60. package/build/helpers/text-content.js.map +1 -1
  61. package/build/helpers/text-input.d.ts +3 -3
  62. package/build/helpers/text-input.js +6 -6
  63. package/build/helpers/text-input.js.map +1 -1
  64. package/build/helpers/validate-options.d.ts +9 -0
  65. package/build/helpers/validate-options.js +32 -0
  66. package/build/helpers/validate-options.js.map +1 -0
  67. package/build/matchers/to-be-busy.d.ts +2 -2
  68. package/build/matchers/to-be-busy.js +5 -5
  69. package/build/matchers/to-be-busy.js.map +1 -1
  70. package/build/matchers/to-be-checked.d.ts +2 -2
  71. package/build/matchers/to-be-checked.js +9 -9
  72. package/build/matchers/to-be-checked.js.map +1 -1
  73. package/build/matchers/to-be-disabled.d.ts +3 -3
  74. package/build/matchers/to-be-disabled.js +10 -10
  75. package/build/matchers/to-be-disabled.js.map +1 -1
  76. package/build/matchers/to-be-empty-element.d.ts +2 -2
  77. package/build/matchers/to-be-empty-element.js +4 -4
  78. package/build/matchers/to-be-empty-element.js.map +1 -1
  79. package/build/matchers/to-be-expanded.d.ts +3 -3
  80. package/build/matchers/to-be-expanded.js +10 -10
  81. package/build/matchers/to-be-expanded.js.map +1 -1
  82. package/build/matchers/to-be-on-the-screen.d.ts +2 -2
  83. package/build/matchers/to-be-on-the-screen.js +7 -7
  84. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  85. package/build/matchers/to-be-partially-checked.d.ts +2 -2
  86. package/build/matchers/to-be-partially-checked.js +8 -8
  87. package/build/matchers/to-be-partially-checked.js.map +1 -1
  88. package/build/matchers/to-be-selected.d.ts +2 -2
  89. package/build/matchers/to-be-selected.js +4 -4
  90. package/build/matchers/to-be-selected.js.map +1 -1
  91. package/build/matchers/to-be-visible.d.ts +2 -2
  92. package/build/matchers/to-be-visible.js +12 -12
  93. package/build/matchers/to-be-visible.js.map +1 -1
  94. package/build/matchers/to-contain-element.d.ts +2 -2
  95. package/build/matchers/to-contain-element.js +6 -6
  96. package/build/matchers/to-contain-element.js.map +1 -1
  97. package/build/matchers/to-have-accessibility-value.d.ts +2 -2
  98. package/build/matchers/to-have-accessibility-value.js +6 -6
  99. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  100. package/build/matchers/to-have-accessible-name.d.ts +2 -2
  101. package/build/matchers/to-have-accessible-name.js +5 -10
  102. package/build/matchers/to-have-accessible-name.js.map +1 -1
  103. package/build/matchers/to-have-display-value.d.ts +2 -2
  104. package/build/matchers/to-have-display-value.js +6 -6
  105. package/build/matchers/to-have-display-value.js.map +1 -1
  106. package/build/matchers/to-have-prop.d.ts +2 -2
  107. package/build/matchers/to-have-prop.js +6 -6
  108. package/build/matchers/to-have-prop.js.map +1 -1
  109. package/build/matchers/to-have-style.d.ts +2 -2
  110. package/build/matchers/to-have-style.js +5 -5
  111. package/build/matchers/to-have-style.js.map +1 -1
  112. package/build/matchers/to-have-text-content.d.ts +2 -2
  113. package/build/matchers/to-have-text-content.js +4 -4
  114. package/build/matchers/to-have-text-content.js.map +1 -1
  115. package/build/matchers/types.d.ts +20 -20
  116. package/build/matchers/types.js.map +1 -1
  117. package/build/matchers/utils.d.ts +4 -4
  118. package/build/matchers/utils.js +6 -6
  119. package/build/matchers/utils.js.map +1 -1
  120. package/build/native-state.d.ts +3 -3
  121. package/build/native-state.js +2 -2
  122. package/build/native-state.js.map +1 -1
  123. package/build/queries/display-value.d.ts +2 -2
  124. package/build/queries/display-value.js +12 -12
  125. package/build/queries/display-value.js.map +1 -1
  126. package/build/queries/hint-text.d.ts +2 -2
  127. package/build/queries/hint-text.js +11 -11
  128. package/build/queries/hint-text.js.map +1 -1
  129. package/build/queries/label-text.d.ts +2 -2
  130. package/build/queries/label-text.js +9 -9
  131. package/build/queries/label-text.js.map +1 -1
  132. package/build/queries/make-queries.d.ts +8 -8
  133. package/build/queries/make-queries.js +11 -11
  134. package/build/queries/make-queries.js.map +1 -1
  135. package/build/queries/placeholder-text.d.ts +2 -2
  136. package/build/queries/placeholder-text.js +11 -11
  137. package/build/queries/placeholder-text.js.map +1 -1
  138. package/build/queries/role.d.ts +2 -2
  139. package/build/queries/role.js +17 -27
  140. package/build/queries/role.js.map +1 -1
  141. package/build/queries/test-id.d.ts +2 -2
  142. package/build/queries/test-id.js +11 -11
  143. package/build/queries/test-id.js.map +1 -1
  144. package/build/queries/text.d.ts +2 -2
  145. package/build/queries/text.js +9 -9
  146. package/build/queries/text.js.map +1 -1
  147. package/build/render-hook.js +7 -1
  148. package/build/render-hook.js.map +1 -1
  149. package/build/render.d.ts +4 -5
  150. package/build/render.js +22 -6
  151. package/build/render.js.map +1 -1
  152. package/build/screen.js.map +1 -1
  153. package/build/test-utils/react-version-gates.d.ts +1 -0
  154. package/build/test-utils/react-version-gates.js +28 -0
  155. package/build/test-utils/react-version-gates.js.map +1 -0
  156. package/build/test-utils/timers.d.ts +2 -0
  157. package/build/test-utils/timers.js +20 -0
  158. package/build/test-utils/timers.js.map +1 -0
  159. package/build/types.d.ts +7 -0
  160. package/build/types.js.map +1 -1
  161. package/build/user-event/clear.d.ts +2 -2
  162. package/build/user-event/clear.js +13 -13
  163. package/build/user-event/clear.js.map +1 -1
  164. package/build/user-event/index.d.ts +7 -7
  165. package/build/user-event/index.js +6 -6
  166. package/build/user-event/index.js.map +1 -1
  167. package/build/user-event/paste.d.ts +2 -2
  168. package/build/user-event/paste.js +18 -18
  169. package/build/user-event/paste.js.map +1 -1
  170. package/build/user-event/press/press.d.ts +3 -3
  171. package/build/user-event/press/press.js +35 -35
  172. package/build/user-event/press/press.js.map +1 -1
  173. package/build/user-event/scroll/scroll-to.d.ts +2 -2
  174. package/build/user-event/scroll/scroll-to.js +20 -20
  175. package/build/user-event/scroll/scroll-to.js.map +1 -1
  176. package/build/user-event/setup/setup.d.ts +11 -11
  177. package/build/user-event/setup/setup.js +17 -3
  178. package/build/user-event/setup/setup.js.map +1 -1
  179. package/build/user-event/type/type.d.ts +3 -3
  180. package/build/user-event/type/type.js +27 -28
  181. package/build/user-event/type/type.js.map +1 -1
  182. package/build/user-event/utils/dispatch-event.d.ts +3 -3
  183. package/build/user-event/utils/dispatch-event.js +4 -4
  184. package/build/user-event/utils/dispatch-event.js.map +1 -1
  185. package/build/user-event/utils/index.d.ts +0 -1
  186. package/build/user-event/utils/index.js +0 -11
  187. package/build/user-event/utils/index.js.map +1 -1
  188. package/build/wait-for.js +8 -13
  189. package/build/wait-for.js.map +1 -1
  190. package/build/within.d.ts +3 -3
  191. package/build/within.js +10 -10
  192. package/build/within.js.map +1 -1
  193. package/package.json +38 -27
  194. package/build/react-versions.d.ts +0 -1
  195. package/build/react-versions.js +0 -14
  196. package/build/react-versions.js.map +0 -1
  197. package/build/tsconfig.release.tsbuildinfo +0 -1
  198. package/build/user-event/event-builder/base.d.ts +0 -3
  199. package/build/user-event/event-builder/base.js.map +0 -1
  200. package/build/user-event/event-builder/common.d.ts +0 -150
  201. package/build/user-event/event-builder/common.js +0 -77
  202. package/build/user-event/event-builder/common.js.map +0 -1
  203. package/build/user-event/event-builder/index.d.ts +0 -306
  204. package/build/user-event/event-builder/index.js +0 -15
  205. package/build/user-event/event-builder/index.js.map +0 -1
  206. package/build/user-event/event-builder/scroll-view.d.ts +0 -57
  207. package/build/user-event/event-builder/scroll-view.js +0 -53
  208. package/build/user-event/event-builder/scroll-view.js.map +0 -1
  209. package/build/user-event/event-builder/text-input.d.ts +0 -159
  210. package/build/user-event/event-builder/text-input.js +0 -105
  211. package/build/user-event/event-builder/text-input.js.map +0 -1
  212. package/build/user-event/utils/text-range.d.ts +0 -4
  213. package/build/user-event/utils/text-range.js +0 -6
  214. package/build/user-event/utils/text-range.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"format-element.js","names":["_prettyFormat","_interopRequireWildcard","require","_mapProps","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","formatElement","element","compact","highlight","mapProps","defaultMapProps","children","props","childrenToDisplay","undefined","prettyFormat","$$typeof","Symbol","for","type","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","min","formatElementList","elements","options","length","map","join","formatJson","json","getElementJsonPlugin","test","val","serialize","config","indentation","depth","refs","printer","newVal"],"sources":["../../src/helpers/format-element.ts"],"sourcesContent":["import type { NewPlugin } from 'pretty-format';\nimport prettyFormat, { plugins } from 'pretty-format';\nimport type { HostElement, JsonNode } from 'test-renderer';\n\nimport type { MapPropsFunction } from './map-props';\nimport { defaultMapProps } from './map-props';\n\nexport type FormatElementOptions = {\n /** Minimize used space. */\n compact?: boolean;\n\n /** Highlight the output. */\n highlight?: boolean;\n\n /** Filter or map props to display. */\n mapProps?: MapPropsFunction | null;\n};\n\n/***\n * Format given element as a pretty-printed string.\n *\n * @param element Element to format.\n */\nexport function formatElement(\n element: HostElement | null,\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n if (element == null) {\n return '(null)';\n }\n\n const { children, ...props } = element.props;\n const childrenToDisplay = typeof children === 'string' ? [children] : undefined;\n\n return prettyFormat(\n {\n // This prop is needed persuade the prettyFormat that the element is\n // a JsonNode instance, so it is formatted as JSX.\n $$typeof: Symbol.for('react.test.json'),\n type: `${element.type}`,\n props: mapProps ? mapProps(props) : props,\n children: childrenToDisplay,\n },\n // See: https://www.npmjs.com/package/pretty-format#usage-with-options\n {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n printFunctionName: false,\n printBasicPrototype: false,\n highlight: highlight,\n min: compact,\n },\n );\n}\n\nexport function formatElementList(elements: HostElement[], options?: FormatElementOptions) {\n if (elements.length === 0) {\n return '(no elements)';\n }\n\n return elements.map((element) => formatElement(element, options)).join('\\n');\n}\n\nexport function formatJson(\n json: JsonNode | JsonNode[],\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n return prettyFormat(json, {\n plugins: [getElementJsonPlugin(mapProps), plugins.ReactElement],\n highlight: highlight,\n printBasicPrototype: false,\n min: compact,\n });\n}\n\nfunction getElementJsonPlugin(mapProps?: MapPropsFunction | null): NewPlugin {\n return {\n test: (val) => plugins.ReactTestComponent.test(val),\n serialize: (val, config, indentation, depth, refs, printer) => {\n let newVal = val;\n if (mapProps && val.props) {\n newVal = { ...val, props: mapProps(val.props) };\n }\n return plugins.ReactTestComponent.serialize(\n newVal,\n config,\n indentation,\n depth,\n refs,\n printer,\n );\n },\n };\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"format-element.js","names":["_prettyFormat","_interopRequireWildcard","require","_mapProps","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","formatElement","instance","compact","highlight","mapProps","defaultMapProps","children","props","childrenToDisplay","undefined","prettyFormat","$$typeof","Symbol","for","type","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","min","formatElementList","instances","options","length","map","join","formatJson","json","getElementJsonPlugin","test","val","serialize","config","indentation","depth","refs","printer","newVal"],"sources":["../../src/helpers/format-element.ts"],"sourcesContent":["import type { NewPlugin } from 'pretty-format';\nimport prettyFormat, { plugins } from 'pretty-format';\nimport type { JsonNode, TestInstance } from 'test-renderer';\n\nimport type { MapPropsFunction } from './map-props';\nimport { defaultMapProps } from './map-props';\n\nexport type FormatElementOptions = {\n /** Minimize used space. */\n compact?: boolean;\n\n /** Highlight the output. */\n highlight?: boolean;\n\n /** Filter or map props to display. */\n mapProps?: MapPropsFunction | null;\n};\n\n/***\n * Format given instance as a pretty-printed string.\n *\n * @param instance Instance to format.\n */\nexport function formatElement(\n instance: TestInstance | null,\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n if (instance == null) {\n return '(null)';\n }\n\n const { children, ...props } = instance.props;\n const childrenToDisplay = typeof children === 'string' ? [children] : undefined;\n\n return prettyFormat(\n {\n // This prop is needed persuade the prettyFormat that the element is\n // a JsonNode instance, so it is formatted as JSX.\n $$typeof: Symbol.for('react.test.json'),\n type: `${instance.type}`,\n props: mapProps ? mapProps(props) : props,\n children: childrenToDisplay,\n },\n // See: https://www.npmjs.com/package/pretty-format#usage-with-options\n {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n printFunctionName: false,\n printBasicPrototype: false,\n highlight: highlight,\n min: compact,\n },\n );\n}\n\nexport function formatElementList(instances: TestInstance[], options?: FormatElementOptions) {\n if (instances.length === 0) {\n return '(no elements)';\n }\n\n return instances.map((instance) => formatElement(instance, options)).join('\\n');\n}\n\nexport function formatJson(\n json: JsonNode | JsonNode[],\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n return prettyFormat(json, {\n plugins: [getElementJsonPlugin(mapProps), plugins.ReactElement],\n highlight: highlight,\n printBasicPrototype: false,\n min: compact,\n });\n}\n\nfunction getElementJsonPlugin(mapProps?: MapPropsFunction | null): NewPlugin {\n return {\n test: (val) => plugins.ReactTestComponent.test(val),\n serialize: (val, config, indentation, depth, refs, printer) => {\n let newVal = val;\n if (mapProps && val.props) {\n newVal = { ...val, props: mapProps(val.props) };\n }\n return plugins.ReactTestComponent.serialize(\n newVal,\n config,\n indentation,\n depth,\n refs,\n printer,\n );\n },\n };\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,32 +1,32 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  export declare const HOST_TEXT_NAMES: string[];
3
3
  /**
4
4
  * Checks if the given element is a host Text element.
5
- * @param element The element to check.
5
+ * @param instance The instance to check.
6
6
  */
7
- export declare function isHostText(element: HostElement | null): boolean;
7
+ export declare function isHostText(instance: TestInstance | null): boolean;
8
8
  /**
9
9
  * Checks if the given element is a host TextInput element.
10
- * @param element The element to check.
10
+ * @param instance The instance to check.
11
11
  */
12
- export declare function isHostTextInput(element: HostElement | null): boolean;
12
+ export declare function isHostTextInput(instance: TestInstance | null): boolean;
13
13
  /**
14
14
  * Checks if the given element is a host Image element.
15
- * @param element The element to check.
15
+ * @param instance The instance to check.
16
16
  */
17
- export declare function isHostImage(element: HostElement | null): boolean;
17
+ export declare function isHostImage(instance: TestInstance | null): boolean;
18
18
  /**
19
19
  * Checks if the given element is a host Switch element.
20
- * @param element The element to check.
20
+ * @param instance The instance to check.
21
21
  */
22
- export declare function isHostSwitch(element: HostElement | null): boolean;
22
+ export declare function isHostSwitch(instance: TestInstance | null): boolean;
23
23
  /**
24
24
  * Checks if the given element is a host ScrollView element.
25
- * @param element The element to check.
25
+ * @param instance The instance to check.
26
26
  */
27
- export declare function isHostScrollView(element: HostElement | null): boolean;
27
+ export declare function isHostScrollView(instance: TestInstance | null): boolean;
28
28
  /**
29
29
  * Checks if the given element is a host Modal element.
30
- * @param element The element to check.
30
+ * @param instance The instance to check.
31
31
  */
32
- export declare function isHostModal(element: HostElement | null): boolean;
32
+ export declare function isHostModal(instance: TestInstance | null): boolean;
@@ -19,49 +19,49 @@ const HOST_MODAL_NAMES = ['Modal'];
19
19
 
20
20
  /**
21
21
  * Checks if the given element is a host Text element.
22
- * @param element The element to check.
22
+ * @param instance The instance to check.
23
23
  */
24
- function isHostText(element) {
25
- return typeof element?.type === 'string' && HOST_TEXT_NAMES.includes(element.type);
24
+ function isHostText(instance) {
25
+ return typeof instance?.type === 'string' && HOST_TEXT_NAMES.includes(instance.type);
26
26
  }
27
27
 
28
28
  /**
29
29
  * Checks if the given element is a host TextInput element.
30
- * @param element The element to check.
30
+ * @param instance The instance to check.
31
31
  */
32
- function isHostTextInput(element) {
33
- return typeof element?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(element.type);
32
+ function isHostTextInput(instance) {
33
+ return typeof instance?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(instance.type);
34
34
  }
35
35
 
36
36
  /**
37
37
  * Checks if the given element is a host Image element.
38
- * @param element The element to check.
38
+ * @param instance The instance to check.
39
39
  */
40
- function isHostImage(element) {
41
- return typeof element?.type === 'string' && HOST_IMAGE_NAMES.includes(element.type);
40
+ function isHostImage(instance) {
41
+ return typeof instance?.type === 'string' && HOST_IMAGE_NAMES.includes(instance.type);
42
42
  }
43
43
 
44
44
  /**
45
45
  * Checks if the given element is a host Switch element.
46
- * @param element The element to check.
46
+ * @param instance The instance to check.
47
47
  */
48
- function isHostSwitch(element) {
49
- return typeof element?.type === 'string' && HOST_SWITCH_NAMES.includes(element.type);
48
+ function isHostSwitch(instance) {
49
+ return typeof instance?.type === 'string' && HOST_SWITCH_NAMES.includes(instance.type);
50
50
  }
51
51
 
52
52
  /**
53
53
  * Checks if the given element is a host ScrollView element.
54
- * @param element The element to check.
54
+ * @param instance The instance to check.
55
55
  */
56
- function isHostScrollView(element) {
57
- return typeof element?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(element.type);
56
+ function isHostScrollView(instance) {
57
+ return typeof instance?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(instance.type);
58
58
  }
59
59
 
60
60
  /**
61
61
  * Checks if the given element is a host Modal element.
62
- * @param element The element to check.
62
+ * @param instance The instance to check.
63
63
  */
64
- function isHostModal(element) {
65
- return typeof element?.type === 'string' && HOST_MODAL_NAMES.includes(element.type);
64
+ function isHostModal(instance) {
65
+ return typeof instance?.type === 'string' && HOST_MODAL_NAMES.includes(instance.type);
66
66
  }
67
67
  //# sourceMappingURL=host-component-names.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-component-names.js","names":["HOST_TEXT_NAMES","exports","HOST_TEXT_INPUT_NAMES","HOST_IMAGE_NAMES","HOST_SWITCH_NAMES","HOST_SCROLL_VIEW_NAMES","HOST_MODAL_NAMES","isHostText","element","type","includes","isHostTextInput","isHostImage","isHostSwitch","isHostScrollView","isHostModal"],"sources":["../../src/helpers/host-component-names.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nexport const HOST_TEXT_NAMES = ['Text', 'RCTText'];\nconst HOST_TEXT_INPUT_NAMES = ['TextInput'];\nconst HOST_IMAGE_NAMES = ['Image'];\nconst HOST_SWITCH_NAMES = ['RCTSwitch'];\nconst HOST_SCROLL_VIEW_NAMES = ['RCTScrollView'];\nconst HOST_MODAL_NAMES = ['Modal'];\n\n/**\n * Checks if the given element is a host Text element.\n * @param element The element to check.\n */\nexport function isHostText(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host TextInput element.\n * @param element The element to check.\n */\nexport function isHostTextInput(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Image element.\n * @param element The element to check.\n */\nexport function isHostImage(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_IMAGE_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Switch element.\n * @param element The element to check.\n */\nexport function isHostSwitch(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SWITCH_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host ScrollView element.\n * @param element The element to check.\n */\nexport function isHostScrollView(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Modal element.\n * @param element The element to check.\n */\nexport function isHostModal(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_MODAL_NAMES.includes(element.type);\n}\n"],"mappings":";;;;;;;;;;;;AAEO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;AAClD,MAAME,qBAAqB,GAAG,CAAC,WAAW,CAAC;AAC3C,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;AAClC,MAAMC,iBAAiB,GAAG,CAAC,WAAW,CAAC;AACvC,MAAMC,sBAAsB,GAAG,CAAC,eAAe,CAAC;AAChD,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;;AAElC;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,OAA2B,EAAE;EACtD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIT,eAAe,CAACU,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACpF;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACH,OAA2B,EAAE;EAC3D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIP,qBAAqB,CAACQ,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC1F;;AAEA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACJ,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIN,gBAAgB,CAACO,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF;;AAEA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAACL,OAA2B,EAAE;EACxD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIL,iBAAiB,CAACM,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACtF;;AAEA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAACN,OAA2B,EAAE;EAC5D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIJ,sBAAsB,CAACK,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC3F;;AAEA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAACP,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIH,gBAAgB,CAACI,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF","ignoreList":[]}
1
+ {"version":3,"file":"host-component-names.js","names":["HOST_TEXT_NAMES","exports","HOST_TEXT_INPUT_NAMES","HOST_IMAGE_NAMES","HOST_SWITCH_NAMES","HOST_SCROLL_VIEW_NAMES","HOST_MODAL_NAMES","isHostText","instance","type","includes","isHostTextInput","isHostImage","isHostSwitch","isHostScrollView","isHostModal"],"sources":["../../src/helpers/host-component-names.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nexport const HOST_TEXT_NAMES = ['Text', 'RCTText'];\nconst HOST_TEXT_INPUT_NAMES = ['TextInput'];\nconst HOST_IMAGE_NAMES = ['Image'];\nconst HOST_SWITCH_NAMES = ['RCTSwitch'];\nconst HOST_SCROLL_VIEW_NAMES = ['RCTScrollView'];\nconst HOST_MODAL_NAMES = ['Modal'];\n\n/**\n * Checks if the given element is a host Text element.\n * @param instance The instance to check.\n */\nexport function isHostText(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_TEXT_NAMES.includes(instance.type);\n}\n\n/**\n * Checks if the given element is a host TextInput element.\n * @param instance The instance to check.\n */\nexport function isHostTextInput(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(instance.type);\n}\n\n/**\n * Checks if the given element is a host Image element.\n * @param instance The instance to check.\n */\nexport function isHostImage(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_IMAGE_NAMES.includes(instance.type);\n}\n\n/**\n * Checks if the given element is a host Switch element.\n * @param instance The instance to check.\n */\nexport function isHostSwitch(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_SWITCH_NAMES.includes(instance.type);\n}\n\n/**\n * Checks if the given element is a host ScrollView element.\n * @param instance The instance to check.\n */\nexport function isHostScrollView(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(instance.type);\n}\n\n/**\n * Checks if the given element is a host Modal element.\n * @param instance The instance to check.\n */\nexport function isHostModal(instance: TestInstance | null) {\n return typeof instance?.type === 'string' && HOST_MODAL_NAMES.includes(instance.type);\n}\n"],"mappings":";;;;;;;;;;;;AAEO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;AAClD,MAAME,qBAAqB,GAAG,CAAC,WAAW,CAAC;AAC3C,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;AAClC,MAAMC,iBAAiB,GAAG,CAAC,WAAW,CAAC;AACvC,MAAMC,sBAAsB,GAAG,CAAC,eAAe,CAAC;AAChD,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;;AAElC;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,QAA6B,EAAE;EACxD,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIT,eAAe,CAACU,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AACtF;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACH,QAA6B,EAAE;EAC7D,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIP,qBAAqB,CAACQ,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AAC5F;;AAEA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACJ,QAA6B,EAAE;EACzD,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIN,gBAAgB,CAACO,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AACvF;;AAEA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAACL,QAA6B,EAAE;EAC1D,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIL,iBAAiB,CAACM,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AACxF;;AAEA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAACN,QAA6B,EAAE;EAC9D,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIJ,sBAAsB,CAACK,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AAC7F;;AAEA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAACP,QAA6B,EAAE;EACzD,OAAO,OAAOA,QAAQ,EAAEC,IAAI,KAAK,QAAQ,IAAIH,gBAAgB,CAACI,QAAQ,CAACF,QAAQ,CAACC,IAAI,CAAC;AACvF","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  export interface AccessibilityStateMatcher {
3
3
  disabled?: boolean;
4
4
  selected?: boolean;
@@ -6,4 +6,4 @@ export interface AccessibilityStateMatcher {
6
6
  busy?: boolean;
7
7
  expanded?: boolean;
8
8
  }
9
- export declare function matchAccessibilityState(node: HostElement, matcher: AccessibilityStateMatcher): boolean;
9
+ export declare function matchAccessibilityState(instance: TestInstance, matcher: AccessibilityStateMatcher): boolean;
@@ -10,20 +10,20 @@ var _accessibility = require("../accessibility");
10
10
  // built in `react-native` types.
11
11
  // See: https://github.com/callstack/react-native-testing-library/issues/1351
12
12
 
13
- function matchAccessibilityState(node, matcher) {
14
- if (matcher.busy !== undefined && matcher.busy !== (0, _accessibility.computeAriaBusy)(node)) {
13
+ function matchAccessibilityState(instance, matcher) {
14
+ if (matcher.busy !== undefined && matcher.busy !== (0, _accessibility.computeAriaBusy)(instance)) {
15
15
  return false;
16
16
  }
17
- if (matcher.checked !== undefined && matcher.checked !== (0, _accessibility.computeAriaChecked)(node)) {
17
+ if (matcher.checked !== undefined && matcher.checked !== (0, _accessibility.computeAriaChecked)(instance)) {
18
18
  return false;
19
19
  }
20
- if (matcher.disabled !== undefined && matcher.disabled !== (0, _accessibility.computeAriaDisabled)(node)) {
20
+ if (matcher.disabled !== undefined && matcher.disabled !== (0, _accessibility.computeAriaDisabled)(instance)) {
21
21
  return false;
22
22
  }
23
- if (matcher.expanded !== undefined && matcher.expanded !== (0, _accessibility.computeAriaExpanded)(node)) {
23
+ if (matcher.expanded !== undefined && matcher.expanded !== (0, _accessibility.computeAriaExpanded)(instance)) {
24
24
  return false;
25
25
  }
26
- if (matcher.selected !== undefined && matcher.selected !== (0, _accessibility.computeAriaSelected)(node)) {
26
+ if (matcher.selected !== undefined && matcher.selected !== (0, _accessibility.computeAriaSelected)(instance)) {
27
27
  return false;
28
28
  }
29
29
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"match-accessibility-state.js","names":["_accessibility","require","matchAccessibilityState","node","matcher","busy","undefined","computeAriaBusy","checked","computeAriaChecked","disabled","computeAriaDisabled","expanded","computeAriaExpanded","selected","computeAriaSelected"],"sources":["../../../src/helpers/matchers/match-accessibility-state.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport {\n computeAriaBusy,\n computeAriaChecked,\n computeAriaDisabled,\n computeAriaExpanded,\n computeAriaSelected,\n} from '../accessibility';\n\n// This type is the same as AccessibilityState from `react-native` package\n// It is re-declared here due to issues with migration from `@types/react-native` to\n// built in `react-native` types.\n// See: https://github.com/callstack/react-native-testing-library/issues/1351\nexport interface AccessibilityStateMatcher {\n disabled?: boolean;\n selected?: boolean;\n checked?: boolean | 'mixed';\n busy?: boolean;\n expanded?: boolean;\n}\n\nexport function matchAccessibilityState(node: HostElement, matcher: AccessibilityStateMatcher) {\n if (matcher.busy !== undefined && matcher.busy !== computeAriaBusy(node)) {\n return false;\n }\n if (matcher.checked !== undefined && matcher.checked !== computeAriaChecked(node)) {\n return false;\n }\n if (matcher.disabled !== undefined && matcher.disabled !== computeAriaDisabled(node)) {\n return false;\n }\n if (matcher.expanded !== undefined && matcher.expanded !== computeAriaExpanded(node)) {\n return false;\n }\n if (matcher.selected !== undefined && matcher.selected !== computeAriaSelected(node)) {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAQA;AACA;AACA;AACA;;AASO,SAASC,uBAAuBA,CAACC,IAAiB,EAAEC,OAAkC,EAAE;EAC7F,IAAIA,OAAO,CAACC,IAAI,KAAKC,SAAS,IAAIF,OAAO,CAACC,IAAI,KAAK,IAAAE,8BAAe,EAACJ,IAAI,CAAC,EAAE;IACxE,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACI,OAAO,KAAKF,SAAS,IAAIF,OAAO,CAACI,OAAO,KAAK,IAAAC,iCAAkB,EAACN,IAAI,CAAC,EAAE;IACjF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACM,QAAQ,KAAKJ,SAAS,IAAIF,OAAO,CAACM,QAAQ,KAAK,IAAAC,kCAAmB,EAACR,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACQ,QAAQ,KAAKN,SAAS,IAAIF,OAAO,CAACQ,QAAQ,KAAK,IAAAC,kCAAmB,EAACV,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACU,QAAQ,KAAKR,SAAS,IAAIF,OAAO,CAACU,QAAQ,KAAK,IAAAC,kCAAmB,EAACZ,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
1
+ {"version":3,"file":"match-accessibility-state.js","names":["_accessibility","require","matchAccessibilityState","instance","matcher","busy","undefined","computeAriaBusy","checked","computeAriaChecked","disabled","computeAriaDisabled","expanded","computeAriaExpanded","selected","computeAriaSelected"],"sources":["../../../src/helpers/matchers/match-accessibility-state.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nimport {\n computeAriaBusy,\n computeAriaChecked,\n computeAriaDisabled,\n computeAriaExpanded,\n computeAriaSelected,\n} from '../accessibility';\n\n// This type is the same as AccessibilityState from `react-native` package\n// It is re-declared here due to issues with migration from `@types/react-native` to\n// built in `react-native` types.\n// See: https://github.com/callstack/react-native-testing-library/issues/1351\nexport interface AccessibilityStateMatcher {\n disabled?: boolean;\n selected?: boolean;\n checked?: boolean | 'mixed';\n busy?: boolean;\n expanded?: boolean;\n}\n\nexport function matchAccessibilityState(\n instance: TestInstance,\n matcher: AccessibilityStateMatcher,\n) {\n if (matcher.busy !== undefined && matcher.busy !== computeAriaBusy(instance)) {\n return false;\n }\n if (matcher.checked !== undefined && matcher.checked !== computeAriaChecked(instance)) {\n return false;\n }\n if (matcher.disabled !== undefined && matcher.disabled !== computeAriaDisabled(instance)) {\n return false;\n }\n if (matcher.expanded !== undefined && matcher.expanded !== computeAriaExpanded(instance)) {\n return false;\n }\n if (matcher.selected !== undefined && matcher.selected !== computeAriaSelected(instance)) {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAQA;AACA;AACA;AACA;;AASO,SAASC,uBAAuBA,CACrCC,QAAsB,EACtBC,OAAkC,EAClC;EACA,IAAIA,OAAO,CAACC,IAAI,KAAKC,SAAS,IAAIF,OAAO,CAACC,IAAI,KAAK,IAAAE,8BAAe,EAACJ,QAAQ,CAAC,EAAE;IAC5E,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACI,OAAO,KAAKF,SAAS,IAAIF,OAAO,CAACI,OAAO,KAAK,IAAAC,iCAAkB,EAACN,QAAQ,CAAC,EAAE;IACrF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACM,QAAQ,KAAKJ,SAAS,IAAIF,OAAO,CAACM,QAAQ,KAAK,IAAAC,kCAAmB,EAACR,QAAQ,CAAC,EAAE;IACxF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACQ,QAAQ,KAAKN,SAAS,IAAIF,OAAO,CAACQ,QAAQ,KAAK,IAAAC,kCAAmB,EAACV,QAAQ,CAAC,EAAE;IACxF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACU,QAAQ,KAAKR,SAAS,IAAIF,OAAO,CAACU,QAAQ,KAAK,IAAAC,kCAAmB,EAACZ,QAAQ,CAAC,EAAE;IACxF,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  import type { TextMatch } from '../../matches';
3
3
  export interface AccessibilityValueMatcher {
4
4
  min?: number;
@@ -6,4 +6,4 @@ export interface AccessibilityValueMatcher {
6
6
  now?: number;
7
7
  text?: TextMatch;
8
8
  }
9
- export declare function matchAccessibilityValue(node: HostElement, matcher: AccessibilityValueMatcher): boolean;
9
+ export declare function matchAccessibilityValue(instance: TestInstance, matcher: AccessibilityValueMatcher): boolean;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.matchAccessibilityValue = matchAccessibilityValue;
7
7
  var _accessibility = require("../accessibility");
8
8
  var _matchStringProp = require("./match-string-prop");
9
- function matchAccessibilityValue(node, matcher) {
10
- const value = (0, _accessibility.computeAriaValue)(node);
9
+ function matchAccessibilityValue(instance, matcher) {
10
+ const value = (0, _accessibility.computeAriaValue)(instance);
11
11
  return (matcher.min === undefined || matcher.min === value?.min) && (matcher.max === undefined || matcher.max === value?.max) && (matcher.now === undefined || matcher.now === value?.now) && (matcher.text === undefined || (0, _matchStringProp.matchStringProp)(value?.text, matcher.text));
12
12
  }
13
13
  //# sourceMappingURL=match-accessibility-value.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"match-accessibility-value.js","names":["_accessibility","require","_matchStringProp","matchAccessibilityValue","node","matcher","value","computeAriaValue","min","undefined","max","now","text","matchStringProp"],"sources":["../../../src/helpers/matchers/match-accessibility-value.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch } from '../../matches';\nimport { computeAriaValue } from '../accessibility';\nimport { matchStringProp } from './match-string-prop';\n\nexport interface AccessibilityValueMatcher {\n min?: number;\n max?: number;\n now?: number;\n text?: TextMatch;\n}\n\nexport function matchAccessibilityValue(\n node: HostElement,\n matcher: AccessibilityValueMatcher,\n): boolean {\n const value = computeAriaValue(node);\n return (\n (matcher.min === undefined || matcher.min === value?.min) &&\n (matcher.max === undefined || matcher.max === value?.max) &&\n (matcher.now === undefined || matcher.now === value?.now) &&\n (matcher.text === undefined || matchStringProp(value?.text, matcher.text))\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AASO,SAASE,uBAAuBA,CACrCC,IAAiB,EACjBC,OAAkC,EACzB;EACT,MAAMC,KAAK,GAAG,IAAAC,+BAAgB,EAACH,IAAI,CAAC;EACpC,OACE,CAACC,OAAO,CAACG,GAAG,KAAKC,SAAS,IAAIJ,OAAO,CAACG,GAAG,KAAKF,KAAK,EAAEE,GAAG,MACvDH,OAAO,CAACK,GAAG,KAAKD,SAAS,IAAIJ,OAAO,CAACK,GAAG,KAAKJ,KAAK,EAAEI,GAAG,CAAC,KACxDL,OAAO,CAACM,GAAG,KAAKF,SAAS,IAAIJ,OAAO,CAACM,GAAG,KAAKL,KAAK,EAAEK,GAAG,CAAC,KACxDN,OAAO,CAACO,IAAI,KAAKH,SAAS,IAAI,IAAAI,gCAAe,EAACP,KAAK,EAAEM,IAAI,EAAEP,OAAO,CAACO,IAAI,CAAC,CAAC;AAE9E","ignoreList":[]}
1
+ {"version":3,"file":"match-accessibility-value.js","names":["_accessibility","require","_matchStringProp","matchAccessibilityValue","instance","matcher","value","computeAriaValue","min","undefined","max","now","text","matchStringProp"],"sources":["../../../src/helpers/matchers/match-accessibility-value.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nimport type { TextMatch } from '../../matches';\nimport { computeAriaValue } from '../accessibility';\nimport { matchStringProp } from './match-string-prop';\n\nexport interface AccessibilityValueMatcher {\n min?: number;\n max?: number;\n now?: number;\n text?: TextMatch;\n}\n\nexport function matchAccessibilityValue(\n instance: TestInstance,\n matcher: AccessibilityValueMatcher,\n): boolean {\n const value = computeAriaValue(instance);\n return (\n (matcher.min === undefined || matcher.min === value?.min) &&\n (matcher.max === undefined || matcher.max === value?.max) &&\n (matcher.now === undefined || matcher.now === value?.now) &&\n (matcher.text === undefined || matchStringProp(value?.text, matcher.text))\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AASO,SAASE,uBAAuBA,CACrCC,QAAsB,EACtBC,OAAkC,EACzB;EACT,MAAMC,KAAK,GAAG,IAAAC,+BAAgB,EAACH,QAAQ,CAAC;EACxC,OACE,CAACC,OAAO,CAACG,GAAG,KAAKC,SAAS,IAAIJ,OAAO,CAACG,GAAG,KAAKF,KAAK,EAAEE,GAAG,MACvDH,OAAO,CAACK,GAAG,KAAKD,SAAS,IAAIJ,OAAO,CAACK,GAAG,KAAKJ,KAAK,EAAEI,GAAG,CAAC,KACxDL,OAAO,CAACM,GAAG,KAAKF,SAAS,IAAIJ,OAAO,CAACM,GAAG,KAAKL,KAAK,EAAEK,GAAG,CAAC,KACxDN,OAAO,CAACO,IAAI,KAAKH,SAAS,IAAI,IAAAI,gCAAe,EAACP,KAAK,EAAEM,IAAI,EAAEP,OAAO,CAACO,IAAI,CAAC,CAAC;AAE9E","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../../matches';
3
- export declare function matchAccessibilityLabel(element: HostElement, expectedLabel: TextMatch, options?: TextMatchOptions): boolean;
3
+ export declare function matchAccessibilityLabel(instance: TestInstance, expectedLabel: TextMatch, options?: TextMatchOptions): boolean;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.matchAccessibilityLabel = matchAccessibilityLabel;
7
7
  var _matches = require("../../matches");
8
8
  var _accessibility = require("../accessibility");
9
- function matchAccessibilityLabel(element, expectedLabel, options) {
10
- return (0, _matches.matches)(expectedLabel, (0, _accessibility.computeAriaLabel)(element), options?.normalizer, options?.exact);
9
+ function matchAccessibilityLabel(instance, expectedLabel, options) {
10
+ return (0, _matches.matches)(expectedLabel, (0, _accessibility.computeAriaLabel)(instance), options?.normalizer, options?.exact);
11
11
  }
12
12
  //# sourceMappingURL=match-label-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"match-label-text.js","names":["_matches","require","_accessibility","matchAccessibilityLabel","element","expectedLabel","options","matches","computeAriaLabel","normalizer","exact"],"sources":["../../../src/helpers/matchers/match-label-text.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { computeAriaLabel } from '../accessibility';\n\nexport function matchAccessibilityLabel(\n element: HostElement,\n expectedLabel: TextMatch,\n options?: TextMatchOptions,\n) {\n return matches(expectedLabel, computeAriaLabel(element), options?.normalizer, options?.exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,OAAoB,EACpBC,aAAwB,EACxBC,OAA0B,EAC1B;EACA,OAAO,IAAAC,gBAAO,EAACF,aAAa,EAAE,IAAAG,+BAAgB,EAACJ,OAAO,CAAC,EAAEE,OAAO,EAAEG,UAAU,EAAEH,OAAO,EAAEI,KAAK,CAAC;AAC/F","ignoreList":[]}
1
+ {"version":3,"file":"match-label-text.js","names":["_matches","require","_accessibility","matchAccessibilityLabel","instance","expectedLabel","options","matches","computeAriaLabel","normalizer","exact"],"sources":["../../../src/helpers/matchers/match-label-text.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { computeAriaLabel } from '../accessibility';\n\nexport function matchAccessibilityLabel(\n instance: TestInstance,\n expectedLabel: TextMatch,\n options?: TextMatchOptions,\n) {\n return matches(expectedLabel, computeAriaLabel(instance), options?.normalizer, options?.exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,QAAsB,EACtBC,aAAwB,EACxBC,OAA0B,EAC1B;EACA,OAAO,IAAAC,gBAAO,EAACF,aAAa,EAAE,IAAAG,+BAAgB,EAACJ,QAAQ,CAAC,EAAEE,OAAO,EAAEG,UAAU,EAAEH,OAAO,EAAEI,KAAK,CAAC;AAChG","ignoreList":[]}
@@ -1,10 +1,10 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../../matches';
3
3
  /**
4
- * Matches the given node's text content against string or regex matcher.
4
+ * Matches the given instance's text content against string or regex matcher.
5
5
  *
6
- * @param node - Node which text content will be matched
6
+ * @param instance - Instance which text content will be matched
7
7
  * @param text - The string or regex to match.
8
- * @returns - Whether the node's text content matches the given string or regex.
8
+ * @returns - Whether the instance's text content matches the given string or regex.
9
9
  */
10
- export declare function matchTextContent(node: HostElement, text: TextMatch, options?: TextMatchOptions): boolean;
10
+ export declare function matchTextContent(instance: TestInstance, text: TextMatch, options?: TextMatchOptions): boolean;
@@ -7,14 +7,14 @@ exports.matchTextContent = matchTextContent;
7
7
  var _matches = require("../../matches");
8
8
  var _textContent = require("../text-content");
9
9
  /**
10
- * Matches the given node's text content against string or regex matcher.
10
+ * Matches the given instance's text content against string or regex matcher.
11
11
  *
12
- * @param node - Node which text content will be matched
12
+ * @param instance - Instance which text content will be matched
13
13
  * @param text - The string or regex to match.
14
- * @returns - Whether the node's text content matches the given string or regex.
14
+ * @returns - Whether the instance's text content matches the given string or regex.
15
15
  */
16
- function matchTextContent(node, text, options = {}) {
17
- const textContent = (0, _textContent.getTextContent)(node);
16
+ function matchTextContent(instance, text, options = {}) {
17
+ const textContent = (0, _textContent.getTextContent)(instance);
18
18
  const {
19
19
  exact,
20
20
  normalizer
@@ -1 +1 @@
1
- {"version":3,"file":"match-text-content.js","names":["_matches","require","_textContent","matchTextContent","node","text","options","textContent","getTextContent","exact","normalizer","matches"],"sources":["../../../src/helpers/matchers/match-text-content.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { getTextContent } from '../text-content';\n\n/**\n * Matches the given node's text content against string or regex matcher.\n *\n * @param node - Node which text content will be matched\n * @param text - The string or regex to match.\n * @returns - Whether the node's text content matches the given string or regex.\n */\nexport function matchTextContent(\n node: HostElement,\n text: TextMatch,\n options: TextMatchOptions = {},\n) {\n const textContent = getTextContent(node);\n const { exact, normalizer } = options;\n return matches(text, textContent, normalizer, exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAC9BC,IAAiB,EACjBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,EAC9B;EACA,MAAMC,WAAW,GAAG,IAAAC,2BAAc,EAACJ,IAAI,CAAC;EACxC,MAAM;IAAEK,KAAK;IAAEC;EAAW,CAAC,GAAGJ,OAAO;EACrC,OAAO,IAAAK,gBAAO,EAACN,IAAI,EAAEE,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACtD","ignoreList":[]}
1
+ {"version":3,"file":"match-text-content.js","names":["_matches","require","_textContent","matchTextContent","instance","text","options","textContent","getTextContent","exact","normalizer","matches"],"sources":["../../../src/helpers/matchers/match-text-content.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { getTextContent } from '../text-content';\n\n/**\n * Matches the given instance's text content against string or regex matcher.\n *\n * @param instance - Instance which text content will be matched\n * @param text - The string or regex to match.\n * @returns - Whether the instance's text content matches the given string or regex.\n */\nexport function matchTextContent(\n instance: TestInstance,\n text: TextMatch,\n options: TextMatchOptions = {},\n) {\n const textContent = getTextContent(instance);\n const { exact, normalizer } = options;\n return matches(text, textContent, normalizer, exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAC9BC,QAAsB,EACtBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,EAC9B;EACA,MAAMC,WAAW,GAAG,IAAAC,2BAAc,EAACJ,QAAQ,CAAC;EAC5C,MAAM;IAAEK,KAAK;IAAEC;EAAW,CAAC,GAAGJ,OAAO;EACrC,OAAO,IAAAK,gBAAO,EAACN,IAAI,EAAEE,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACtD","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'test-renderer';
1
+ import type { TestInstance } from 'test-renderer';
2
2
  /**
3
3
  * pointerEvents controls whether the View can be the target of touch events.
4
4
  * 'auto': The View and its children can be the target of touch events.
@@ -6,4 +6,4 @@ import type { HostElement } from 'test-renderer';
6
6
  * 'box-none': The View is never the target of touch events but its subviews can be
7
7
  * 'box-only': The view can be the target of touch events but its subviews cannot be
8
8
  * see the official react native doc https://reactnative.dev/docs/view#pointerevents */
9
- export declare const isPointerEventEnabled: (element: HostElement, isParent?: boolean) => boolean;
9
+ export declare const isPointerEventEnabled: (instance: TestInstance, isParent?: boolean) => boolean;
@@ -12,17 +12,17 @@ var _reactNative = require("react-native");
12
12
  * 'box-none': The View is never the target of touch events but its subviews can be
13
13
  * 'box-only': The view can be the target of touch events but its subviews cannot be
14
14
  * see the official react native doc https://reactnative.dev/docs/view#pointerevents */
15
- const isPointerEventEnabled = (element, isParent) => {
15
+ const isPointerEventEnabled = (instance, isParent) => {
16
16
  // Check both props.pointerEvents and props.style.pointerEvents
17
- const pointerEvents = element?.props.pointerEvents ?? _reactNative.StyleSheet.flatten(element?.props.style)?.pointerEvents;
17
+ const pointerEvents = instance?.props.pointerEvents ?? _reactNative.StyleSheet.flatten(instance?.props.style)?.pointerEvents;
18
18
  const parentCondition = isParent ? pointerEvents === 'box-only' : pointerEvents === 'box-none';
19
19
  if (pointerEvents === 'none' || parentCondition) {
20
20
  return false;
21
21
  }
22
- if (!element.parent) {
22
+ if (!instance.parent) {
23
23
  return true;
24
24
  }
25
- return isPointerEventEnabled(element.parent, true);
25
+ return isPointerEventEnabled(instance.parent, true);
26
26
  };
27
27
  exports.isPointerEventEnabled = isPointerEventEnabled;
28
28
  //# sourceMappingURL=pointer-events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pointer-events.js","names":["_reactNative","require","isPointerEventEnabled","element","isParent","pointerEvents","props","StyleSheet","flatten","style","parentCondition","parent","exports"],"sources":["../../src/helpers/pointer-events.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport type { HostElement } from 'test-renderer';\n\n/**\n * pointerEvents controls whether the View can be the target of touch events.\n * 'auto': The View and its children can be the target of touch events.\n * 'none': The View is never the target of touch events.\n * 'box-none': The View is never the target of touch events but its subviews can be\n * 'box-only': The view can be the target of touch events but its subviews cannot be\n * see the official react native doc https://reactnative.dev/docs/view#pointerevents */\nexport const isPointerEventEnabled = (element: HostElement, isParent?: boolean): boolean => {\n // Check both props.pointerEvents and props.style.pointerEvents\n const pointerEvents =\n element?.props.pointerEvents ?? StyleSheet.flatten(element?.props.style)?.pointerEvents;\n\n const parentCondition = isParent ? pointerEvents === 'box-only' : pointerEvents === 'box-none';\n\n if (pointerEvents === 'none' || parentCondition) {\n return false;\n }\n\n if (!element.parent) {\n return true;\n }\n\n return isPointerEventEnabled(element.parent, true);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAGA,CAACC,OAAoB,EAAEC,QAAkB,KAAc;EAC1F;EACA,MAAMC,aAAa,GACjBF,OAAO,EAAEG,KAAK,CAACD,aAAa,IAAIE,uBAAU,CAACC,OAAO,CAACL,OAAO,EAAEG,KAAK,CAACG,KAAK,CAAC,EAAEJ,aAAa;EAEzF,MAAMK,eAAe,GAAGN,QAAQ,GAAGC,aAAa,KAAK,UAAU,GAAGA,aAAa,KAAK,UAAU;EAE9F,IAAIA,aAAa,KAAK,MAAM,IAAIK,eAAe,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,IAAI,CAACP,OAAO,CAACQ,MAAM,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAOT,qBAAqB,CAACC,OAAO,CAACQ,MAAM,EAAE,IAAI,CAAC;AACpD,CAAC;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"pointer-events.js","names":["_reactNative","require","isPointerEventEnabled","instance","isParent","pointerEvents","props","StyleSheet","flatten","style","parentCondition","parent","exports"],"sources":["../../src/helpers/pointer-events.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport type { TestInstance } from 'test-renderer';\n\n/**\n * pointerEvents controls whether the View can be the target of touch events.\n * 'auto': The View and its children can be the target of touch events.\n * 'none': The View is never the target of touch events.\n * 'box-none': The View is never the target of touch events but its subviews can be\n * 'box-only': The view can be the target of touch events but its subviews cannot be\n * see the official react native doc https://reactnative.dev/docs/view#pointerevents */\nexport const isPointerEventEnabled = (instance: TestInstance, isParent?: boolean): boolean => {\n // Check both props.pointerEvents and props.style.pointerEvents\n const pointerEvents =\n instance?.props.pointerEvents ?? StyleSheet.flatten(instance?.props.style)?.pointerEvents;\n\n const parentCondition = isParent ? pointerEvents === 'box-only' : pointerEvents === 'box-none';\n\n if (pointerEvents === 'none' || parentCondition) {\n return false;\n }\n\n if (!instance.parent) {\n return true;\n }\n\n return isPointerEventEnabled(instance.parent, true);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAGA,CAACC,QAAsB,EAAEC,QAAkB,KAAc;EAC5F;EACA,MAAMC,aAAa,GACjBF,QAAQ,EAAEG,KAAK,CAACD,aAAa,IAAIE,uBAAU,CAACC,OAAO,CAACL,QAAQ,EAAEG,KAAK,CAACG,KAAK,CAAC,EAAEJ,aAAa;EAE3F,MAAMK,eAAe,GAAGN,QAAQ,GAAGC,aAAa,KAAK,UAAU,GAAGA,aAAa,KAAK,UAAU;EAE9F,IAAIA,aAAa,KAAK,MAAM,IAAIK,eAAe,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,IAAI,CAACP,QAAQ,CAACQ,MAAM,EAAE;IACpB,OAAO,IAAI;EACb;EAEA,OAAOT,qBAAqB,CAACC,QAAQ,CAACQ,MAAM,EAAE,IAAI,CAAC;AACrD,CAAC;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import type { HostElement } from 'test-renderer';
2
- export declare function getTextContent(element: HostElement | string | null): string;
1
+ import type { TestInstance } from 'test-renderer';
2
+ export declare function getTextContent(instance: TestInstance | string | null): string;
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getTextContent = getTextContent;
7
- function getTextContent(element) {
8
- if (!element) {
7
+ function getTextContent(instance) {
8
+ if (!instance) {
9
9
  return '';
10
10
  }
11
- if (typeof element === 'string') {
12
- return element;
11
+ if (typeof instance === 'string') {
12
+ return instance;
13
13
  }
14
14
  const result = [];
15
- element.children?.forEach(child => {
15
+ instance.children?.forEach(child => {
16
16
  result.push(getTextContent(child));
17
17
  });
18
18
  return result.join('');
@@ -1 +1 @@
1
- {"version":3,"file":"text-content.js","names":["getTextContent","element","result","children","forEach","child","push","join"],"sources":["../../src/helpers/text-content.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nexport function getTextContent(element: HostElement | string | null): string {\n if (!element) {\n return '';\n }\n\n if (typeof element === 'string') {\n return element;\n }\n\n const result: string[] = [];\n element.children?.forEach((child) => {\n result.push(getTextContent(child));\n });\n\n return result.join('');\n}\n"],"mappings":";;;;;;AAEO,SAASA,cAAcA,CAACC,OAAoC,EAAU;EAC3E,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,EAAE;EACX;EAEA,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAMC,MAAgB,GAAG,EAAE;EAC3BD,OAAO,CAACE,QAAQ,EAAEC,OAAO,CAAEC,KAAK,IAAK;IACnCH,MAAM,CAACI,IAAI,CAACN,cAAc,CAACK,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACK,IAAI,CAAC,EAAE,CAAC;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"text-content.js","names":["getTextContent","instance","result","children","forEach","child","push","join"],"sources":["../../src/helpers/text-content.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nexport function getTextContent(instance: TestInstance | string | null): string {\n if (!instance) {\n return '';\n }\n\n if (typeof instance === 'string') {\n return instance;\n }\n\n const result: string[] = [];\n instance.children?.forEach((child) => {\n result.push(getTextContent(child));\n });\n\n return result.join('');\n}\n"],"mappings":";;;;;;AAEO,SAASA,cAAcA,CAACC,QAAsC,EAAU;EAC7E,IAAI,CAACA,QAAQ,EAAE;IACb,OAAO,EAAE;EACX;EAEA,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;IAChC,OAAOA,QAAQ;EACjB;EAEA,MAAMC,MAAgB,GAAG,EAAE;EAC3BD,QAAQ,CAACE,QAAQ,EAAEC,OAAO,CAAEC,KAAK,IAAK;IACpCH,MAAM,CAACI,IAAI,CAACN,cAAc,CAACK,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACK,IAAI,CAAC,EAAE,CAAC;AACxB","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import type { HostElement } from 'test-renderer';
2
- export declare function isEditableTextInput(element: HostElement): boolean;
3
- export declare function getTextInputValue(element: HostElement): any;
1
+ import type { TestInstance } from 'test-renderer';
2
+ export declare function isEditableTextInput(instance: TestInstance): boolean;
3
+ export declare function getTextInputValue(instance: TestInstance): any;
@@ -7,13 +7,13 @@ exports.getTextInputValue = getTextInputValue;
7
7
  exports.isEditableTextInput = isEditableTextInput;
8
8
  var _nativeState = require("../native-state");
9
9
  var _hostComponentNames = require("./host-component-names");
10
- function isEditableTextInput(element) {
11
- return (0, _hostComponentNames.isHostTextInput)(element) && element.props.editable !== false;
10
+ function isEditableTextInput(instance) {
11
+ return (0, _hostComponentNames.isHostTextInput)(instance) && instance.props.editable !== false;
12
12
  }
13
- function getTextInputValue(element) {
14
- if (!(0, _hostComponentNames.isHostTextInput)(element)) {
15
- throw new Error(`Element is not a "TextInput", but it has type "${element.type}".`);
13
+ function getTextInputValue(instance) {
14
+ if (!(0, _hostComponentNames.isHostTextInput)(instance)) {
15
+ throw new Error(`Element is not a "TextInput", but it has type "${instance.type}".`);
16
16
  }
17
- return element.props.value ?? _nativeState.nativeState.valueForElement.get(element) ?? element.props.defaultValue ?? '';
17
+ return instance.props.value ?? _nativeState.nativeState.valueForInstance.get(instance) ?? instance.props.defaultValue ?? '';
18
18
  }
19
19
  //# sourceMappingURL=text-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-input.js","names":["_nativeState","require","_hostComponentNames","isEditableTextInput","element","isHostTextInput","props","editable","getTextInputValue","Error","type","value","nativeState","valueForElement","get","defaultValue"],"sources":["../../src/helpers/text-input.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { nativeState } from '../native-state';\nimport { isHostTextInput } from './host-component-names';\n\nexport function isEditableTextInput(element: HostElement) {\n return isHostTextInput(element) && element.props.editable !== false;\n}\n\nexport function getTextInputValue(element: HostElement) {\n if (!isHostTextInput(element)) {\n throw new Error(`Element is not a \"TextInput\", but it has type \"${element.type}\".`);\n }\n\n return (\n element.props.value ??\n nativeState.valueForElement.get(element) ??\n element.props.defaultValue ??\n ''\n );\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAACC,OAAoB,EAAE;EACxD,OAAO,IAAAC,mCAAe,EAACD,OAAO,CAAC,IAAIA,OAAO,CAACE,KAAK,CAACC,QAAQ,KAAK,KAAK;AACrE;AAEO,SAASC,iBAAiBA,CAACJ,OAAoB,EAAE;EACtD,IAAI,CAAC,IAAAC,mCAAe,EAACD,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIK,KAAK,CAAC,kDAAkDL,OAAO,CAACM,IAAI,IAAI,CAAC;EACrF;EAEA,OACEN,OAAO,CAACE,KAAK,CAACK,KAAK,IACnBC,wBAAW,CAACC,eAAe,CAACC,GAAG,CAACV,OAAO,CAAC,IACxCA,OAAO,CAACE,KAAK,CAACS,YAAY,IAC1B,EAAE;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"text-input.js","names":["_nativeState","require","_hostComponentNames","isEditableTextInput","instance","isHostTextInput","props","editable","getTextInputValue","Error","type","value","nativeState","valueForInstance","get","defaultValue"],"sources":["../../src/helpers/text-input.ts"],"sourcesContent":["import type { TestInstance } from 'test-renderer';\n\nimport { nativeState } from '../native-state';\nimport { isHostTextInput } from './host-component-names';\n\nexport function isEditableTextInput(instance: TestInstance) {\n return isHostTextInput(instance) && instance.props.editable !== false;\n}\n\nexport function getTextInputValue(instance: TestInstance) {\n if (!isHostTextInput(instance)) {\n throw new Error(`Element is not a \"TextInput\", but it has type \"${instance.type}\".`);\n }\n\n return (\n instance.props.value ??\n nativeState.valueForInstance.get(instance) ??\n instance.props.defaultValue ??\n ''\n );\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAACC,QAAsB,EAAE;EAC1D,OAAO,IAAAC,mCAAe,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,KAAK,CAACC,QAAQ,KAAK,KAAK;AACvE;AAEO,SAASC,iBAAiBA,CAACJ,QAAsB,EAAE;EACxD,IAAI,CAAC,IAAAC,mCAAe,EAACD,QAAQ,CAAC,EAAE;IAC9B,MAAM,IAAIK,KAAK,CAAC,kDAAkDL,QAAQ,CAACM,IAAI,IAAI,CAAC;EACtF;EAEA,OACEN,QAAQ,CAACE,KAAK,CAACK,KAAK,IACpBC,wBAAW,CAACC,gBAAgB,CAACC,GAAG,CAACV,QAAQ,CAAC,IAC1CA,QAAQ,CAACE,KAAK,CAACS,YAAY,IAC3B,EAAE;AAEN","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Validates that no unknown options are passed to a function.
3
+ * Logs a warning if unknown options are found.
4
+ *
5
+ * @param functionName - The name of the function being called (for error messages)
6
+ * @param restOptions - The rest object from destructuring that contains unknown options
7
+ * @param callsite - The function where the validation is called from (e.g., render, renderHook)
8
+ */
9
+ export declare function validateOptions(functionName: string, restOptions: Record<string, unknown>, callsite: Function): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateOptions = validateOptions;
7
+ var _errors = require("./errors");
8
+ var _logger = require("./logger");
9
+ /**
10
+ * Validates that no unknown options are passed to a function.
11
+ * Logs a warning if unknown options are found.
12
+ *
13
+ * @param functionName - The name of the function being called (for error messages)
14
+ * @param restOptions - The rest object from destructuring that contains unknown options
15
+ * @param callsite - The function where the validation is called from (e.g., render, renderHook)
16
+ */
17
+ function validateOptions(functionName, restOptions,
18
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
19
+ callsite) {
20
+ const unknownKeys = Object.keys(restOptions);
21
+ if (unknownKeys.length > 0) {
22
+ // Pass the callsite function (e.g., render) to remove it from stack
23
+ // This leaves only where the user called the function from (e.g., test file)
24
+ const stackTraceError = new _errors.ErrorWithStack('STACK_TRACE_ERROR', callsite);
25
+ const stackLines = stackTraceError.stack ? stackTraceError.stack.split('\n') : [];
26
+ // Skip the first line (Error: STACK_TRACE_ERROR) to show the actual call sites
27
+ // The remaining lines show where the user called the function from
28
+ const stackTrace = stackLines.length > 1 ? `\n\n${stackLines.slice(1).join('\n')}` : '';
29
+ _logger.logger.warn(`Unknown option(s) passed to ${functionName}: ${unknownKeys.join(', ')}${stackTrace}`);
30
+ }
31
+ }
32
+ //# sourceMappingURL=validate-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-options.js","names":["_errors","require","_logger","validateOptions","functionName","restOptions","callsite","unknownKeys","Object","keys","length","stackTraceError","ErrorWithStack","stackLines","stack","split","stackTrace","slice","join","logger","warn"],"sources":["../../src/helpers/validate-options.ts"],"sourcesContent":["import { ErrorWithStack } from './errors';\nimport { logger } from './logger';\n\n/**\n * Validates that no unknown options are passed to a function.\n * Logs a warning if unknown options are found.\n *\n * @param functionName - The name of the function being called (for error messages)\n * @param restOptions - The rest object from destructuring that contains unknown options\n * @param callsite - The function where the validation is called from (e.g., render, renderHook)\n */\nexport function validateOptions(\n functionName: string,\n restOptions: Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n callsite: Function,\n): void {\n const unknownKeys = Object.keys(restOptions);\n if (unknownKeys.length > 0) {\n // Pass the callsite function (e.g., render) to remove it from stack\n // This leaves only where the user called the function from (e.g., test file)\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', callsite);\n const stackLines = stackTraceError.stack ? stackTraceError.stack.split('\\n') : [];\n // Skip the first line (Error: STACK_TRACE_ERROR) to show the actual call sites\n // The remaining lines show where the user called the function from\n const stackTrace = stackLines.length > 1 ? `\\n\\n${stackLines.slice(1).join('\\n')}` : '';\n logger.warn(\n `Unknown option(s) passed to ${functionName}: ${unknownKeys.join(', ')}${stackTrace}`,\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAC7BC,YAAoB,EACpBC,WAAoC;AACpC;AACAC,QAAkB,EACZ;EACN,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACJ,WAAW,CAAC;EAC5C,IAAIE,WAAW,CAACG,MAAM,GAAG,CAAC,EAAE;IAC1B;IACA;IACA,MAAMC,eAAe,GAAG,IAAIC,sBAAc,CAAC,mBAAmB,EAAEN,QAAQ,CAAC;IACzE,MAAMO,UAAU,GAAGF,eAAe,CAACG,KAAK,GAAGH,eAAe,CAACG,KAAK,CAACC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;IACjF;IACA;IACA,MAAMC,UAAU,GAAGH,UAAU,CAACH,MAAM,GAAG,CAAC,GAAG,OAAOG,UAAU,CAACI,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE;IACvFC,cAAM,CAACC,IAAI,CACT,+BAA+BhB,YAAY,KAAKG,WAAW,CAACW,IAAI,CAAC,IAAI,CAAC,GAAGF,UAAU,EACrF,CAAC;EACH;AACF","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { HostElement } from 'test-renderer';
2
- export declare function toBeBusy(this: jest.MatcherContext, element: HostElement): {
1
+ import type { TestInstance } from 'test-renderer';
2
+ export declare function toBeBusy(this: jest.MatcherContext, instance: TestInstance): {
3
3
  pass: boolean;
4
4
  message: () => string;
5
5
  };
@@ -10,13 +10,13 @@ var _accessibility = require("../helpers/accessibility");
10
10
  var _formatElement = require("../helpers/format-element");
11
11
  var _utils = require("./utils");
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- function toBeBusy(element) {
14
- (0, _utils.checkHostElement)(element, toBeBusy, this);
13
+ function toBeBusy(instance) {
14
+ (0, _utils.checkHostElement)(instance, toBeBusy, this);
15
15
  return {
16
- pass: (0, _accessibility.computeAriaBusy)(element),
16
+ pass: (0, _accessibility.computeAriaBusy)(instance),
17
17
  message: () => {
18
- const matcher = (0, _jestMatcherUtils.matcherHint)(`${this.isNot ? '.not' : ''}.toBeBusy`, 'element', '');
19
- return [matcher, '', `Received element is ${this.isNot ? '' : 'not '}busy:`, (0, _redent.default)((0, _formatElement.formatElement)(element), 2)].join('\n');
18
+ const matcher = (0, _jestMatcherUtils.matcherHint)(`${this.isNot ? '.not' : ''}.toBeBusy`, 'instance', '');
19
+ return [matcher, '', `Received instance is ${this.isNot ? '' : 'not '}busy:`, (0, _redent.default)((0, _formatElement.formatElement)(instance), 2)].join('\n');
20
20
  }
21
21
  };
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-busy.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeBusy","element","checkHostElement","pass","computeAriaBusy","message","matcher","matcherHint","isNot","redent","formatElement","join"],"sources":["../../src/matchers/to-be-busy.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaBusy } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeBusy(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeBusy, this);\n\n return {\n pass: computeAriaBusy(element),\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeBusy`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}busy:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,QAAQA,CAA4BC,OAAoB,EAAE;EACxE,IAAAC,uBAAgB,EAACD,OAAO,EAAED,QAAQ,EAAE,IAAI,CAAC;EAEzC,OAAO;IACLG,IAAI,EAAE,IAAAC,8BAAe,EAACH,OAAO,CAAC;IAC9BI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC;MAClF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,OAAO,EACtD,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-busy.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeBusy","instance","checkHostElement","pass","computeAriaBusy","message","matcher","matcherHint","isNot","redent","formatElement","join"],"sources":["../../src/matchers/to-be-busy.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { TestInstance } from 'test-renderer';\n\nimport { computeAriaBusy } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeBusy(this: jest.MatcherContext, instance: TestInstance) {\n checkHostElement(instance, toBeBusy, this);\n\n return {\n pass: computeAriaBusy(instance),\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeBusy`, 'instance', '');\n return [\n matcher,\n '',\n `Received instance is ${this.isNot ? '' : 'not '}busy:`,\n redent(formatElement(instance), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,QAAQA,CAA4BC,QAAsB,EAAE;EAC1E,IAAAC,uBAAgB,EAACD,QAAQ,EAAED,QAAQ,EAAE,IAAI,CAAC;EAE1C,OAAO;IACLG,IAAI,EAAE,IAAAC,8BAAe,EAACH,QAAQ,CAAC;IAC/BI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;MACnF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,wBAAwB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,OAAO,EACvD,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,QAAQ,CAAC,EAAE,CAAC,CAAC,CACnC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { HostElement } from 'test-renderer';
2
- export declare function toBeChecked(this: jest.MatcherContext, element: HostElement): {
1
+ import type { TestInstance } from 'test-renderer';
2
+ export declare function toBeChecked(this: jest.MatcherContext, instance: TestInstance): {
3
3
  pass: boolean;
4
4
  message: () => string;
5
5
  };