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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +2 -2
  2. package/build/act.d.ts +1 -4
  3. package/build/act.js +5 -3
  4. package/build/act.js.map +1 -1
  5. package/build/cleanup.d.ts +3 -5
  6. package/build/cleanup.js +2 -8
  7. package/build/cleanup.js.map +1 -1
  8. package/build/fire-event.d.ts +3 -10
  9. package/build/fire-event.js +7 -29
  10. package/build/fire-event.js.map +1 -1
  11. package/build/helpers/accessibility.d.ts +1 -1
  12. package/build/helpers/accessibility.js.map +1 -1
  13. package/build/helpers/component-tree.d.ts +1 -1
  14. package/build/helpers/component-tree.js.map +1 -1
  15. package/build/helpers/debug.d.ts +1 -1
  16. package/build/helpers/debug.js.map +1 -1
  17. package/build/helpers/find-all.d.ts +1 -1
  18. package/build/helpers/find-all.js.map +1 -1
  19. package/build/helpers/format-element.d.ts +1 -1
  20. package/build/helpers/format-element.js.map +1 -1
  21. package/build/helpers/host-component-names.d.ts +2 -1
  22. package/build/helpers/host-component-names.js +2 -1
  23. package/build/helpers/host-component-names.js.map +1 -1
  24. package/build/helpers/matchers/match-accessibility-state.d.ts +1 -1
  25. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  26. package/build/helpers/matchers/match-accessibility-value.d.ts +1 -1
  27. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  28. package/build/helpers/matchers/match-label-text.d.ts +1 -1
  29. package/build/helpers/matchers/match-label-text.js.map +1 -1
  30. package/build/helpers/matchers/match-text-content.d.ts +1 -1
  31. package/build/helpers/matchers/match-text-content.js.map +1 -1
  32. package/build/helpers/pointer-events.d.ts +1 -1
  33. package/build/helpers/pointer-events.js.map +1 -1
  34. package/build/helpers/text-content.d.ts +1 -1
  35. package/build/helpers/text-content.js.map +1 -1
  36. package/build/helpers/text-input.d.ts +1 -1
  37. package/build/helpers/text-input.js.map +1 -1
  38. package/build/helpers/timers.d.ts +3 -1
  39. package/build/helpers/timers.js +3 -1
  40. package/build/helpers/timers.js.map +1 -1
  41. package/build/index.js +1 -1
  42. package/build/index.js.map +1 -1
  43. package/build/matchers/to-be-busy.d.ts +1 -1
  44. package/build/matchers/to-be-busy.js.map +1 -1
  45. package/build/matchers/to-be-checked.d.ts +1 -1
  46. package/build/matchers/to-be-checked.js.map +1 -1
  47. package/build/matchers/to-be-disabled.d.ts +1 -1
  48. package/build/matchers/to-be-disabled.js.map +1 -1
  49. package/build/matchers/to-be-empty-element.d.ts +1 -1
  50. package/build/matchers/to-be-empty-element.js.map +1 -1
  51. package/build/matchers/to-be-expanded.d.ts +1 -1
  52. package/build/matchers/to-be-expanded.js.map +1 -1
  53. package/build/matchers/to-be-on-the-screen.d.ts +1 -1
  54. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  55. package/build/matchers/to-be-partially-checked.d.ts +1 -1
  56. package/build/matchers/to-be-partially-checked.js.map +1 -1
  57. package/build/matchers/to-be-selected.d.ts +1 -1
  58. package/build/matchers/to-be-selected.js.map +1 -1
  59. package/build/matchers/to-be-visible.d.ts +1 -1
  60. package/build/matchers/to-be-visible.js.map +1 -1
  61. package/build/matchers/to-contain-element.d.ts +1 -1
  62. package/build/matchers/to-contain-element.js.map +1 -1
  63. package/build/matchers/to-have-accessibility-value.d.ts +1 -1
  64. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  65. package/build/matchers/to-have-accessible-name.d.ts +1 -1
  66. package/build/matchers/to-have-accessible-name.js.map +1 -1
  67. package/build/matchers/to-have-display-value.d.ts +1 -1
  68. package/build/matchers/to-have-display-value.js.map +1 -1
  69. package/build/matchers/to-have-prop.d.ts +1 -1
  70. package/build/matchers/to-have-prop.js.map +1 -1
  71. package/build/matchers/to-have-style.d.ts +1 -1
  72. package/build/matchers/to-have-style.js.map +1 -1
  73. package/build/matchers/to-have-text-content.d.ts +1 -1
  74. package/build/matchers/to-have-text-content.js.map +1 -1
  75. package/build/matchers/types.d.ts +1 -1
  76. package/build/matchers/types.js.map +1 -1
  77. package/build/matchers/utils.d.ts +1 -1
  78. package/build/matchers/utils.js.map +1 -1
  79. package/build/native-state.d.ts +1 -1
  80. package/build/native-state.js.map +1 -1
  81. package/build/pure.d.ts +10 -12
  82. package/build/pure.js +12 -45
  83. package/build/pure.js.map +1 -1
  84. package/build/queries/display-value.d.ts +1 -1
  85. package/build/queries/display-value.js.map +1 -1
  86. package/build/queries/hint-text.d.ts +1 -1
  87. package/build/queries/hint-text.js.map +1 -1
  88. package/build/queries/label-text.d.ts +1 -1
  89. package/build/queries/label-text.js.map +1 -1
  90. package/build/queries/make-queries.d.ts +1 -1
  91. package/build/queries/make-queries.js +3 -4
  92. package/build/queries/make-queries.js.map +1 -1
  93. package/build/queries/placeholder-text.d.ts +1 -1
  94. package/build/queries/placeholder-text.js.map +1 -1
  95. package/build/queries/role.d.ts +1 -1
  96. package/build/queries/role.js.map +1 -1
  97. package/build/queries/test-id.d.ts +1 -1
  98. package/build/queries/test-id.js.map +1 -1
  99. package/build/queries/text.d.ts +1 -1
  100. package/build/queries/text.js.map +1 -1
  101. package/build/render-hook.d.ts +0 -8
  102. package/build/render-hook.js +3 -42
  103. package/build/render-hook.js.map +1 -1
  104. package/build/render.d.ts +7 -77
  105. package/build/render.js +26 -42
  106. package/build/render.js.map +1 -1
  107. package/build/screen.js +1 -5
  108. package/build/screen.js.map +1 -1
  109. package/build/test-utils/json.d.ts +1 -1
  110. package/build/test-utils/json.js.map +1 -1
  111. package/build/tsconfig.release.tsbuildinfo +1 -1
  112. package/build/types.js +4 -0
  113. package/build/user-event/clear.d.ts +1 -1
  114. package/build/user-event/clear.js.map +1 -1
  115. package/build/user-event/index.d.ts +1 -1
  116. package/build/user-event/index.js.map +1 -1
  117. package/build/user-event/paste.d.ts +1 -1
  118. package/build/user-event/paste.js.map +1 -1
  119. package/build/user-event/press/press.d.ts +1 -1
  120. package/build/user-event/press/press.js +2 -3
  121. package/build/user-event/press/press.js.map +1 -1
  122. package/build/user-event/scroll/scroll-to.d.ts +1 -1
  123. package/build/user-event/scroll/scroll-to.js.map +1 -1
  124. package/build/user-event/setup/setup.d.ts +1 -1
  125. package/build/user-event/setup/setup.js.map +1 -1
  126. package/build/user-event/type/type.d.ts +1 -1
  127. package/build/user-event/type/type.js.map +1 -1
  128. package/build/user-event/utils/dispatch-event.d.ts +1 -1
  129. package/build/user-event/utils/dispatch-event.js +2 -5
  130. package/build/user-event/utils/dispatch-event.js.map +1 -1
  131. package/build/user-event/utils/text-range.js +4 -0
  132. package/build/wait-for-element-to-be-removed.d.ts +1 -1
  133. package/build/wait-for-element-to-be-removed.js +3 -4
  134. package/build/wait-for-element-to-be-removed.js.map +1 -1
  135. package/build/wait-for.d.ts +1 -1
  136. package/build/wait-for.js +6 -7
  137. package/build/wait-for.js.map +1 -1
  138. package/build/within.d.ts +1 -1
  139. package/build/within.js.map +1 -1
  140. package/package.json +18 -20
  141. package/build/index.flow.js +0 -378
  142. package/build/render-act.d.ts +0 -3
  143. package/build/render-act.js +0 -29
  144. package/build/render-act.js.map +0 -1
  145. package/build/render-async.d.ts +0 -83
  146. package/build/render-async.js +0 -96
  147. package/build/render-async.js.map +0 -1
  148. package/typings/index.flow.js +0 -378
@@ -1,5 +1,5 @@
1
1
  import type { StyleProp } from 'react-native';
2
- import type { HostElement } from 'universal-test-renderer';
2
+ import type { HostElement } from 'test-renderer';
3
3
  import type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';
4
4
  import type { TextMatch, TextMatchOptions } from '../matches';
5
5
  import type { Style } from './to-have-style';
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/matchers/types.ts"],"sourcesContent":["import type { StyleProp } from 'react-native';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport type { Style } from './to-have-style';\n\nexport interface JestNativeMatchers<R> {\n /**\n * Assert whether a host element is present in the element tree (screen) or not.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeonthescreen)\n *\n * @example\n * <Text>Hello</Text>\n *\n * expect(getByText('Hello')).toBeOnTheScreen()\n * expect(queryByText('Other')).not.toBeOnTheScreen()\n */\n toBeOnTheScreen(): R;\n\n /**\n * Assert whether a host element is checked based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobechecked)\n *\n * @see {@link toBePartiallyChecked} for a related matcher.\n *\n * @example\n * <View accessible role=\"checkbox\" aria-checked aria-label=\"Enable\" />\n *\n * expect(getByRole('checkbox', { name: \"Enable\" })).toBeChecked()\n */\n toBeChecked(): R;\n\n /**\n * Assert whether a host element is collapsed based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeexpanded)\n *\n * @see {@link toBeExpanded} for an inverse matcher.\n *\n * @example\n * <View testID=\"details\" aria-expanded={false} />\n *\n * expect(getByTestId('details').toBeCollapsed()\n */\n toBeCollapsed(): R;\n\n /**\n * Assert whether a host element is disabled based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeenabled)\n *\n * @see {@link toBeEnabled} for an inverse matcher.\n *\n * @example\n * <View role=\"button\" aria-disabled />\n *\n * expect(getByRole('button').toBeDisabled()\n *\n */\n toBeDisabled(): R;\n\n /**\n * Assert whether a host element is busy based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobebusy)\n *\n * @example\n * <View testID=\"loader\" aria-busy />\n *\n * expect(getByTestId('loader')).toBeBusy()\n */\n toBeBusy(): R;\n\n /**\n * Assert whether a host element has no host children or text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeemptyelement)\n *\n * @example\n * <View testID=\"not-empty\">\n * <View testID=\"empty\" />\n * </View>\n *\n * expect(getByTestId('empty')).toBeEmptyElement()\n * expect(getByTestId('not-mepty')).not.toBeEmptyElement()\n */\n toBeEmptyElement(): R;\n\n /**\n * Assert whether a host element is enabled based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeenabled)\n *\n * @see {@link toBeDisabled} for inverse matcher.\n *\n * @example\n * <View role=\"button\" aria-disabled={false} />\n *\n * expect(getByRole('button').toBeEnabled()\n */\n toBeEnabled(): R;\n\n /**\n * Assert whether a host element is expanded based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeexpanded)\n *\n * @see {@link toBeCollapsed} for inverse matcher.\n *\n * @example\n * <View testID=\"details\" aria-expanded />\n *\n * expect(getByTestId('details').toBeExpanded()\n */\n toBeExpanded(): R;\n\n /**\n * Assert whether a host element is partially checked based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobechecked)\n *\n * @see {@link toBeChecked} for related matcher.\n *\n * @example\n * <View accessible role=\"checkbox\" aria-checked=\"mixed\" aria-label=\"Enable\" />\n *\n * expect(getByRole('checkbox', { name: \"Enable\" })).toBePartiallyChecked()\n */\n toBePartiallyChecked(): R;\n\n /**\n * Assert whether a host element is selected based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeselected)\n *\n * @example\n * <View testID=\"view\" aria-selected />\n *\n * expect(getByTestId('view')).toBeSelected()\n */\n toBeSelected(): R;\n\n /**\n * Assert whether a host element is visible based on style and accessibility props.\n *\n * This matcher will check ancestor elements for their visibility as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobevisible)\n *\n * @example\n * <View testID=\"visible\" />\n * <View testID=\"not-visible\" style={{ display: 'none' }} />\n *\n * expect(getByTestId('visible')).toBeVisible()\n * expect(getByTestId('not-visible')).not.toBeVisible()\n */\n toBeVisible(): R;\n\n /**\n * Assert whether a host element contains another host element.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tocontainelement)\n *\n * @example\n * <View testID=\"outer\">\n * <View testID=\"inner\" />\n * </View>\n *\n * expect(getByTestId('outer')).toContainElement(getByTestId('inner'));\n */\n toContainElement(element: HostElement | null): R;\n\n /**\n * Assert whether a host element has a given accessbility value.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveaccessibilityvalue)\n *\n *\n * @example\n * <View testID=\"view\" aria-valuetext=\"33%\" />\n *\n * expect(getByTestId('view')).toHaveAccessibilityValue({ text: '33%' });\n */\n toHaveAccessibilityValue(expectedValue: AccessibilityValueMatcher): R;\n\n /**\n * Assert whether a host element has a given accessibile name based on the accessibility label or text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveaccessiblename)\n *\n * @example\n * <View testID=\"view\" aria-label=\"Hello\" />\n *\n * expect(getByTestId('view')).toHaveAccessibleName('Hello');\n */\n toHaveAccessibleName(expectedName?: TextMatch, options?: TextMatchOptions): R;\n\n /**\n * Assert whether a host `TextInput` element has a given display value based on `value` prop, unmanaged native state, and `defaultValue` prop.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavedisplayvalue)\n *\n * @example\n * <TextInput testID=\"input\" value=\"Hello\" />\n *\n * expect(getByTestId('input')).toHaveDisplayValue('Hello');\n */\n toHaveDisplayValue(expectedValue: TextMatch, options?: TextMatchOptions): R;\n\n /**\n * Assert whether a host element has a given prop.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveprop)\n *\n * @example\n * <Text testID=\"text\" numberOfLines={1]} />\n *\n * expect(getByTestId('text')).toHaveProp('numberOfLines');\n * expect(getByTestId('text')).toHaveProp('numberOfLines', 1);\n */\n toHaveProp(name: string, expectedValue?: unknown): R;\n\n /**\n * Assert whether a host element has a given style.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavestyle)\n *\n * @example\n * <View testID=\"view\" style={{ width: '100%' }} />\n *\n * expect(getByTestId('view')).toHaveStyle({ width: '100%' });\n * expect(getByTestId('view')).not.toHaveStyle({ width: '50%' });\n */\n toHaveStyle(style: StyleProp<Style>): R;\n\n /**\n * Assert whether a host element has a given text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavetextcontent)\n *\n * @example\n * <View testID=\"view\">\n * <Text>Hello World</Text>\n * </View>\n *\n * expect(getByTestId('view')).toHaveTextContent('Hello World');\n * expect(getByTestId('view')).toHaveTextContent('Hello', { exact: false }});\n * expect(getByTestId('view')).toHaveTextContent(/hello/i);\n * expect(getByTestId('view')).not.toHaveTextContent('Hello');\n */\n toHaveTextContent(expectedText: TextMatch, options?: TextMatchOptions): R;\n}\n\n// Implicit Jest global `expect`.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unused-vars\n interface Matchers<R, T = {}> extends JestNativeMatchers<R> {}\n }\n}\n\n// Explicit `@jest/globals` `expect` matchers.\n// @ts-expect-error: Invalid module name in augmentation, module '@jest/expect' cannot be found\ndeclare module '@jest/expect' {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Matchers<R extends void | Promise<void>> extends JestNativeMatchers<R> {}\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/matchers/types.ts"],"sourcesContent":["import type { StyleProp } from 'react-native';\nimport type { HostElement } from 'test-renderer';\n\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport type { Style } from './to-have-style';\n\nexport interface JestNativeMatchers<R> {\n /**\n * Assert whether a host element is present in the element tree (screen) or not.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeonthescreen)\n *\n * @example\n * <Text>Hello</Text>\n *\n * expect(getByText('Hello')).toBeOnTheScreen()\n * expect(queryByText('Other')).not.toBeOnTheScreen()\n */\n toBeOnTheScreen(): R;\n\n /**\n * Assert whether a host element is checked based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobechecked)\n *\n * @see {@link toBePartiallyChecked} for a related matcher.\n *\n * @example\n * <View accessible role=\"checkbox\" aria-checked aria-label=\"Enable\" />\n *\n * expect(getByRole('checkbox', { name: \"Enable\" })).toBeChecked()\n */\n toBeChecked(): R;\n\n /**\n * Assert whether a host element is collapsed based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeexpanded)\n *\n * @see {@link toBeExpanded} for an inverse matcher.\n *\n * @example\n * <View testID=\"details\" aria-expanded={false} />\n *\n * expect(getByTestId('details').toBeCollapsed()\n */\n toBeCollapsed(): R;\n\n /**\n * Assert whether a host element is disabled based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeenabled)\n *\n * @see {@link toBeEnabled} for an inverse matcher.\n *\n * @example\n * <View role=\"button\" aria-disabled />\n *\n * expect(getByRole('button').toBeDisabled()\n *\n */\n toBeDisabled(): R;\n\n /**\n * Assert whether a host element is busy based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobebusy)\n *\n * @example\n * <View testID=\"loader\" aria-busy />\n *\n * expect(getByTestId('loader')).toBeBusy()\n */\n toBeBusy(): R;\n\n /**\n * Assert whether a host element has no host children or text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeemptyelement)\n *\n * @example\n * <View testID=\"not-empty\">\n * <View testID=\"empty\" />\n * </View>\n *\n * expect(getByTestId('empty')).toBeEmptyElement()\n * expect(getByTestId('not-mepty')).not.toBeEmptyElement()\n */\n toBeEmptyElement(): R;\n\n /**\n * Assert whether a host element is enabled based on accessibility props.\n *\n * This matcher will check ancestor elements for their disabled state as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeenabled)\n *\n * @see {@link toBeDisabled} for inverse matcher.\n *\n * @example\n * <View role=\"button\" aria-disabled={false} />\n *\n * expect(getByRole('button').toBeEnabled()\n */\n toBeEnabled(): R;\n\n /**\n * Assert whether a host element is expanded based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeexpanded)\n *\n * @see {@link toBeCollapsed} for inverse matcher.\n *\n * @example\n * <View testID=\"details\" aria-expanded />\n *\n * expect(getByTestId('details').toBeExpanded()\n */\n toBeExpanded(): R;\n\n /**\n * Assert whether a host element is partially checked based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobechecked)\n *\n * @see {@link toBeChecked} for related matcher.\n *\n * @example\n * <View accessible role=\"checkbox\" aria-checked=\"mixed\" aria-label=\"Enable\" />\n *\n * expect(getByRole('checkbox', { name: \"Enable\" })).toBePartiallyChecked()\n */\n toBePartiallyChecked(): R;\n\n /**\n * Assert whether a host element is selected based on accessibility props.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobeselected)\n *\n * @example\n * <View testID=\"view\" aria-selected />\n *\n * expect(getByTestId('view')).toBeSelected()\n */\n toBeSelected(): R;\n\n /**\n * Assert whether a host element is visible based on style and accessibility props.\n *\n * This matcher will check ancestor elements for their visibility as well.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tobevisible)\n *\n * @example\n * <View testID=\"visible\" />\n * <View testID=\"not-visible\" style={{ display: 'none' }} />\n *\n * expect(getByTestId('visible')).toBeVisible()\n * expect(getByTestId('not-visible')).not.toBeVisible()\n */\n toBeVisible(): R;\n\n /**\n * Assert whether a host element contains another host element.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tocontainelement)\n *\n * @example\n * <View testID=\"outer\">\n * <View testID=\"inner\" />\n * </View>\n *\n * expect(getByTestId('outer')).toContainElement(getByTestId('inner'));\n */\n toContainElement(element: HostElement | null): R;\n\n /**\n * Assert whether a host element has a given accessbility value.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveaccessibilityvalue)\n *\n *\n * @example\n * <View testID=\"view\" aria-valuetext=\"33%\" />\n *\n * expect(getByTestId('view')).toHaveAccessibilityValue({ text: '33%' });\n */\n toHaveAccessibilityValue(expectedValue: AccessibilityValueMatcher): R;\n\n /**\n * Assert whether a host element has a given accessibile name based on the accessibility label or text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveaccessiblename)\n *\n * @example\n * <View testID=\"view\" aria-label=\"Hello\" />\n *\n * expect(getByTestId('view')).toHaveAccessibleName('Hello');\n */\n toHaveAccessibleName(expectedName?: TextMatch, options?: TextMatchOptions): R;\n\n /**\n * Assert whether a host `TextInput` element has a given display value based on `value` prop, unmanaged native state, and `defaultValue` prop.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavedisplayvalue)\n *\n * @example\n * <TextInput testID=\"input\" value=\"Hello\" />\n *\n * expect(getByTestId('input')).toHaveDisplayValue('Hello');\n */\n toHaveDisplayValue(expectedValue: TextMatch, options?: TextMatchOptions): R;\n\n /**\n * Assert whether a host element has a given prop.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohaveprop)\n *\n * @example\n * <Text testID=\"text\" numberOfLines={1]} />\n *\n * expect(getByTestId('text')).toHaveProp('numberOfLines');\n * expect(getByTestId('text')).toHaveProp('numberOfLines', 1);\n */\n toHaveProp(name: string, expectedValue?: unknown): R;\n\n /**\n * Assert whether a host element has a given style.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavestyle)\n *\n * @example\n * <View testID=\"view\" style={{ width: '100%' }} />\n *\n * expect(getByTestId('view')).toHaveStyle({ width: '100%' });\n * expect(getByTestId('view')).not.toHaveStyle({ width: '50%' });\n */\n toHaveStyle(style: StyleProp<Style>): R;\n\n /**\n * Assert whether a host element has a given text content.\n *\n * @see\n * [Jest Matchers docs](https://callstack.github.io/react-native-testing-library/docs/jest-matchers#tohavetextcontent)\n *\n * @example\n * <View testID=\"view\">\n * <Text>Hello World</Text>\n * </View>\n *\n * expect(getByTestId('view')).toHaveTextContent('Hello World');\n * expect(getByTestId('view')).toHaveTextContent('Hello', { exact: false }});\n * expect(getByTestId('view')).toHaveTextContent(/hello/i);\n * expect(getByTestId('view')).not.toHaveTextContent('Hello');\n */\n toHaveTextContent(expectedText: TextMatch, options?: TextMatchOptions): R;\n}\n\n// Implicit Jest global `expect`.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-unused-vars\n interface Matchers<R, T = {}> extends JestNativeMatchers<R> {}\n }\n}\n\n// Explicit `@jest/globals` `expect` matchers.\n// @ts-expect-error: Invalid module name in augmentation, module '@jest/expect' cannot be found\ndeclare module '@jest/expect' {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Matchers<R extends void | Promise<void>> extends JestNativeMatchers<R> {}\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  /**
3
3
  * Throws HostElementTypeError if passed element is not a host element.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","e","__esModule","default","HostElementTypeError","Error","constructor","received","matcherFn","context","captureStackTrace","withType","printWithType","printReceived","message","matcherHint","isNot","name","RECEIVED_COLOR","join","checkHostElement","element","isHostElement","formatMessage","matcher","expectedLabel","expectedValue","receivedLabel","receivedValue","EXPECTED_COLOR","redent","formatValue","value","stringify"],"sources":["../../src/matchers/utils.ts"],"sourcesContent":["import {\n EXPECTED_COLOR,\n matcherHint,\n printReceived,\n printWithType,\n RECEIVED_COLOR,\n stringify,\n} from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { isHostElement } from '../helpers/component-tree';\n\nclass HostElementTypeError extends Error {\n constructor(received: unknown, matcherFn: jest.CustomMatcher, context: jest.MatcherContext) {\n super();\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, matcherFn);\n }\n\n let withType = '';\n try {\n withType = printWithType('Received', received, printReceived);\n /* istanbul ignore next */\n } catch {\n // Deliberately empty.\n }\n\n this.message = [\n matcherHint(`${context.isNot ? '.not' : ''}.${matcherFn.name}`, 'received', ''),\n '',\n `${RECEIVED_COLOR('received')} value must be a host element.`,\n withType,\n ].join('\\n');\n }\n}\n\n/**\n * Throws HostElementTypeError if passed element is not a host element.\n *\n * @param element HostElement to check.\n * @param matcherFn Matcher function calling the check used for formatting error.\n * @param context Jest matcher context used for formatting error.\n */\nexport function checkHostElement(\n element: HostElement | null | undefined,\n matcherFn: jest.CustomMatcher,\n context: jest.MatcherContext,\n): asserts element is HostElement {\n if (!isHostElement(element)) {\n throw new HostElementTypeError(element, matcherFn, context);\n }\n}\n\nexport function formatMessage(\n matcher: string,\n expectedLabel: string,\n expectedValue: string | RegExp | null | undefined,\n receivedLabel: string,\n receivedValue: string | null | undefined,\n) {\n return [\n `${matcher}\\n`,\n `${expectedLabel}:\\n${EXPECTED_COLOR(redent(formatValue(expectedValue), 2))}`,\n `${receivedLabel}:\\n${RECEIVED_COLOR(redent(formatValue(receivedValue), 2))}`,\n ].join('\\n');\n}\n\nfunction formatValue(value: unknown) {\n return typeof value === 'string' ? value : stringify(value);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAA0D,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1D,MAAMG,oBAAoB,SAASC,KAAK,CAAC;EACvCC,WAAWA,CAACC,QAAiB,EAAEC,SAA6B,EAAEC,OAA4B,EAAE;IAC1F,KAAK,CAAC,CAAC;;IAEP;IACA,IAAIJ,KAAK,CAACK,iBAAiB,EAAE;MAC3BL,KAAK,CAACK,iBAAiB,CAAC,IAAI,EAAEF,SAAS,CAAC;IAC1C;IAEA,IAAIG,QAAQ,GAAG,EAAE;IACjB,IAAI;MACFA,QAAQ,GAAG,IAAAC,+BAAa,EAAC,UAAU,EAAEL,QAAQ,EAAEM,+BAAa,CAAC;MAC7D;IACF,CAAC,CAAC,MAAM;MACN;IAAA;IAGF,IAAI,CAACC,OAAO,GAAG,CACb,IAAAC,6BAAW,EAAC,GAAGN,OAAO,CAACO,KAAK,GAAG,MAAM,GAAG,EAAE,IAAIR,SAAS,CAACS,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,EAC/E,EAAE,EACF,GAAG,IAAAC,gCAAc,EAAC,UAAU,CAAC,gCAAgC,EAC7DP,QAAQ,CACT,CAACQ,IAAI,CAAC,IAAI,CAAC;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC9BC,OAAuC,EACvCb,SAA6B,EAC7BC,OAA4B,EACI;EAChC,IAAI,CAAC,IAAAa,4BAAa,EAACD,OAAO,CAAC,EAAE;IAC3B,MAAM,IAAIjB,oBAAoB,CAACiB,OAAO,EAAEb,SAAS,EAAEC,OAAO,CAAC;EAC7D;AACF;AAEO,SAASc,aAAaA,CAC3BC,OAAe,EACfC,aAAqB,EACrBC,aAAiD,EACjDC,aAAqB,EACrBC,aAAwC,EACxC;EACA,OAAO,CACL,GAAGJ,OAAO,IAAI,EACd,GAAGC,aAAa,MAAM,IAAAI,gCAAc,EAAC,IAAAC,eAAM,EAACC,WAAW,CAACL,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAC7E,GAAGC,aAAa,MAAM,IAAAT,gCAAc,EAAC,IAAAY,eAAM,EAACC,WAAW,CAACH,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9E,CAACT,IAAI,CAAC,IAAI,CAAC;AACd;AAEA,SAASY,WAAWA,CAACC,KAAc,EAAE;EACnC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAG,IAAAC,2BAAS,EAACD,KAAK,CAAC;AAC7D","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","e","__esModule","default","HostElementTypeError","Error","constructor","received","matcherFn","context","captureStackTrace","withType","printWithType","printReceived","message","matcherHint","isNot","name","RECEIVED_COLOR","join","checkHostElement","element","isHostElement","formatMessage","matcher","expectedLabel","expectedValue","receivedLabel","receivedValue","EXPECTED_COLOR","redent","formatValue","value","stringify"],"sources":["../../src/matchers/utils.ts"],"sourcesContent":["import {\n EXPECTED_COLOR,\n matcherHint,\n printReceived,\n printWithType,\n RECEIVED_COLOR,\n stringify,\n} from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { isHostElement } from '../helpers/component-tree';\n\nclass HostElementTypeError extends Error {\n constructor(received: unknown, matcherFn: jest.CustomMatcher, context: jest.MatcherContext) {\n super();\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, matcherFn);\n }\n\n let withType = '';\n try {\n withType = printWithType('Received', received, printReceived);\n /* istanbul ignore next */\n } catch {\n // Deliberately empty.\n }\n\n this.message = [\n matcherHint(`${context.isNot ? '.not' : ''}.${matcherFn.name}`, 'received', ''),\n '',\n `${RECEIVED_COLOR('received')} value must be a host element.`,\n withType,\n ].join('\\n');\n }\n}\n\n/**\n * Throws HostElementTypeError if passed element is not a host element.\n *\n * @param element HostElement to check.\n * @param matcherFn Matcher function calling the check used for formatting error.\n * @param context Jest matcher context used for formatting error.\n */\nexport function checkHostElement(\n element: HostElement | null | undefined,\n matcherFn: jest.CustomMatcher,\n context: jest.MatcherContext,\n): asserts element is HostElement {\n if (!isHostElement(element)) {\n throw new HostElementTypeError(element, matcherFn, context);\n }\n}\n\nexport function formatMessage(\n matcher: string,\n expectedLabel: string,\n expectedValue: string | RegExp | null | undefined,\n receivedLabel: string,\n receivedValue: string | null | undefined,\n) {\n return [\n `${matcher}\\n`,\n `${expectedLabel}:\\n${EXPECTED_COLOR(redent(formatValue(expectedValue), 2))}`,\n `${receivedLabel}:\\n${RECEIVED_COLOR(redent(formatValue(receivedValue), 2))}`,\n ].join('\\n');\n}\n\nfunction formatValue(value: unknown) {\n return typeof value === 'string' ? value : stringify(value);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAA0D,SAAAE,uBAAAE,CAAA,WAAA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ACL,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAC7E,GAAGC,aAAa,MAAM,IAAAT,gCAAc,EAAC,IAAAY,eAAM,EAACC,WAAW,CAACH,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9E,CAACT,IAAI,CAAC,IAAI,CAAC;AACd;AAEA,SAASY,WAAWA,CAACC,KAAc,EAAE;EACnC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAG,IAAAC,2BAAS,EAACD,KAAK,CAAC;AAC7D","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { Point } from './types';
3
3
  /**
4
4
  * Simulated native state for unmanaged controls.
@@ -1 +1 @@
1
- {"version":3,"file":"native-state.js","names":["nativeState","exports","valueForElement","WeakMap","contentOffsetForElement"],"sources":["../src/native-state.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { Point } from './types';\n\n/**\n * Simulated native state for unmanaged controls.\n *\n * Values from `value` props (managed controls) should take precedence over these values.\n */\nexport type NativeState = {\n valueForElement: WeakMap<HostElement, string>;\n contentOffsetForElement: WeakMap<HostElement, Point>;\n};\n\nexport const nativeState: NativeState = {\n valueForElement: new WeakMap(),\n contentOffsetForElement: new WeakMap(),\n};\n"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,WAAwB,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACtCE,eAAe,EAAE,IAAIC,OAAO,CAAC,CAAC;EAC9BC,uBAAuB,EAAE,IAAID,OAAO,CAAC;AACvC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"native-state.js","names":["nativeState","exports","valueForElement","WeakMap","contentOffsetForElement"],"sources":["../src/native-state.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { Point } from './types';\n\n/**\n * Simulated native state for unmanaged controls.\n *\n * Values from `value` props (managed controls) should take precedence over these values.\n */\nexport type NativeState = {\n valueForElement: WeakMap<HostElement, string>;\n contentOffsetForElement: WeakMap<HostElement, Point>;\n};\n\nexport const nativeState: NativeState = {\n valueForElement: new WeakMap(),\n contentOffsetForElement: new WeakMap(),\n};\n"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;;AAMO,MAAMA,WAAwB,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACtCE,eAAe,EAAE,IAAIC,OAAO,CAAC,CAAC;EAC9BC,uBAAuB,EAAE,IAAID,OAAO,CAAC;AACvC,CAAC","ignoreList":[]}
package/build/pure.d.ts CHANGED
@@ -1,19 +1,17 @@
1
- export { default as act } from './act';
2
- export { default as cleanup, cleanupAsync } from './cleanup';
3
- export { default as fireEvent, fireEventAsync } from './fire-event';
4
- export { default as render } from './render';
5
- export { default as renderAsync } from './render-async';
6
- export { default as waitFor } from './wait-for';
7
- export { default as waitForElementToBeRemoved } from './wait-for-element-to-be-removed';
8
- export { within, getQueriesForElement } from './within';
1
+ export { act } from './act';
2
+ export { cleanup } from './cleanup';
3
+ export { fireEvent } from './fire-event';
4
+ export { render } from './render';
5
+ export { waitFor } from './wait-for';
6
+ export { waitForElementToBeRemoved } from './wait-for-element-to-be-removed';
7
+ export { within } from './within';
9
8
  export { configure, resetToDefaults } from './config';
10
9
  export { isHiddenFromAccessibility, isInaccessible } from './helpers/accessibility';
11
10
  export { getDefaultNormalizer } from './matches';
12
- export { renderHook, deprecated_renderHookSync } from './render-hook';
11
+ export { renderHook } from './render-hook';
13
12
  export { screen } from './screen';
14
13
  export { userEvent } from './user-event';
15
- export type { RenderOptions, RenderResult, RenderResult as RenderAPI, DebugFunction, } from './render';
16
- export type { RenderAsyncOptions, RenderAsyncResult } from './render-async';
17
- export type { RenderHookOptions, RenderHookResult, RenderHookSyncResult } from './render-hook';
14
+ export type { RenderOptions, RenderResult, DebugFunction } from './render';
15
+ export type { RenderHookOptions, RenderHookResult } from './render-hook';
18
16
  export type { Config } from './config';
19
17
  export type { UserEventConfig } from './user-event';
package/build/pure.js CHANGED
@@ -6,19 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "act", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _act.default;
9
+ return _act.act;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "cleanup", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _cleanup.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "cleanupAsync", {
19
- enumerable: true,
20
- get: function () {
21
- return _cleanup.cleanupAsync;
15
+ return _cleanup.cleanup;
22
16
  }
23
17
  });
24
18
  Object.defineProperty(exports, "configure", {
@@ -27,22 +21,10 @@ Object.defineProperty(exports, "configure", {
27
21
  return _config.configure;
28
22
  }
29
23
  });
30
- Object.defineProperty(exports, "deprecated_renderHookSync", {
31
- enumerable: true,
32
- get: function () {
33
- return _renderHook.deprecated_renderHookSync;
34
- }
35
- });
36
24
  Object.defineProperty(exports, "fireEvent", {
37
25
  enumerable: true,
38
26
  get: function () {
39
- return _fireEvent.default;
40
- }
41
- });
42
- Object.defineProperty(exports, "fireEventAsync", {
43
- enumerable: true,
44
- get: function () {
45
- return _fireEvent.fireEventAsync;
27
+ return _fireEvent.fireEvent;
46
28
  }
47
29
  });
48
30
  Object.defineProperty(exports, "getDefaultNormalizer", {
@@ -51,12 +33,6 @@ Object.defineProperty(exports, "getDefaultNormalizer", {
51
33
  return _matches.getDefaultNormalizer;
52
34
  }
53
35
  });
54
- Object.defineProperty(exports, "getQueriesForElement", {
55
- enumerable: true,
56
- get: function () {
57
- return _within.getQueriesForElement;
58
- }
59
- });
60
36
  Object.defineProperty(exports, "isHiddenFromAccessibility", {
61
37
  enumerable: true,
62
38
  get: function () {
@@ -72,13 +48,7 @@ Object.defineProperty(exports, "isInaccessible", {
72
48
  Object.defineProperty(exports, "render", {
73
49
  enumerable: true,
74
50
  get: function () {
75
- return _render.default;
76
- }
77
- });
78
- Object.defineProperty(exports, "renderAsync", {
79
- enumerable: true,
80
- get: function () {
81
- return _renderAsync.default;
51
+ return _render.render;
82
52
  }
83
53
  });
84
54
  Object.defineProperty(exports, "renderHook", {
@@ -108,13 +78,13 @@ Object.defineProperty(exports, "userEvent", {
108
78
  Object.defineProperty(exports, "waitFor", {
109
79
  enumerable: true,
110
80
  get: function () {
111
- return _waitFor.default;
81
+ return _waitFor.waitFor;
112
82
  }
113
83
  });
114
84
  Object.defineProperty(exports, "waitForElementToBeRemoved", {
115
85
  enumerable: true,
116
86
  get: function () {
117
- return _waitForElementToBeRemoved.default;
87
+ return _waitForElementToBeRemoved.waitForElementToBeRemoved;
118
88
  }
119
89
  });
120
90
  Object.defineProperty(exports, "within", {
@@ -123,13 +93,12 @@ Object.defineProperty(exports, "within", {
123
93
  return _within.within;
124
94
  }
125
95
  });
126
- var _act = _interopRequireDefault(require("./act"));
127
- var _cleanup = _interopRequireWildcard(require("./cleanup"));
128
- var _fireEvent = _interopRequireWildcard(require("./fire-event"));
129
- var _render = _interopRequireDefault(require("./render"));
130
- var _renderAsync = _interopRequireDefault(require("./render-async"));
131
- var _waitFor = _interopRequireDefault(require("./wait-for"));
132
- var _waitForElementToBeRemoved = _interopRequireDefault(require("./wait-for-element-to-be-removed"));
96
+ var _act = require("./act");
97
+ var _cleanup = require("./cleanup");
98
+ var _fireEvent = require("./fire-event");
99
+ var _render = require("./render");
100
+ var _waitFor = require("./wait-for");
101
+ var _waitForElementToBeRemoved = require("./wait-for-element-to-be-removed");
133
102
  var _within = require("./within");
134
103
  var _config = require("./config");
135
104
  var _accessibility = require("./helpers/accessibility");
@@ -137,6 +106,4 @@ var _matches = require("./matches");
137
106
  var _renderHook = require("./render-hook");
138
107
  var _screen = require("./screen");
139
108
  var _userEvent = require("./user-event");
140
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
141
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
142
109
  //# sourceMappingURL=pure.js.map
package/build/pure.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pure.js","names":["_act","_interopRequireDefault","require","_cleanup","_interopRequireWildcard","_fireEvent","_render","_renderAsync","_waitFor","_waitForElementToBeRemoved","_within","_config","_accessibility","_matches","_renderHook","_screen","_userEvent","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../src/pure.ts"],"sourcesContent":["export { default as act } from './act';\nexport { default as cleanup, cleanupAsync } from './cleanup';\nexport { default as fireEvent, fireEventAsync } from './fire-event';\nexport { default as render } from './render';\nexport { default as renderAsync } from './render-async';\nexport { default as waitFor } from './wait-for';\nexport { default as waitForElementToBeRemoved } from './wait-for-element-to-be-removed';\nexport { within, getQueriesForElement } from './within';\n\nexport { configure, resetToDefaults } from './config';\nexport { isHiddenFromAccessibility, isInaccessible } from './helpers/accessibility';\nexport { getDefaultNormalizer } from './matches';\nexport { renderHook, deprecated_renderHookSync } from './render-hook';\nexport { screen } from './screen';\nexport { userEvent } from './user-event';\n\nexport type {\n RenderOptions,\n RenderResult,\n RenderResult as RenderAPI,\n DebugFunction,\n} from './render';\nexport type { RenderAsyncOptions, RenderAsyncResult } from './render-async';\nexport type { RenderHookOptions, RenderHookResult, RenderHookSyncResult } from './render-hook';\nexport type { Config } from './config';\nexport type { UserEventConfig } from './user-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAjB,uBAAAgB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"pure.js","names":["_act","require","_cleanup","_fireEvent","_render","_waitFor","_waitForElementToBeRemoved","_within","_config","_accessibility","_matches","_renderHook","_screen","_userEvent"],"sources":["../src/pure.ts"],"sourcesContent":["export { act } from './act';\nexport { cleanup } from './cleanup';\nexport { fireEvent } from './fire-event';\nexport { render } from './render';\nexport { waitFor } from './wait-for';\nexport { waitForElementToBeRemoved } from './wait-for-element-to-be-removed';\nexport { within } from './within';\n\nexport { configure, resetToDefaults } from './config';\nexport { isHiddenFromAccessibility, isInaccessible } from './helpers/accessibility';\nexport { getDefaultNormalizer } from './matches';\nexport { renderHook } from './render-hook';\nexport { screen } from './screen';\nexport { userEvent } from './user-event';\n\nexport type { RenderOptions, RenderResult, DebugFunction } from './render';\nexport type { RenderHookOptions, RenderHookResult } from './render-hook';\nexport type { Config } from './config';\nexport type { UserEventConfig } from './user-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../matches';
3
3
  import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './make-queries';
4
4
  import type { CommonQueryOptions } from './options';
@@ -1 +1 @@
1
- {"version":3,"file":"display-value.js","names":["_findAll","require","_hostComponentNames","_textInput","_matches","_makeQueries","matchDisplayValue","node","expectedValue","options","exact","normalizer","nodeValue","getTextInputValue","matches","queryAllByDisplayValue","element","queryAllByDisplayValueFn","displayValue","queryOptions","findAll","isHostTextInput","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByDisplayValueQueries","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","findByDisplayValue","findAllByDisplayValue","exports"],"sources":["../../src/queries/display-value.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { getTextInputValue } from '../helpers/text-input';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByDisplayValueOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchDisplayValue = (\n node: HostElement,\n expectedValue: TextMatch,\n options: TextMatchOptions = {},\n) => {\n const { exact, normalizer } = options;\n const nodeValue = getTextInputValue(node);\n return matches(expectedValue, nodeValue, normalizer, exact);\n};\n\nconst queryAllByDisplayValue = (\n element: HostElement,\n): QueryAllByQuery<TextMatch, ByDisplayValueOptions> =>\n function queryAllByDisplayValueFn(displayValue, queryOptions) {\n return findAll(\n element,\n (node) => isHostTextInput(node) && matchDisplayValue(node, displayValue, queryOptions),\n queryOptions,\n );\n };\n\nconst getMultipleError = (displayValue: TextMatch) =>\n `Found multiple elements with display value: ${String(displayValue)} `;\nconst getMissingError = (displayValue: TextMatch) =>\n `Unable to find an element with displayValue: ${String(displayValue)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByDisplayValue,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByDisplayValueQueries = {\n getByDisplayValue: GetByQuery<TextMatch, ByDisplayValueOptions>;\n getAllByDisplayValue: GetAllByQuery<TextMatch, ByDisplayValueOptions>;\n queryByDisplayValue: QueryByQuery<TextMatch, ByDisplayValueOptions>;\n queryAllByDisplayValue: QueryAllByQuery<TextMatch, ByDisplayValueOptions>;\n findByDisplayValue: FindByQuery<TextMatch, ByDisplayValueOptions>;\n findAllByDisplayValue: FindAllByQuery<TextMatch, ByDisplayValueOptions>;\n};\n\nexport const bindByDisplayValueQueries = (element: HostElement): ByDisplayValueQueries => ({\n getByDisplayValue: getBy(element),\n getAllByDisplayValue: getAllBy(element),\n queryByDisplayValue: queryBy(element),\n queryAllByDisplayValue: queryAllBy(element),\n findByDisplayValue: findBy(element),\n findAllByDisplayValue: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAA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AACb,OAAO,CAAC;EACnCqB,qBAAqB,EAAEP,SAAS,CAACd,OAAO;AAC1C,CAAC,CAAC;AAACsB,OAAA,CAAAN,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"file":"display-value.js","names":["_findAll","require","_hostComponentNames","_textInput","_matches","_makeQueries","matchDisplayValue","node","expectedValue","options","exact","normalizer","nodeValue","getTextInputValue","matches","queryAllByDisplayValue","element","queryAllByDisplayValueFn","displayValue","queryOptions","findAll","isHostTextInput","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByDisplayValueQueries","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","findByDisplayValue","findAllByDisplayValue","exports"],"sources":["../../src/queries/display-value.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { getTextInputValue } from '../helpers/text-input';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByDisplayValueOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchDisplayValue = (\n node: HostElement,\n expectedValue: TextMatch,\n options: TextMatchOptions = {},\n) => {\n const { exact, normalizer } = options;\n const nodeValue = getTextInputValue(node);\n return matches(expectedValue, nodeValue, normalizer, exact);\n};\n\nconst queryAllByDisplayValue = (\n element: HostElement,\n): QueryAllByQuery<TextMatch, ByDisplayValueOptions> =>\n function queryAllByDisplayValueFn(displayValue, queryOptions) {\n return findAll(\n element,\n (node) => isHostTextInput(node) && matchDisplayValue(node, displayValue, queryOptions),\n queryOptions,\n );\n };\n\nconst getMultipleError = (displayValue: TextMatch) =>\n `Found multiple elements with display value: ${String(displayValue)} `;\nconst getMissingError = (displayValue: TextMatch) =>\n `Unable to find an element with displayValue: ${String(displayValue)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByDisplayValue,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByDisplayValueQueries = {\n getByDisplayValue: GetByQuery<TextMatch, ByDisplayValueOptions>;\n getAllByDisplayValue: GetAllByQuery<TextMatch, ByDisplayValueOptions>;\n queryByDisplayValue: QueryByQuery<TextMatch, ByDisplayValueOptions>;\n queryAllByDisplayValue: QueryAllByQuery<TextMatch, ByDisplayValueOptions>;\n findByDisplayValue: FindByQuery<TextMatch, ByDisplayValueOptions>;\n findAllByDisplayValue: FindAllByQuery<TextMatch, ByDisplayValueOptions>;\n};\n\nexport const bindByDisplayValueQueries = (element: HostElement): ByDisplayValueQueries => ({\n getByDisplayValue: getBy(element),\n getAllByDisplayValue: getAllBy(element),\n queryByDisplayValue: queryBy(element),\n queryAllByDisplayValue: queryAllBy(element),\n findByDisplayValue: findBy(element),\n findAllByDisplayValue: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AASA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,MAAMK,iBAAiB,GAAGA,CACxBC,IAAiB,EACjBC,aAAwB,EACxBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,MAAMG,SAAS,GAAG,IAAAC,4BAAiB,EAACN,IAAI,CAAC;EACzC,OAAO,IAAAO,gBAAO,EAACN,aAAa,EAAEI,SAAS,EAAED,UAAU,EAAED,KAAK,CAAC;AAC7D,CAAC;AAED,MAAMK,sBAAsB,GAC1BC,OAAoB,IAEpB,SAASC,wBAAwBA,CAACC,YAAY,EAAEC,YAAY,EAAE;EAC5D,OAAO,IAAAC,gBAAO,EACZJ,OAAO,EACNT,IAAI,IAAK,IAAAc,mCAAe,EAACd,IAAI,CAAC,IAAID,iBAAiB,CAACC,IAAI,EAAEW,YAAY,EAAEC,YAAY,CAAC,EACtFA,YACF,CAAC;AACH,CAAC;AAEH,MAAMG,gBAAgB,GAAIJ,YAAuB,IAC/C,+CAA+CK,MAAM,CAACL,YAAY,CAAC,GAAG;AACxE,MAAMM,eAAe,GAAIN,YAAuB,IAC9C,gDAAgDK,MAAM,CAACL,YAAY,CAAC,EAAE;AAExE,MAAM;EAAEO,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EhB,sBAAsB,EACtBS,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,yBAAyB,GAAIhB,OAAoB,KAA6B;EACzFiB,iBAAiB,EAAER,KAAK,CAACT,OAAO,CAAC;EACjCkB,oBAAoB,EAAER,QAAQ,CAACV,OAAO,CAAC;EACvCmB,mBAAmB,EAAER,OAAO,CAACX,OAAO,CAAC;EACrCD,sBAAsB,EAAEa,UAAU,CAACZ,OAAO,CAAC;EAC3CoB,kBAAkB,EAAEP,MAAM,CAACb,OAAO,CAAC;EACnCqB,qBAAqB,EAAEP,SAAS,CAACd,OAAO;AAC1C,CAAC,CAAC;AAACsB,OAAA,CAAAN,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../matches';
3
3
  import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './make-queries';
4
4
  import type { CommonQueryOptions } from './options';
@@ -1 +1 @@
1
- {"version":3,"file":"hint-text.js","names":["_findAll","require","_matches","_makeQueries","getNodeByHintText","node","text","options","exact","normalizer","matches","props","accessibilityHint","queryAllByHintText","element","queryAllByA11yHintFn","hint","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByHintTextQueries","getByHintText","getAllByHintText","queryByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","exports"],"sources":["../../src/queries/hint-text.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByHintTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst getNodeByHintText = (node: HostElement, text: TextMatch, options: TextMatchOptions = {}) => {\n const { exact, normalizer } = options;\n return matches(text, node.props.accessibilityHint, normalizer, exact);\n};\n\nconst queryAllByHintText = (element: HostElement): QueryAllByQuery<TextMatch, ByHintTextOptions> =>\n function queryAllByA11yHintFn(hint, queryOptions) {\n return findAll(element, (node) => getNodeByHintText(node, hint, queryOptions), queryOptions);\n };\n\nconst getMultipleError = (hint: TextMatch) =>\n `Found multiple elements with accessibility hint: ${String(hint)} `;\nconst getMissingError = (hint: TextMatch) =>\n `Unable to find an element with accessibility hint: ${String(hint)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByHintText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByHintTextQueries = {\n getByHintText: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByHintText: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByHintText: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByHintText: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByHintText: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByHintText: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // a11yHint aliases\n getByA11yHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByA11yHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByA11yHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByA11yHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByA11yHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByA11yHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // accessibilityHint aliases\n getByAccessibilityHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByAccessibilityHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByAccessibilityHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByAccessibilityHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByAccessibilityHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByAccessibilityHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n};\n\nexport const bindByHintTextQueries = (element: HostElement): ByHintTextQueries => {\n const getByHintText = getBy(element);\n const getAllByHintText = getAllBy(element);\n const queryByHintText = queryBy(element);\n const queryAllByHintText = queryAllBy(element);\n const findByHintText = findBy(element);\n const findAllByHintText = findAllBy(element);\n\n return {\n getByHintText,\n getAllByHintText,\n queryByHintText,\n queryAllByHintText,\n findByHintText,\n findAllByHintText,\n\n // a11yHint aliases\n getByA11yHint: getByHintText,\n getAllByA11yHint: getAllByHintText,\n queryByA11yHint: queryByHintText,\n queryAllByA11yHint: queryAllByHintText,\n findByA11yHint: findByHintText,\n findAllByA11yHint: findAllByHintText,\n\n // accessibilityHint aliases\n getByAccessibilityHint: getByHintText,\n getAllByAccessibilityHint: getAllByHintText,\n queryByAccessibilityHint: queryByHintText,\n queryAllByAccessibilityHint: queryAllByHintText,\n findByAccessibilityHint: findByHintText,\n findAllByAccessibilityHint: findAllByHintText,\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AAKA,MAAMG,iBAAiB,GAAGA,CAACC,IAAiB,EAAEC,IAAe,EAAEC,OAAyB,GAAG,CAAC,CAAC,KAAK;EAChG,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,IAAI,EAAED,IAAI,CAACM,KAAK,CAACC,iBAAiB,EAAEH,UAAU,EAAED,KAAK,CAAC;AACvE,CAAC;AAED,MAAMK,kBAAkB,GAAIC,OAAoB,IAC9C,SAASC,oBAAoBA,CAACC,IAAI,EAAEC,YAAY,EAAE;EAChD,OAAO,IAAAC,gBAAO,EAACJ,OAAO,EAAGT,IAAI,IAAKD,iBAAiB,CAACC,IAAI,EAAEW,IAAI,EAAEC,YAAY,CAAC,EAAEA,YAAY,CAAC;AAC9F,CAAC;AAEH,MAAME,gBAAgB,GAAIH,IAAe,IACvC,oDAAoDI,MAAM,CAACJ,IAAI,CAAC,GAAG;AACrE,MAAMK,eAAe,GAAIL,IAAe,IACtC,sDAAsDI,MAAM,CAACJ,IAAI,CAAC,EAAE;AAEtE,MAAM;EAAEM,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ef,kBAAkB,EAClBQ,eAAe,EACfF,gBACF,CAAC;AA2BM,MAAMU,qBAAqB,GAAIf,OAAoB,IAAwB;EAChF,MAAMgB,aAAa,GAAGR,KAAK,CAACR,OAAO,CAAC;EACpC,MAAMiB,gBAAgB,GAAGR,QAAQ,CAACT,OAAO,CAAC;EAC1C,MAAMkB,eAAe,GAAGR,OAAO,CAACV,OAAO,CAAC;EACxC,MAAMD,kBAAkB,GAAGY,UAAU,CAACX,OAAO,CAAC;EAC9C,MAAMmB,cAAc,GAAGP,MAAM,CAACZ,OAAO,CAAC;EACtC,MAAMoB,iBAAiB,GAAGP,SAAS,CAACb,OAAO,CAAC;EAE5C,OAAO;IACLgB,aAAa;IACbC,gBAAgB;IAChBC,eAAe;IACfnB,kBAAkB;IAClBoB,cAAc;IACdC,iBAAiB;IAEjB;IACAC,aAAa,EAAEL,aAAa;IAC5BM,gBAAgB,EAAEL,gBAAgB;IAClCM,eAAe,EAAEL,eAAe;IAChCM,kBAAkB,EAAEzB,kBAAkB;IACtC0B,cAAc,EAAEN,cAAc;IAC9BO,iBAAiB,EAAEN,iBAAiB;IAEpC;IACAO,sBAAsB,EAAEX,aAAa;IACrCY,yBAAyB,EAAEX,gBAAgB;IAC3CY,wBAAwB,EAAEX,eAAe;IACzCY,2BAA2B,EAAE/B,kBAAkB;IAC/CgC,uBAAuB,EAAEZ,cAAc;IACvCa,0BAA0B,EAAEZ;EAC9B,CAAC;AACH,CAAC;AAACa,OAAA,CAAAlB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"hint-text.js","names":["_findAll","require","_matches","_makeQueries","getNodeByHintText","node","text","options","exact","normalizer","matches","props","accessibilityHint","queryAllByHintText","element","queryAllByA11yHintFn","hint","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByHintTextQueries","getByHintText","getAllByHintText","queryByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","exports"],"sources":["../../src/queries/hint-text.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByHintTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst getNodeByHintText = (node: HostElement, text: TextMatch, options: TextMatchOptions = {}) => {\n const { exact, normalizer } = options;\n return matches(text, node.props.accessibilityHint, normalizer, exact);\n};\n\nconst queryAllByHintText = (element: HostElement): QueryAllByQuery<TextMatch, ByHintTextOptions> =>\n function queryAllByA11yHintFn(hint, queryOptions) {\n return findAll(element, (node) => getNodeByHintText(node, hint, queryOptions), queryOptions);\n };\n\nconst getMultipleError = (hint: TextMatch) =>\n `Found multiple elements with accessibility hint: ${String(hint)} `;\nconst getMissingError = (hint: TextMatch) =>\n `Unable to find an element with accessibility hint: ${String(hint)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByHintText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByHintTextQueries = {\n getByHintText: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByHintText: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByHintText: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByHintText: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByHintText: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByHintText: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // a11yHint aliases\n getByA11yHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByA11yHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByA11yHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByA11yHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByA11yHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByA11yHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n\n // accessibilityHint aliases\n getByAccessibilityHint: GetByQuery<TextMatch, ByHintTextOptions>;\n getAllByAccessibilityHint: GetAllByQuery<TextMatch, ByHintTextOptions>;\n queryByAccessibilityHint: QueryByQuery<TextMatch, ByHintTextOptions>;\n queryAllByAccessibilityHint: QueryAllByQuery<TextMatch, ByHintTextOptions>;\n findByAccessibilityHint: FindByQuery<TextMatch, ByHintTextOptions>;\n findAllByAccessibilityHint: FindAllByQuery<TextMatch, ByHintTextOptions>;\n};\n\nexport const bindByHintTextQueries = (element: HostElement): ByHintTextQueries => {\n const getByHintText = getBy(element);\n const getAllByHintText = getAllBy(element);\n const queryByHintText = queryBy(element);\n const queryAllByHintText = queryAllBy(element);\n const findByHintText = findBy(element);\n const findAllByHintText = findAllBy(element);\n\n return {\n getByHintText,\n getAllByHintText,\n queryByHintText,\n queryAllByHintText,\n findByHintText,\n findAllByHintText,\n\n // a11yHint aliases\n getByA11yHint: getByHintText,\n getAllByA11yHint: getAllByHintText,\n queryByA11yHint: queryByHintText,\n queryAllByA11yHint: queryAllByHintText,\n findByA11yHint: findByHintText,\n findAllByA11yHint: findAllByHintText,\n\n // accessibilityHint aliases\n getByAccessibilityHint: getByHintText,\n getAllByAccessibilityHint: getAllByHintText,\n queryByAccessibilityHint: queryByHintText,\n queryAllByAccessibilityHint: queryAllByHintText,\n findByAccessibilityHint: findByHintText,\n findAllByAccessibilityHint: findAllByHintText,\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AAKA,MAAMG,iBAAiB,GAAGA,CAACC,IAAiB,EAAEC,IAAe,EAAEC,OAAyB,GAAG,CAAC,CAAC,KAAK;EAChG,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,IAAI,EAAED,IAA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B,cAAc,EAAEN,cAAc;IAC9BO,iBAAiB,EAAEN,iBAAiB;IAEpC;IACAO,sBAAsB,EAAEX,aAAa;IACrCY,yBAAyB,EAAEX,gBAAgB;IAC3CY,wBAAwB,EAAEX,eAAe;IACzCY,2BAA2B,EAAE/B,kBAAkB;IAC/CgC,uBAAuB,EAAEZ,cAAc;IACvCa,0BAA0B,EAAEZ;EAC9B,CAAC;AACH,CAAC;AAACa,OAAA,CAAAlB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../matches';
3
3
  import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './make-queries';
4
4
  import type { CommonQueryOptions } from './options';
@@ -1 +1 @@
1
- {"version":3,"file":"label-text.js","names":["_findAll","require","_matchLabelText","_makeQueries","queryAllByLabelText","element","text","queryOptions","findAll","node","matchAccessibilityLabel","getMultipleError","labelText","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByLabelTextQueries","getByLabelText","getAllByLabelText","queryByLabelText","findByLabelText","findAllByLabelText","exports"],"sources":["../../src/queries/label-text.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { matchAccessibilityLabel } from '../helpers/matchers/match-label-text';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByLabelTextOptions = CommonQueryOptions & TextMatchOptions;\n\nfunction queryAllByLabelText(element: HostElement) {\n return (text: TextMatch, queryOptions?: ByLabelTextOptions) => {\n return findAll(\n element,\n (node) => matchAccessibilityLabel(node, text, queryOptions),\n queryOptions,\n );\n };\n}\n\nconst getMultipleError = (labelText: TextMatch) =>\n `Found multiple elements with accessibility label: ${String(labelText)} `;\nconst getMissingError = (labelText: TextMatch) =>\n `Unable to find an element with accessibility label: ${String(labelText)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByLabelText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByLabelTextQueries = {\n getByLabelText: GetByQuery<TextMatch, ByLabelTextOptions>;\n getAllByLabelText: GetAllByQuery<TextMatch, ByLabelTextOptions>;\n queryByLabelText: QueryByQuery<TextMatch, ByLabelTextOptions>;\n queryAllByLabelText: QueryAllByQuery<TextMatch, ByLabelTextOptions>;\n findByLabelText: FindByQuery<TextMatch, ByLabelTextOptions>;\n findAllByLabelText: FindAllByQuery<TextMatch, ByLabelTextOptions>;\n};\n\nexport const bindByLabelTextQueries = (element: HostElement): ByLabelTextQueries => ({\n getByLabelText: getBy(element),\n getAllByLabelText: getAllBy(element),\n queryByLabelText: queryBy(element),\n queryAllByLabelText: queryAllBy(element),\n findByLabelText: findBy(element),\n findAllByLabelText: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAUA,IAAAE,YAAA,GAAAF,OAAA;AAKA,SAASG,mBAAmBA,CAACC,OAAoB,EAAE;EACjD,OAAO,CAACC,IAAe,EAAEC,YAAiC,KAAK;IAC7D,OAAO,IAAAC,gBAAO,EACZH,OAAO,EACNI,IAAI,IAAK,IAAAC,uCAAuB,EAACD,IAAI,EAAEH,IAAI,EAAEC,YAAY,CAAC,EAC3DA,YACF,CAAC;EACH,CAAC;AACH;AAEA,MAAMI,gBAAgB,GAAIC,SAAoB,IAC5C,qDAAqDC,MAAM,CAACD,SAAS,CAAC,GAAG;AAC3E,MAAME,eAAe,GAAIF,SAAoB,IAC3C,uDAAuDC,MAAM,CAACD,SAAS,CAAC,EAAE;AAE5E,MAAM;EAAEG,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EjB,mBAAmB,EACnBU,eAAe,EACfH,gBACF,CAAC;AAWM,MAAMW,sBAAsB,GAAIjB,OAAoB,KAA0B;EACnFkB,cAAc,EAAER,KAAK,CAACV,OAAO,CAAC;EAC9BmB,iBAAiB,EAAER,QAAQ,CAACX,OAAO,CAAC;EACpCoB,gBAAgB,EAAER,OAAO,CAACZ,OAAO,CAAC;EAClCD,mBAAmB,EAAEc,UAAU,CAACb,OAAO,CAAC;EACxCqB,eAAe,EAAEP,MAAM,CAACd,OAAO,CAAC;EAChCsB,kBAAkB,EAAEP,SAAS,CAACf,OAAO;AACvC,CAAC,CAAC;AAACuB,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"file":"label-text.js","names":["_findAll","require","_matchLabelText","_makeQueries","queryAllByLabelText","element","text","queryOptions","findAll","node","matchAccessibilityLabel","getMultipleError","labelText","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByLabelTextQueries","getByLabelText","getAllByLabelText","queryByLabelText","findByLabelText","findAllByLabelText","exports"],"sources":["../../src/queries/label-text.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { matchAccessibilityLabel } from '../helpers/matchers/match-label-text';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByLabelTextOptions = CommonQueryOptions & TextMatchOptions;\n\nfunction queryAllByLabelText(element: HostElement) {\n return (text: TextMatch, queryOptions?: ByLabelTextOptions) => {\n return findAll(\n element,\n (node) => matchAccessibilityLabel(node, text, queryOptions),\n queryOptions,\n );\n };\n}\n\nconst getMultipleError = (labelText: TextMatch) =>\n `Found multiple elements with accessibility label: ${String(labelText)} `;\nconst getMissingError = (labelText: TextMatch) =>\n `Unable to find an element with accessibility label: ${String(labelText)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByLabelText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByLabelTextQueries = {\n getByLabelText: GetByQuery<TextMatch, ByLabelTextOptions>;\n getAllByLabelText: GetAllByQuery<TextMatch, ByLabelTextOptions>;\n queryByLabelText: QueryByQuery<TextMatch, ByLabelTextOptions>;\n queryAllByLabelText: QueryAllByQuery<TextMatch, ByLabelTextOptions>;\n findByLabelText: FindByQuery<TextMatch, ByLabelTextOptions>;\n findAllByLabelText: FindAllByQuery<TextMatch, ByLabelTextOptions>;\n};\n\nexport const bindByLabelTextQueries = (element: HostElement): ByLabelTextQueries => ({\n getByLabelText: getBy(element),\n getAllByLabelText: getAllBy(element),\n queryByLabelText: queryBy(element),\n queryAllByLabelText: queryAllBy(element),\n findByLabelText: findBy(element),\n findAllByLabelText: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAUA,IAAAE,YAAA,GAAAF,OAAA;AAKA,SAASG,mBAAmBA,CAACC,OAAoB,EAAE;EACjD,OAAO,CAACC,IAAe,EAAEC,YAAiC,KAAK;IAC7D,OAAO,IAAAC,gBAAO,EACZH,OAAO,EACNI,IAAI,IAAK,IAAAC,uCAAuB,EAACD,IAAI,EAAEH,IAAI,EAAEC,YAAY,CAAC,EAC3DA,YACF,CAAC;EACH,CAAC;AACH;AAEA,MAAMI,gBAAgB,GAAIC,SAAoB,IAC5C,qDAAqDC,MAAM,CAACD,SAAS,CAAC,GAAG;AAC3E,MAAME,eAAe,GAAIF,SAAoB,IAC3C,uDAAuDC,MAAM,CAACD,SAAS,CAAC,EAAE;AAE5E,MAAM;EAAEG,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EjB,mBAAmB,EACnBU,eAAe,EACfH,gBACF,CAAC;AAWM,MAAMW,sBAAsB,GAAIjB,OAAoB,KAA0B;EACnFkB,cAAc,EAAER,KAAK,CAACV,OAAO,CAAC;EAC9BmB,iBAAiB,EAAER,QAAQ,CAACX,OAAO,CAAC;EACpCoB,gBAAgB,EAAER,OAAO,CAACZ,OAAO,CAAC;EAClCD,mBAAmB,EAAEc,UAAU,CAACb,OAAO,CAAC;EACxCqB,eAAe,EAAEP,MAAM,CAACd,OAAO,CAAC;EAChCsB,kBAAkB,EAAEP,SAAS,CAACf,OAAO;AACvC,CAAC,CAAC;AAACuB,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { WaitForOptions } from '../wait-for';
3
3
  export type GetByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => HostElement;
4
4
  export type GetAllByQuery<Predicate, Options = void> = (predicate: Predicate, options?: Options) => HostElement[];
@@ -8,8 +8,7 @@ var _errors = require("../helpers/errors");
8
8
  var _formatElement = require("../helpers/format-element");
9
9
  var _logger = require("../helpers/logger");
10
10
  var _screen = require("../screen");
11
- var _waitFor = _interopRequireDefault(require("../wait-for"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ var _waitFor = require("../wait-for");
13
12
  const deprecatedKeys = ['timeout', 'interval', 'stackTraceError'];
14
13
 
15
14
  // The WaitForOptions has been moved to the second option param of findBy* methods with the adding of TextMatchOptions
@@ -104,7 +103,7 @@ function makeQueries(queryAllByQuery, getMissingError, getMultipleError) {
104
103
  } = {}) {
105
104
  const stackTraceError = new _errors.ErrorWithStack('STACK_TRACE_ERROR', findAllFn);
106
105
  const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);
107
- return (0, _waitFor.default)(() => getAllByQuery(element, {
106
+ return (0, _waitFor.waitFor)(() => getAllByQuery(element, {
108
107
  printElementTree: false
109
108
  })(predicate, queryOptions), {
110
109
  ...deprecatedWaitForOptions,
@@ -121,7 +120,7 @@ function makeQueries(queryAllByQuery, getMissingError, getMultipleError) {
121
120
  } = {}) {
122
121
  const stackTraceError = new _errors.ErrorWithStack('STACK_TRACE_ERROR', findFn);
123
122
  const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);
124
- return (0, _waitFor.default)(() => getByQuery(element, {
123
+ return (0, _waitFor.waitFor)(() => getByQuery(element, {
125
124
  printElementTree: false
126
125
  })(predicate, queryOptions), {
127
126
  ...deprecatedWaitForOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"make-queries.js","names":["_errors","require","_formatElement","_logger","_screen","_waitFor","_interopRequireDefault","e","__esModule","default","deprecatedKeys","extractDeprecatedWaitForOptions","options","undefined","waitForOptions","timeout","interval","stackTraceError","forEach","key","option","logger","warn","toString","formatErrorMessage","message","printElementTree","screen","isDetached","json","toJSON","formatJson","appendElementTreeToError","error","oldMessage","stack","replace","makeQueries","queryAllByQuery","getMissingError","getMultipleError","getAllByQuery","element","getAllFn","predicate","results","length","errorMessage","ErrorWithStack","queryByQuery","singleQueryFn","getByQuery","getFn","findAllByQuery","findAllFn","queryOptions","onTimeout","deprecatedWaitForOptions","waitFor","findByQuery","findFn","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy"],"sources":["../../src/queries/make-queries.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatJson } from '../helpers/format-element';\nimport { logger } from '../helpers/logger';\nimport { screen } from '../screen';\nimport type { WaitForOptions } from '../wait-for';\nimport waitFor from '../wait-for';\n\nexport type GetByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement;\n\nexport type GetAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement[];\n\nexport type QueryByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement | null;\n\nexport type QueryAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement[];\n\nexport type FindByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n // Remove `& WaitForOptions` when all queries have been migrated to support 2nd arg query options.\n options?: Options & WaitForOptions,\n waitForOptions?: WaitForOptions,\n) => Promise<HostElement>;\n\nexport type FindAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n // Remove `& WaitForOptions` when all queries have been migrated to support 2nd arg query options.\n options?: Options & WaitForOptions,\n waitForOptions?: WaitForOptions,\n) => Promise<HostElement[]>;\n\ntype UnboundQuery<Query> = (element: HostElement) => Query;\n\nexport type UnboundQueries<Predicate, Options> = {\n getBy: UnboundQuery<GetByQuery<Predicate, Options>>;\n getAllBy: UnboundQuery<GetAllByQuery<Predicate, Options>>;\n queryBy: UnboundQuery<QueryByQuery<Predicate, Options>>;\n queryAllBy: UnboundQuery<QueryAllByQuery<Predicate, Options>>;\n findBy: UnboundQuery<FindByQuery<Predicate, Options>>;\n findAllBy: UnboundQuery<FindAllByQuery<Predicate, Options>>;\n};\n\nconst deprecatedKeys: (keyof WaitForOptions)[] = ['timeout', 'interval', 'stackTraceError'];\n\n// The WaitForOptions has been moved to the second option param of findBy* methods with the adding of TextMatchOptions\n// To make the migration easier and avoid a breaking change, keep reading this options from the first param but warn\nfunction extractDeprecatedWaitForOptions(options?: WaitForOptions) {\n if (!options) {\n return undefined;\n }\n\n const waitForOptions: WaitForOptions = {\n timeout: options.timeout,\n interval: options.interval,\n stackTraceError: options.stackTraceError,\n };\n\n deprecatedKeys.forEach((key) => {\n const option = options[key];\n if (option) {\n logger.warn(\n `Use of option \"${key}\" in a findBy* query options (2nd parameter) is deprecated. Please pass this option in the waitForOptions (3rd parameter).\nExample:\n\n findByText(text, {}, { ${key}: ${option.toString()} })`,\n );\n }\n });\n\n return waitForOptions;\n}\n\nfunction formatErrorMessage(message: string, printElementTree: boolean) {\n if (!printElementTree) {\n return message;\n }\n\n if (screen.isDetached) {\n return `${message}\\n\\nScreen is no longer attached. Check your test for \"findBy*\" or \"waitFor\" calls that have not been awaited.\\n\\nWe recommend enabling \"eslint-plugin-testing-library\" to catch these issues at build time:\\nhttps://callstack.github.io/react-native-testing-library/docs/start/quick-start#eslint-plugin`;\n }\n\n const json = screen.toJSON();\n if (!json) {\n return message;\n }\n\n return `${message}\\n\\n${formatJson(json)}`;\n}\n\nfunction appendElementTreeToError(error: Error) {\n const oldMessage = error.message;\n error.message = formatErrorMessage(oldMessage, true);\n\n // Required to make Jest print the element tree on error\n error.stack = error.stack?.replace(oldMessage, error.message);\n\n return error;\n}\n\nexport function makeQueries<Predicate, Options>(\n queryAllByQuery: UnboundQuery<QueryAllByQuery<Predicate, Options>>,\n getMissingError: (predicate: Predicate, options?: Options) => string,\n getMultipleError: (predicate: Predicate, options?: Options) => string,\n): UnboundQueries<Predicate, Options> {\n function getAllByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function getAllFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length === 0) {\n const errorMessage = formatErrorMessage(\n getMissingError(predicate, options),\n printElementTree,\n );\n throw new ErrorWithStack(errorMessage, getAllFn);\n }\n\n return results;\n };\n }\n\n function queryByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function singleQueryFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(\n formatErrorMessage(getMultipleError(predicate, options), printElementTree),\n singleQueryFn,\n );\n }\n\n if (results.length === 0) {\n return null;\n }\n\n return results[0];\n };\n }\n\n function getByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function getFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(getMultipleError(predicate, options), getFn);\n }\n\n if (results.length === 0) {\n const errorMessage = formatErrorMessage(\n getMissingError(predicate, options),\n printElementTree,\n );\n throw new ErrorWithStack(errorMessage, getFn);\n }\n\n return results[0];\n };\n }\n\n function findAllByQuery(element: HostElement) {\n return function findAllFn(\n predicate: Predicate,\n queryOptions?: Options & WaitForOptions,\n {\n onTimeout = (error) => appendElementTreeToError(error),\n ...waitForOptions\n }: WaitForOptions = {},\n ) {\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', findAllFn);\n const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);\n\n return waitFor(\n () => getAllByQuery(element, { printElementTree: false })(predicate, queryOptions),\n {\n ...deprecatedWaitForOptions,\n ...waitForOptions,\n stackTraceError,\n onTimeout,\n },\n );\n };\n }\n\n function findByQuery(element: HostElement) {\n return function findFn(\n predicate: Predicate,\n queryOptions?: Options & WaitForOptions,\n {\n onTimeout = (error) => appendElementTreeToError(error),\n ...waitForOptions\n }: WaitForOptions = {},\n ) {\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', findFn);\n const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);\n\n return waitFor(\n () => getByQuery(element, { printElementTree: false })(predicate, queryOptions),\n {\n ...deprecatedWaitForOptions,\n ...waitForOptions,\n stackTraceError,\n onTimeout,\n },\n );\n };\n }\n\n return {\n getBy: getByQuery,\n getAllBy: getAllByQuery,\n queryBy: queryByQuery,\n queryAllBy: queryAllByQuery,\n findBy: findByQuery,\n findAllBy: findAllByQuery,\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL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YAAY,CAAC,EAClF;QACE,GAAGE,wBAAwB;QAC3B,GAAG3C,cAAc;QACjBG,eAAe;QACfuC;MACF,CACF,CAAC;IACH,CAAC;EACH;EAEA,SAASG,WAAWA,CAACjB,OAAoB,EAAE;IACzC,OAAO,SAASkB,MAAMA,CACpBhB,SAAoB,EACpBW,YAAuC,EACvC;MACEC,SAAS,GAAIvB,KAAK,IAAKD,wBAAwB,CAACC,KAAK,CAAC;MACtD,GAAGnB;IACW,CAAC,GAAG,CAAC,CAAC,EACtB;MACA,MAAMG,eAAe,GAAG,IAAI+B,sBAAc,CAAC,mBAAmB,EAAEY,MAAM,CAAC;MACvE,MAAMH,wBAAwB,GAAG9C,+BAA+B,CAAC4C,YAAY,CAAC;MAE9E,OAAO,IAAAG,gBAAO,EACZ,MAAMP,UAAU,CAACT,OAAO,EAAE;QAAEhB,gBAAgB,EAAE;MAAM,CAAC,CAAC,CAACkB,SAAS,EAAEW,YAAY,CAAC,EAC/E;QACE,GAAGE,wBAAwB;QAC3B,GAAG3C,cAAc;QACjBG,eAAe;QACfuC;MACF,CACF,CAAC;IACH,CAAC;EACH;EAEA,OAAO;IACLK,KAAK,EAAEV,UAAU;IACjBW,QAAQ,EAAErB,aAAa;IACvBsB,OAAO,EAAEd,YAAY;IACrBe,UAAU,EAAE1B,eAAe;IAC3B2B,MAAM,EAAEN,WAAW;IACnBO,SAAS,EAAEb;EACb,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"make-queries.js","names":["_errors","require","_formatElement","_logger","_screen","_waitFor","deprecatedKeys","extractDeprecatedWaitForOptions","options","undefined","waitForOptions","timeout","interval","stackTraceError","forEach","key","option","logger","warn","toString","formatErrorMessage","message","printElementTree","screen","isDetached","json","toJSON","formatJson","appendElementTreeToError","error","oldMessage","stack","replace","makeQueries","queryAllByQuery","getMissingError","getMultipleError","getAllByQuery","element","getAllFn","predicate","results","length","errorMessage","ErrorWithStack","queryByQuery","singleQueryFn","getByQuery","getFn","findAllByQuery","findAllFn","queryOptions","onTimeout","deprecatedWaitForOptions","waitFor","findByQuery","findFn","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy"],"sources":["../../src/queries/make-queries.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatJson } from '../helpers/format-element';\nimport { logger } from '../helpers/logger';\nimport { screen } from '../screen';\nimport type { WaitForOptions } from '../wait-for';\nimport { waitFor } from '../wait-for';\n\nexport type GetByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement;\n\nexport type GetAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement[];\n\nexport type QueryByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement | null;\n\nexport type QueryAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n options?: Options,\n) => HostElement[];\n\nexport type FindByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n // Remove `& WaitForOptions` when all queries have been migrated to support 2nd arg query options.\n options?: Options & WaitForOptions,\n waitForOptions?: WaitForOptions,\n) => Promise<HostElement>;\n\nexport type FindAllByQuery<Predicate, Options = void> = (\n predicate: Predicate,\n // Remove `& WaitForOptions` when all queries have been migrated to support 2nd arg query options.\n options?: Options & WaitForOptions,\n waitForOptions?: WaitForOptions,\n) => Promise<HostElement[]>;\n\ntype UnboundQuery<Query> = (element: HostElement) => Query;\n\nexport type UnboundQueries<Predicate, Options> = {\n getBy: UnboundQuery<GetByQuery<Predicate, Options>>;\n getAllBy: UnboundQuery<GetAllByQuery<Predicate, Options>>;\n queryBy: UnboundQuery<QueryByQuery<Predicate, Options>>;\n queryAllBy: UnboundQuery<QueryAllByQuery<Predicate, Options>>;\n findBy: UnboundQuery<FindByQuery<Predicate, Options>>;\n findAllBy: UnboundQuery<FindAllByQuery<Predicate, Options>>;\n};\n\nconst deprecatedKeys: (keyof WaitForOptions)[] = ['timeout', 'interval', 'stackTraceError'];\n\n// The WaitForOptions has been moved to the second option param of findBy* methods with the adding of TextMatchOptions\n// To make the migration easier and avoid a breaking change, keep reading this options from the first param but warn\nfunction extractDeprecatedWaitForOptions(options?: WaitForOptions) {\n if (!options) {\n return undefined;\n }\n\n const waitForOptions: WaitForOptions = {\n timeout: options.timeout,\n interval: options.interval,\n stackTraceError: options.stackTraceError,\n };\n\n deprecatedKeys.forEach((key) => {\n const option = options[key];\n if (option) {\n logger.warn(\n `Use of option \"${key}\" in a findBy* query options (2nd parameter) is deprecated. Please pass this option in the waitForOptions (3rd parameter).\nExample:\n\n findByText(text, {}, { ${key}: ${option.toString()} })`,\n );\n }\n });\n\n return waitForOptions;\n}\n\nfunction formatErrorMessage(message: string, printElementTree: boolean) {\n if (!printElementTree) {\n return message;\n }\n\n if (screen.isDetached) {\n return `${message}\\n\\nScreen is no longer attached. Check your test for \"findBy*\" or \"waitFor\" calls that have not been awaited.\\n\\nWe recommend enabling \"eslint-plugin-testing-library\" to catch these issues at build time:\\nhttps://callstack.github.io/react-native-testing-library/docs/start/quick-start#eslint-plugin`;\n }\n\n const json = screen.toJSON();\n if (!json) {\n return message;\n }\n\n return `${message}\\n\\n${formatJson(json)}`;\n}\n\nfunction appendElementTreeToError(error: Error) {\n const oldMessage = error.message;\n error.message = formatErrorMessage(oldMessage, true);\n\n // Required to make Jest print the element tree on error\n error.stack = error.stack?.replace(oldMessage, error.message);\n\n return error;\n}\n\nexport function makeQueries<Predicate, Options>(\n queryAllByQuery: UnboundQuery<QueryAllByQuery<Predicate, Options>>,\n getMissingError: (predicate: Predicate, options?: Options) => string,\n getMultipleError: (predicate: Predicate, options?: Options) => string,\n): UnboundQueries<Predicate, Options> {\n function getAllByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function getAllFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length === 0) {\n const errorMessage = formatErrorMessage(\n getMissingError(predicate, options),\n printElementTree,\n );\n throw new ErrorWithStack(errorMessage, getAllFn);\n }\n\n return results;\n };\n }\n\n function queryByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function singleQueryFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(\n formatErrorMessage(getMultipleError(predicate, options), printElementTree),\n singleQueryFn,\n );\n }\n\n if (results.length === 0) {\n return null;\n }\n\n return results[0];\n };\n }\n\n function getByQuery(element: HostElement, { printElementTree = true } = {}) {\n return function getFn(predicate: Predicate, options?: Options) {\n const results = queryAllByQuery(element)(predicate, options);\n\n if (results.length > 1) {\n throw new ErrorWithStack(getMultipleError(predicate, options), getFn);\n }\n\n if (results.length === 0) {\n const errorMessage = formatErrorMessage(\n getMissingError(predicate, options),\n printElementTree,\n );\n throw new ErrorWithStack(errorMessage, getFn);\n }\n\n return results[0];\n };\n }\n\n function findAllByQuery(element: HostElement) {\n return function findAllFn(\n predicate: Predicate,\n queryOptions?: Options & WaitForOptions,\n {\n onTimeout = (error) => appendElementTreeToError(error),\n ...waitForOptions\n }: WaitForOptions = {},\n ) {\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', findAllFn);\n const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);\n\n return waitFor(\n () => getAllByQuery(element, { printElementTree: false })(predicate, queryOptions),\n {\n ...deprecatedWaitForOptions,\n ...waitForOptions,\n stackTraceError,\n onTimeout,\n },\n );\n };\n }\n\n function findByQuery(element: HostElement) {\n return function findFn(\n predicate: Predicate,\n queryOptions?: Options & WaitForOptions,\n {\n onTimeout = (error) => appendElementTreeToError(error),\n ...waitForOptions\n }: WaitForOptions = {},\n ) {\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', findFn);\n const deprecatedWaitForOptions = extractDeprecatedWaitForOptions(queryOptions);\n\n return waitFor(\n () => getByQuery(element, { printElementTree: false })(predicate, queryOptions),\n {\n ...deprecatedWaitForOptions,\n ...waitForOptions,\n stackTraceError,\n onTimeout,\n },\n );\n };\n }\n\n return {\n getBy: getByQuery,\n getAllBy: getAllByQuery,\n queryBy: queryByQuery,\n queryAllBy: queryAllByQuery,\n findBy: findByQuery,\n findAllBy: findAllByQuery,\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AA+CA,MAAMK,cAAwC,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC;;AAE3F;AACA;AACA,SAASC,+BAA+BA,CAACC,OAAwB,EAAE;EACjE,IAAI,CAACA,OAAO,EAAE;IACZ,OAAOC,SAAS;EAClB;EAEA,MAAMC,cAA8B,GAAG;IACrCC,OAAO,EAAEH,OAAO,CAACG,OAAO;IACxBC,QAAQ,EAAEJ,OAAO,CAACI,QAAQ;IAC1BC,eAAe,EAAEL,OAAO,CAACK;EAC3B,CAAC;EAEDP,cAAc,CAACQ,OAAO,CAAEC,GAAG,IAAK;IAC9B,MAAMC,MAAM,GAAGR,OAAO,CAACO,GAAG,CAAC;IAC3B,IAAIC,MAAM,EAAE;MACVC,cAAM,CAACC,IAAI,CACT,kBAAkBH,GAAG;AAC7B;AACA;AACA,2BAA2BA,GAAG,KAAKC,MAAM,CAACG,QAAQ,CAAC,CAAC,KAC9C,CAAC;IACH;EACF,CAAC,CAAC;EAEF,OAAOT,cAAc;AACvB;AAEA,SAASU,kBAAkBA,CAACC,OAAe,EAAEC,gBAAyB,EAAE;EACtE,IAAI,CAACA,gBAAgB,EAAE;IACrB,OAAOD,OAAO;EAChB;EAEA,IAAIE,cAAM,CAACC,UAAU,EAAE;IACrB,OAAO,GAAGH,OAAO,6SAA6S;EAChU;EAEA,MAAMI,IAAI,GAAGF,cAAM,CAACG,MAAM,CAAC,CAAC;EAC5B,IAAI,CAACD,IAAI,EAAE;IAC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,SAAS,CAAC;MAC1E,MAAMG,wBAAwB,GAAG9C,+BAA+B,CAAC4C,YAAY,CAAC;MAE9E,OAAO,IAAAG,gBAAO,EACZ,MAAMjB,aAAa,CAACC,OAAO,EAAE;QAAEhB,gBAAgB,EAAE;MAAM,CAAC,CAAC,CAACkB,SAAS,EAAEW,YAAY,CAAC,EAClF;QACE,GAAGE,wBAAwB;QAC3B,GAAG3C,cAAc;QACjBG,eAAe;QACfuC;MACF,CACF,CAAC;IACH,CAAC;EACH;EAEA,SAASG,WAAWA,CAACjB,OAAoB,EAAE;IACzC,OAAO,SAASkB,MAAMA,CACpBhB,SAAoB,EACpBW,YAAuC,EACvC;MACEC,SAAS,GAAIvB,KAAK,IAAKD,wBAAwB,CAACC,KAAK,CAAC;MACtD,GAAGnB;IACW,CAAC,GAAG,CAAC,CAAC,EACtB;MACA,MAAMG,eAAe,GAAG,IAAI+B,sBAAc,CAAC,mBAAmB,EAAEY,MAAM,CAAC;MACvE,MAAMH,wBAAwB,GAAG9C,+BAA+B,CAAC4C,YAAY,CAAC;MAE9E,OAAO,IAAAG,gBAAO,EACZ,MAAMP,UAAU,CAACT,OAAO,EAAE;QAAEhB,gBAAgB,EAAE;MAAM,CAAC,CAAC,CAACkB,SAAS,EAAEW,YAAY,CAAC,EAC/E;QACE,GAAGE,wBAAwB;QAC3B,GAAG3C,cAAc;QACjBG,eAAe;QACfuC;MACF,CACF,CAAC;IACH,CAAC;EACH;EAEA,OAAO;IACLK,KAAK,EAAEV,UAAU;IACjBW,QAAQ,EAAErB,aAAa;IACvBsB,OAAO,EAAEd,YAAY;IACrBe,UAAU,EAAE1B,eAAe;IAC3B2B,MAAM,EAAEN,WAAW;IACnBO,SAAS,EAAEb;EACb,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../matches';
3
3
  import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './make-queries';
4
4
  import type { CommonQueryOptions } from './options';
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder-text.js","names":["_findAll","require","_hostComponentNames","_matches","_makeQueries","matchPlaceholderText","node","placeholder","options","exact","normalizer","matches","props","queryAllByPlaceholderText","element","queryAllByPlaceholderFn","queryOptions","findAll","isHostTextInput","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByPlaceholderTextQueries","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","exports"],"sources":["../../src/queries/placeholder-text.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchPlaceholderText = (\n node: HostElement,\n placeholder: TextMatch,\n options: TextMatchOptions = {},\n) => {\n const { exact, normalizer } = options;\n return matches(placeholder, node.props.placeholder, normalizer, exact);\n};\n\nconst queryAllByPlaceholderText = (\n element: HostElement,\n): QueryAllByQuery<TextMatch, ByPlaceholderTextOptions> =>\n function queryAllByPlaceholderFn(placeholder, queryOptions) {\n return findAll(\n element,\n (node) => isHostTextInput(node) && matchPlaceholderText(node, placeholder, queryOptions),\n queryOptions,\n );\n };\n\nconst getMultipleError = (placeholder: TextMatch) =>\n `Found multiple elements with placeholder: ${String(placeholder)} `;\nconst getMissingError = (placeholder: TextMatch) =>\n `Unable to find an element with placeholder: ${String(placeholder)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByPlaceholderText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByPlaceholderTextQueries = {\n getByPlaceholderText: GetByQuery<TextMatch, ByPlaceholderTextOptions>;\n getAllByPlaceholderText: GetAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryByPlaceholderText: QueryByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryAllByPlaceholderText: QueryAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n findByPlaceholderText: FindByQuery<TextMatch, ByPlaceholderTextOptions>;\n findAllByPlaceholderText: FindAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n};\n\nexport const bindByPlaceholderTextQueries = (element: HostElement): ByPlaceholderTextQueries => ({\n getByPlaceholderText: getBy(element),\n getAllByPlaceholderText: getAllBy(element),\n queryByPlaceholderText: queryBy(element),\n queryAllByPlaceholderText: queryAllBy(element),\n findByPlaceholderText: findBy(element),\n findAllByPlaceholderText: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AASA,IAAAG,YAAA,GAAAH,OAAA;AAKA,MAAMI,oBAAoB,GAAGA,CAC3BC,IAAiB,EACjBC,WAAsB,EACtBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,WAAW,EAAED,IAAI,CAACM,KAAK,CAACL,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACxE,CAAC;AAED,MAAMI,yBAAyB,GAC7BC,OAAoB,IAEpB,SAASC,uBAAuBA,CAACR,WAAW,EAAES,YAAY,EAAE;EAC1D,OAAO,IAAAC,gBAAO,EACZH,OAAO,EACNR,IAAI,IAAK,IAAAY,mCAAe,EAACZ,IAAI,CAAC,IAAID,oBAAoB,CAACC,IAAI,EAAEC,WAAW,EAAES,YAAY,CAAC,EACxFA,YACF,CAAC;AACH,CAAC;AAEH,MAAMG,gBAAgB,GAAIZ,WAAsB,IAC9C,6CAA6Ca,MAAM,CAACb,WAAW,CAAC,GAAG;AACrE,MAAMc,eAAe,GAAId,WAAsB,IAC7C,+CAA+Ca,MAAM,CAACb,WAAW,CAAC,EAAE;AAEtE,MAAM;EAAEe,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ef,yBAAyB,EACzBQ,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,4BAA4B,GAAIf,OAAoB,KAAgC;EAC/FgB,oBAAoB,EAAER,KAAK,CAACR,OAAO,CAAC;EACpCiB,uBAAuB,EAAER,QAAQ,CAACT,OAAO,CAAC;EAC1CkB,sBAAsB,EAAER,OAAO,CAACV,OAAO,CAAC;EACxCD,yBAAyB,EAAEY,UAAU,CAACX,OAAO,CAAC;EAC9CmB,qBAAqB,EAAEP,MAAM,CAACZ,OAAO,CAAC;EACtCoB,wBAAwB,EAAEP,SAAS,CAACb,OAAO;AAC7C,CAAC,CAAC;AAACqB,OAAA,CAAAN,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"file":"placeholder-text.js","names":["_findAll","require","_hostComponentNames","_matches","_makeQueries","matchPlaceholderText","node","placeholder","options","exact","normalizer","matches","props","queryAllByPlaceholderText","element","queryAllByPlaceholderFn","queryOptions","findAll","isHostTextInput","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByPlaceholderTextQueries","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","exports"],"sources":["../../src/queries/placeholder-text.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\ntype ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchPlaceholderText = (\n node: HostElement,\n placeholder: TextMatch,\n options: TextMatchOptions = {},\n) => {\n const { exact, normalizer } = options;\n return matches(placeholder, node.props.placeholder, normalizer, exact);\n};\n\nconst queryAllByPlaceholderText = (\n element: HostElement,\n): QueryAllByQuery<TextMatch, ByPlaceholderTextOptions> =>\n function queryAllByPlaceholderFn(placeholder, queryOptions) {\n return findAll(\n element,\n (node) => isHostTextInput(node) && matchPlaceholderText(node, placeholder, queryOptions),\n queryOptions,\n );\n };\n\nconst getMultipleError = (placeholder: TextMatch) =>\n `Found multiple elements with placeholder: ${String(placeholder)} `;\nconst getMissingError = (placeholder: TextMatch) =>\n `Unable to find an element with placeholder: ${String(placeholder)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByPlaceholderText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByPlaceholderTextQueries = {\n getByPlaceholderText: GetByQuery<TextMatch, ByPlaceholderTextOptions>;\n getAllByPlaceholderText: GetAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryByPlaceholderText: QueryByQuery<TextMatch, ByPlaceholderTextOptions>;\n queryAllByPlaceholderText: QueryAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n findByPlaceholderText: FindByQuery<TextMatch, ByPlaceholderTextOptions>;\n findAllByPlaceholderText: FindAllByQuery<TextMatch, ByPlaceholderTextOptions>;\n};\n\nexport const bindByPlaceholderTextQueries = (element: HostElement): ByPlaceholderTextQueries => ({\n getByPlaceholderText: getBy(element),\n getAllByPlaceholderText: getAllBy(element),\n queryByPlaceholderText: queryBy(element),\n queryAllByPlaceholderText: queryAllBy(element),\n findByPlaceholderText: findBy(element),\n findAllByPlaceholderText: findAllBy(element),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AASA,IAAAG,YAAA,GAAAH,OAAA;AAKA,MAAMI,oBAAoB,GAAGA,CAC3BC,IAAiB,EACjBC,WAAsB,EACtBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,WAAW,EAAED,IAAI,CAACM,KAAK,CAACL,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACxE,CAAC;AAED,MAAMI,yBAAyB,GAC7BC,OAAoB,IAEpB,SAASC,uBAAuBA,CAACR,WAAW,EAAES,YAAY,EAAE;EAC1D,OAAO,IAAAC,gBAAO,EACZH,OAAO,EACNR,IAAI,IAAK,IAAAY,mCAAe,EAACZ,IAAI,CAAC,IAAID,oBAAoB,CAACC,IAAI,EAAEC,WAAW,EAAES,YAAY,CAAC,EACxFA,YACF,CAAC;AACH,CAAC;AAEH,MAAMG,gBAAgB,GAAIZ,WAAsB,IAC9C,6CAA6Ca,MAAM,CAACb,WAAW,CAAC,GAAG;AACrE,MAAMc,eAAe,GAAId,WAAsB,IAC7C,+CAA+Ca,MAAM,CAACb,WAAW,CAAC,EAAE;AAEtE,MAAM;EAAEe,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ef,yBAAyB,EACzBQ,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,4BAA4B,GAAIf,OAAoB,KAAgC;EAC/FgB,oBAAoB,EAAER,KAAK,CAACR,OAAO,CAAC;EACpCiB,uBAAuB,EAAER,QAAQ,CAACT,OAAO,CAAC;EAC1CkB,sBAAsB,EAAER,OAAO,CAACV,OAAO,CAAC;EACxCD,yBAAyB,EAAEY,UAAU,CAACX,OAAO,CAAC;EAC9CmB,qBAAqB,EAAEP,MAAM,CAACZ,OAAO,CAAC;EACtCoB,wBAAwB,EAAEP,SAAS,CAACb,OAAO;AAC7C,CAAC,CAAC;AAACqB,OAAA,CAAAN,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { AccessibilityRole, Role } from 'react-native';
2
- import type { HostElement } from 'universal-test-renderer';
2
+ import type { HostElement } from 'test-renderer';
3
3
  import type { AccessibilityStateMatcher } from '../helpers/matchers/match-accessibility-state';
4
4
  import type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';
5
5
  import { type TextMatch } from '../matches';
@@ -1 +1 @@
1
- {"version":3,"file":"role.js","names":["_accessibility","require","_findAll","_matchAccessibilityState","_matchAccessibilityValue","_matchStringProp","_matches","_within","_makeQueries","matchAccessibleNameIfNeeded","node","name","accessibleName","computeAccessibleName","matches","queryAllByText","queryAllByLabelText","getQueriesForElement","length","matchAccessibleStateIfNeeded","options","matchAccessibilityState","matchAccessibilityValueIfNeeded","value","matchAccessibilityValue","queryAllByRole","element","queryAllByRoleFn","role","normalizedRole","normalizeRole","findAll","isAccessibilityElement","matchStringProp","getRole","formatQueryParams","params","String","push","accessibilityStateKeys","forEach","stateKey","undefined","accessibilityValueKeys","valueKey","join","getMultipleError","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByRoleQueries","getByRole","getAllByRole","queryByRole","findByRole","findAllByRole","exports"],"sources":["../../src/queries/role.ts"],"sourcesContent":["import type { AccessibilityRole, Role } from 'react-native';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport {\n accessibilityStateKeys,\n accessibilityValueKeys,\n computeAccessibleName,\n getRole,\n isAccessibilityElement,\n normalizeRole,\n} from '../helpers/accessibility';\nimport { findAll } from '../helpers/find-all';\nimport type { AccessibilityStateMatcher } from '../helpers/matchers/match-accessibility-state';\nimport { matchAccessibilityState } from '../helpers/matchers/match-accessibility-state';\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport { matchAccessibilityValue } from '../helpers/matchers/match-accessibility-value';\nimport { matchStringProp } from '../helpers/matchers/match-string-prop';\nimport { matches, type TextMatch } from '../matches';\nimport type { StringWithAutocomplete } from '../types';\nimport { getQueriesForElement } from '../within';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\nexport type ByRoleMatcher = StringWithAutocomplete<AccessibilityRole | Role> | RegExp;\n\nexport type ByRoleOptions = CommonQueryOptions &\n AccessibilityStateMatcher & {\n name?: TextMatch;\n value?: AccessibilityValueMatcher;\n };\n\nconst matchAccessibleNameIfNeeded = (node: HostElement, name?: TextMatch) => {\n if (name == null) return true;\n\n // TODO: rewrite computeAccessibleName for real world a11y compliance\n const accessibleName = computeAccessibleName(node);\n if (matches(name, accessibleName)) {\n return true;\n }\n\n const { queryAllByText, queryAllByLabelText } = getQueriesForElement(node);\n return queryAllByText(name).length > 0 || queryAllByLabelText(name).length > 0;\n};\n\nconst matchAccessibleStateIfNeeded = (node: HostElement, options?: ByRoleOptions) => {\n return options != null ? matchAccessibilityState(node, options) : true;\n};\n\nconst matchAccessibilityValueIfNeeded = (node: HostElement, value?: AccessibilityValueMatcher) => {\n return value != null ? matchAccessibilityValue(node, value) : true;\n};\n\nconst queryAllByRole = (element: HostElement): QueryAllByQuery<ByRoleMatcher, ByRoleOptions> =>\n function queryAllByRoleFn(role, options) {\n const normalizedRole = typeof role === 'string' ? normalizeRole(role) : role;\n return findAll(\n element,\n (node) =>\n // run the cheapest checks first, and early exit to avoid unneeded computations\n isAccessibilityElement(node) &&\n matchStringProp(getRole(node), normalizedRole) &&\n matchAccessibleStateIfNeeded(node, options) &&\n matchAccessibilityValueIfNeeded(node, options?.value) &&\n matchAccessibleNameIfNeeded(node, options?.name),\n options,\n );\n };\n\nconst formatQueryParams = (role: TextMatch, options: ByRoleOptions = {}) => {\n const params = [`role: ${String(role)}`];\n\n if (options.name) {\n params.push(`name: ${String(options.name)}`);\n }\n\n accessibilityStateKeys.forEach((stateKey) => {\n if (options[stateKey] !== undefined) {\n params.push(`${stateKey} state: ${options[stateKey]}`);\n }\n });\n\n accessibilityValueKeys.forEach((valueKey) => {\n if (options?.value?.[valueKey] !== undefined) {\n params.push(`${valueKey} value: ${options?.value?.[valueKey]}`);\n }\n });\n\n return params.join(', ');\n};\n\nconst getMultipleError = (role: TextMatch, options?: ByRoleOptions) =>\n `Found multiple elements with ${formatQueryParams(role, options)}`;\n\nconst getMissingError = (role: TextMatch, options?: ByRoleOptions) =>\n `Unable to find an element with ${formatQueryParams(role, options)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByRole,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByRoleQueries = {\n getByRole: GetByQuery<ByRoleMatcher, ByRoleOptions>;\n getAllByRole: GetAllByQuery<ByRoleMatcher, ByRoleOptions>;\n queryByRole: QueryByQuery<ByRoleMatcher, ByRoleOptions>;\n queryAllByRole: QueryAllByQuery<ByRoleMatcher, ByRoleOptions>;\n findByRole: FindByQuery<ByRoleMatcher, ByRoleOptions>;\n findAllByRole: FindAllByQuery<ByRoleMatcher, ByRoleOptions>;\n};\n\nexport const bindByRoleQueries = (element: HostElement): ByRoleQueries => ({\n getByRole: getBy(element),\n getAllByRole: getAllBy(element),\n queryByRole: queryBy(element),\n queryAllByRole: queryAllBy(element),\n findByRole: findBy(element),\n findAllByRole: findAllBy(element),\n});\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAA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ChE,gCAAgCe,iBAAiB,CAACP,IAAI,EAAER,OAAO,CAAC,EAAE;AAEpE,MAAM2B,eAAe,GAAGA,CAACnB,IAAe,EAAER,OAAuB,KAC/D,kCAAkCe,iBAAiB,CAACP,IAAI,EAAER,OAAO,CAAC,EAAE;AAEtE,MAAM;EAAE4B,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7E7B,cAAc,EACdsB,eAAe,EACfD,gBACF,CAAC;AAWM,MAAMS,iBAAiB,GAAI7B,OAAoB,KAAqB;EACzE8B,SAAS,EAAER,KAAK,CAACtB,OAAO,CAAC;EACzB+B,YAAY,EAAER,QAAQ,CAACvB,OAAO,CAAC;EAC/BgC,WAAW,EAAER,OAAO,CAACxB,OAAO,CAAC;EAC7BD,cAAc,EAAE0B,UAAU,CAACzB,OAAO,CAAC;EACnCiC,UAAU,EAAEP,MAAM,CAAC1B,OAAO,CAAC;EAC3BkC,aAAa,EAAEP,SAAS,CAAC3B,OAAO;AAClC,CAAC,CAAC;AAACmC,OAAA,CAAAN,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"role.js","names":["_accessibility","require","_findAll","_matchAccessibilityState","_matchAccessibilityValue","_matchStringProp","_matches","_within","_makeQueries","matchAccessibleNameIfNeeded","node","name","accessibleName","computeAccessibleName","matches","queryAllByText","queryAllByLabelText","getQueriesForElement","length","matchAccessibleStateIfNeeded","options","matchAccessibilityState","matchAccessibilityValueIfNeeded","value","matchAccessibilityValue","queryAllByRole","element","queryAllByRoleFn","role","normalizedRole","normalizeRole","findAll","isAccessibilityElement","matchStringProp","getRole","formatQueryParams","params","String","push","accessibilityStateKeys","forEach","stateKey","undefined","accessibilityValueKeys","valueKey","join","getMultipleError","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByRoleQueries","getByRole","getAllByRole","queryByRole","findByRole","findAllByRole","exports"],"sources":["../../src/queries/role.ts"],"sourcesContent":["import type { AccessibilityRole, Role } from 'react-native';\nimport type { HostElement } from 'test-renderer';\n\nimport {\n accessibilityStateKeys,\n accessibilityValueKeys,\n computeAccessibleName,\n getRole,\n isAccessibilityElement,\n normalizeRole,\n} from '../helpers/accessibility';\nimport { findAll } from '../helpers/find-all';\nimport type { AccessibilityStateMatcher } from '../helpers/matchers/match-accessibility-state';\nimport { matchAccessibilityState } from '../helpers/matchers/match-accessibility-state';\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport { matchAccessibilityValue } from '../helpers/matchers/match-accessibility-value';\nimport { matchStringProp } from '../helpers/matchers/match-string-prop';\nimport { matches, type TextMatch } from '../matches';\nimport type { StringWithAutocomplete } from '../types';\nimport { getQueriesForElement } from '../within';\nimport type {\n FindAllByQuery,\n FindByQuery,\n GetAllByQuery,\n GetByQuery,\n QueryAllByQuery,\n QueryByQuery,\n} from './make-queries';\nimport { makeQueries } from './make-queries';\nimport type { CommonQueryOptions } from './options';\n\nexport type ByRoleMatcher = StringWithAutocomplete<AccessibilityRole | Role> | RegExp;\n\nexport type ByRoleOptions = CommonQueryOptions &\n AccessibilityStateMatcher & {\n name?: TextMatch;\n value?: AccessibilityValueMatcher;\n };\n\nconst matchAccessibleNameIfNeeded = (node: HostElement, name?: TextMatch) => {\n if (name == null) return true;\n\n // TODO: rewrite computeAccessibleName for real world a11y compliance\n const accessibleName = computeAccessibleName(node);\n if (matches(name, accessibleName)) {\n return true;\n }\n\n const { queryAllByText, queryAllByLabelText } = getQueriesForElement(node);\n return queryAllByText(name).length > 0 || queryAllByLabelText(name).length > 0;\n};\n\nconst matchAccessibleStateIfNeeded = (node: HostElement, options?: ByRoleOptions) => {\n return options != null ? matchAccessibilityState(node, options) : true;\n};\n\nconst matchAccessibilityValueIfNeeded = (node: HostElement, value?: AccessibilityValueMatcher) => {\n return value != null ? matchAccessibilityValue(node, value) : true;\n};\n\nconst queryAllByRole = (element: HostElement): QueryAllByQuery<ByRoleMatcher, ByRoleOptions> =>\n function queryAllByRoleFn(role, options) {\n const normalizedRole = typeof role === 'string' ? normalizeRole(role) : role;\n return findAll(\n element,\n (node) =>\n // run the cheapest checks first, and early exit to avoid unneeded computations\n isAccessibilityElement(node) &&\n matchStringProp(getRole(node), normalizedRole) &&\n matchAccessibleStateIfNeeded(node, options) &&\n matchAccessibilityValueIfNeeded(node, options?.value) &&\n matchAccessibleNameIfNeeded(node, options?.name),\n options,\n );\n };\n\nconst formatQueryParams = (role: TextMatch, options: ByRoleOptions = {}) => {\n const params = [`role: ${String(role)}`];\n\n if (options.name) {\n params.push(`name: ${String(options.name)}`);\n }\n\n accessibilityStateKeys.forEach((stateKey) => {\n if (options[stateKey] !== undefined) {\n params.push(`${stateKey} state: ${options[stateKey]}`);\n }\n });\n\n accessibilityValueKeys.forEach((valueKey) => {\n if (options?.value?.[valueKey] !== undefined) {\n params.push(`${valueKey} value: ${options?.value?.[valueKey]}`);\n }\n });\n\n return params.join(', ');\n};\n\nconst getMultipleError = (role: TextMatch, options?: ByRoleOptions) =>\n `Found multiple elements with ${formatQueryParams(role, options)}`;\n\nconst getMissingError = (role: TextMatch, options?: ByRoleOptions) =>\n `Unable to find an element with ${formatQueryParams(role, options)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByRole,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByRoleQueries = {\n getByRole: GetByQuery<ByRoleMatcher, ByRoleOptions>;\n getAllByRole: GetAllByQuery<ByRoleMatcher, ByRoleOptions>;\n queryByRole: QueryByQuery<ByRoleMatcher, ByRoleOptions>;\n queryAllByRole: QueryAllByQuery<ByRoleMatcher, ByRoleOptions>;\n findByRole: FindByQuery<ByRoleMatcher, ByRoleOptions>;\n findAllByRole: FindAllByQuery<ByRoleMatcher, ByRoleOptions>;\n};\n\nexport const bindByRoleQueries = (element: HostElement): ByRoleQueries => ({\n getByRole: getBy(element),\n getAllByRole: getAllBy(element),\n queryByRole: queryBy(element),\n queryAllByRole: queryAllBy(element),\n findByRole: findBy(element),\n findAllByRole: findAllBy(element),\n});\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AAEA,IAAAG,wBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAN,OAAA;AASA,IAAAO,YAAA,GAAAP,OAAA;AAWA,MAAMQ,2BAA2B,GAAGA,CAACC,IAAiB,EAAEC,IAAgB,KAAK;EAC3E,IAAIA,IAAI,IAAI,IAAI,EAAE,OAAO,IAAI;;EAE7B;EACA,MAAMC,cAAc,GAAG,IAAAC,oCAAqB,EAACH,IAAI,CAAC;EAClD,IAAI,IAAAI,gBAAO,EAACH,IAAI,EAAEC,cAAc,CAAC,EAAE;IACjC,OAAO,IAAI;EACb;EAEA,MAAM;IAAEG,cAAc;IAAEC;EAAoB,CAAC,GAAG,IAAAC,4BAAoB,EAACP,IAAI,CAAC;EAC1E,OAAOK,cAAc,CAACJ,IAAI,CAAC,CAACO,MAAM,GAAG,CAAC,IAAIF,mBAAmB,CAACL,IAAI,CAAC,CAACO,MAAM,GAAG,CAAC;AAChF,CAAC;AAED,MAAMC,4BAA4B,GAAGA,CAACT,IAAiB,EAAEU,OAAuB,KAAK;EACnF,OAAOA,OAAO,IAAI,IAAI,GAAG,IAAAC,gDAAuB,EAACX,IAAI,EAAEU,OAAO,CAAC,GAAG,IAAI;AACxE,CAAC;AAED,MAAME,+BAA+B,GAAGA,CAACZ,IAAiB,EAAEa,KAAiC,KAAK;EAChG,OAAOA,KAAK,IAAI,IAAI,GAAG,IAAAC,gDAAuB,EAACd,IAAI,EAAEa,KAAK,CAAC,GAAG,IAAI;AACpE,CAAC;AAED,MAAME,cAAc,GAAIC,OAA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AAO,EAAEG,KAAK,GAAGqB,QAAQ,CAAC,EAAE,CAAC;IACjE;EACF,CAAC,CAAC;EAEF,OAAOR,MAAM,CAACS,IAAI,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAClB,IAAe,EAAER,OAAuB,KAChE,gCAAgCe,iBAAiB,CAACP,IAAI,EAAER,OAAO,CAAC,EAAE;AAEpE,MAAM2B,eAAe,GAAGA,CAACnB,IAAe,EAAER,OAAuB,KAC/D,kCAAkCe,iBAAiB,CAACP,IAAI,EAAER,OAAO,CAAC,EAAE;AAEtE,MAAM;EAAE4B,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7E7B,cAAc,EACdsB,eAAe,EACfD,gBACF,CAAC;AAWM,MAAMS,iBAAiB,GAAI7B,OAAoB,KAAqB;EACzE8B,SAAS,EAAER,KAAK,CAACtB,OAAO,CAAC;EACzB+B,YAAY,EAAER,QAAQ,CAACvB,OAAO,CAAC;EAC/BgC,WAAW,EAAER,OAAO,CAACxB,OAAO,CAAC;EAC7BD,cAAc,EAAE0B,UAAU,CAACzB,OAAO,CAAC;EACnCiC,UAAU,EAAEP,MAAM,CAAC1B,OAAO,CAAC;EAC3BkC,aAAa,EAAEP,SAAS,CAAC3B,OAAO;AAClC,CAAC,CAAC;AAACmC,OAAA,CAAAN,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch, TextMatchOptions } from '../matches';
3
3
  import type { FindAllByQuery, FindByQuery, GetAllByQuery, GetByQuery, QueryAllByQuery, QueryByQuery } from './make-queries';
4
4
  import type { CommonQueryOptions } from './options';