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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/build/act.d.ts +5 -4
  2. package/build/act.js +3 -6
  3. package/build/act.js.map +1 -1
  4. package/build/config.d.ts +0 -10
  5. package/build/config.js +1 -2
  6. package/build/config.js.map +1 -1
  7. package/build/event-handler.d.ts +2 -2
  8. package/build/event-handler.js.map +1 -1
  9. package/build/fire-event.d.ts +7 -7
  10. package/build/fire-event.js +26 -4
  11. package/build/fire-event.js.map +1 -1
  12. package/build/helpers/accessibility.d.ts +14 -14
  13. package/build/helpers/accessibility.js +2 -2
  14. package/build/helpers/accessibility.js.map +1 -1
  15. package/build/helpers/component-tree.d.ts +7 -31
  16. package/build/helpers/component-tree.js +15 -73
  17. package/build/helpers/component-tree.js.map +1 -1
  18. package/build/helpers/debug.d.ts +2 -2
  19. package/build/helpers/debug.js +5 -4
  20. package/build/helpers/debug.js.map +1 -1
  21. package/build/helpers/find-all.d.ts +2 -3
  22. package/build/helpers/find-all.js +5 -5
  23. package/build/helpers/find-all.js.map +1 -1
  24. package/build/helpers/format-element.d.ts +4 -4
  25. package/build/helpers/format-element.js +6 -7
  26. package/build/helpers/format-element.js.map +1 -1
  27. package/build/helpers/host-component-names.d.ts +8 -8
  28. package/build/helpers/host-component-names.js +9 -7
  29. package/build/helpers/host-component-names.js.map +1 -1
  30. package/build/helpers/matchers/match-accessibility-state.d.ts +2 -2
  31. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  32. package/build/helpers/matchers/match-accessibility-value.d.ts +2 -2
  33. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  34. package/build/helpers/matchers/match-label-text.d.ts +2 -2
  35. package/build/helpers/matchers/match-label-text.js.map +1 -1
  36. package/build/helpers/matchers/match-text-content.d.ts +2 -2
  37. package/build/helpers/matchers/match-text-content.js.map +1 -1
  38. package/build/helpers/pointer-events.d.ts +2 -2
  39. package/build/helpers/pointer-events.js +1 -2
  40. package/build/helpers/pointer-events.js.map +1 -1
  41. package/build/helpers/text-content.d.ts +2 -2
  42. package/build/helpers/text-content.js.map +1 -1
  43. package/build/helpers/text-input.d.ts +3 -3
  44. package/build/helpers/text-input.js.map +1 -1
  45. package/build/helpers/wrap-async.d.ts +1 -0
  46. package/build/helpers/wrap-async.js +1 -0
  47. package/build/helpers/wrap-async.js.map +1 -1
  48. package/build/index.d.ts +1 -1
  49. package/build/index.flow.js +0 -1
  50. package/build/index.js +11 -1
  51. package/build/index.js.map +1 -1
  52. package/build/matchers/to-be-busy.d.ts +2 -2
  53. package/build/matchers/to-be-busy.js.map +1 -1
  54. package/build/matchers/to-be-checked.d.ts +2 -2
  55. package/build/matchers/to-be-checked.js.map +1 -1
  56. package/build/matchers/to-be-disabled.d.ts +3 -3
  57. package/build/matchers/to-be-disabled.js +1 -2
  58. package/build/matchers/to-be-disabled.js.map +1 -1
  59. package/build/matchers/to-be-empty-element.d.ts +2 -2
  60. package/build/matchers/to-be-empty-element.js +2 -3
  61. package/build/matchers/to-be-empty-element.js.map +1 -1
  62. package/build/matchers/to-be-expanded.d.ts +3 -3
  63. package/build/matchers/to-be-expanded.js.map +1 -1
  64. package/build/matchers/to-be-on-the-screen.d.ts +2 -2
  65. package/build/matchers/to-be-on-the-screen.js +1 -1
  66. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  67. package/build/matchers/to-be-partially-checked.d.ts +2 -2
  68. package/build/matchers/to-be-partially-checked.js.map +1 -1
  69. package/build/matchers/to-be-selected.d.ts +2 -2
  70. package/build/matchers/to-be-selected.js.map +1 -1
  71. package/build/matchers/to-be-visible.d.ts +2 -2
  72. package/build/matchers/to-be-visible.js +1 -2
  73. package/build/matchers/to-be-visible.js.map +1 -1
  74. package/build/matchers/to-contain-element.d.ts +2 -2
  75. package/build/matchers/to-contain-element.js +2 -1
  76. package/build/matchers/to-contain-element.js.map +1 -1
  77. package/build/matchers/to-have-accessibility-value.d.ts +2 -2
  78. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  79. package/build/matchers/to-have-accessible-name.d.ts +2 -2
  80. package/build/matchers/to-have-accessible-name.js.map +1 -1
  81. package/build/matchers/to-have-display-value.d.ts +2 -2
  82. package/build/matchers/to-have-display-value.js.map +1 -1
  83. package/build/matchers/to-have-prop.d.ts +2 -2
  84. package/build/matchers/to-have-prop.js.map +1 -1
  85. package/build/matchers/to-have-style.d.ts +2 -2
  86. package/build/matchers/to-have-style.js.map +1 -1
  87. package/build/matchers/to-have-text-content.d.ts +2 -2
  88. package/build/matchers/to-have-text-content.js.map +1 -1
  89. package/build/matchers/types.d.ts +2 -2
  90. package/build/matchers/types.js.map +1 -1
  91. package/build/matchers/utils.d.ts +3 -3
  92. package/build/matchers/utils.js +3 -4
  93. package/build/matchers/utils.js.map +1 -1
  94. package/build/native-state.d.ts +3 -3
  95. package/build/native-state.js.map +1 -1
  96. package/build/pure.d.ts +1 -1
  97. package/build/pure.js +2 -2
  98. package/build/pure.js.map +1 -1
  99. package/build/queries/display-value.d.ts +2 -2
  100. package/build/queries/display-value.js.map +1 -1
  101. package/build/queries/hint-text.d.ts +2 -2
  102. package/build/queries/hint-text.js.map +1 -1
  103. package/build/queries/label-text.d.ts +2 -2
  104. package/build/queries/label-text.js.map +1 -1
  105. package/build/queries/make-queries.d.ts +9 -9
  106. package/build/queries/make-queries.js.map +1 -1
  107. package/build/queries/placeholder-text.d.ts +2 -2
  108. package/build/queries/placeholder-text.js.map +1 -1
  109. package/build/queries/role.d.ts +2 -2
  110. package/build/queries/role.js.map +1 -1
  111. package/build/queries/test-id.d.ts +2 -2
  112. package/build/queries/test-id.js.map +1 -1
  113. package/build/queries/text.d.ts +2 -2
  114. package/build/queries/text.js.map +1 -1
  115. package/build/render-hook.js +1 -1
  116. package/build/render-hook.js.map +1 -1
  117. package/build/render.d.ts +20 -121
  118. package/build/render.js +27 -67
  119. package/build/render.js.map +1 -1
  120. package/build/screen.js +1 -9
  121. package/build/screen.js.map +1 -1
  122. package/build/tsconfig.release.tsbuildinfo +1 -1
  123. package/build/user-event/clear.d.ts +2 -2
  124. package/build/user-event/clear.js.map +1 -1
  125. package/build/user-event/index.d.ts +7 -7
  126. package/build/user-event/index.js.map +1 -1
  127. package/build/user-event/paste.d.ts +2 -2
  128. package/build/user-event/paste.js.map +1 -1
  129. package/build/user-event/press/press.d.ts +3 -3
  130. package/build/user-event/press/press.js +1 -10
  131. package/build/user-event/press/press.js.map +1 -1
  132. package/build/user-event/scroll/scroll-to.d.ts +2 -2
  133. package/build/user-event/scroll/scroll-to.js.map +1 -1
  134. package/build/user-event/setup/setup.d.ts +7 -7
  135. package/build/user-event/setup/setup.js.map +1 -1
  136. package/build/user-event/type/type.d.ts +3 -3
  137. package/build/user-event/type/type.js.map +1 -1
  138. package/build/user-event/utils/dispatch-event.d.ts +2 -2
  139. package/build/user-event/utils/dispatch-event.js.map +1 -1
  140. package/build/within.d.ts +20 -36
  141. package/build/within.js +3 -7
  142. package/build/within.js.map +1 -1
  143. package/package.json +8 -8
  144. package/typings/index.flow.js +0 -1
  145. package/build/helpers/ensure-peer-deps.d.ts +0 -3
  146. package/build/helpers/ensure-peer-deps.js +0 -32
  147. package/build/helpers/ensure-peer-deps.js.map +0 -1
  148. package/build/helpers/string-validation.d.ts +0 -2
  149. package/build/helpers/string-validation.js +0 -31
  150. package/build/helpers/string-validation.js.map +0 -1
  151. package/build/queries/unsafe-props.d.ts +0 -10
  152. package/build/queries/unsafe-props.js +0 -49
  153. package/build/queries/unsafe-props.js.map +0 -1
  154. package/build/queries/unsafe-type.d.ts +0 -10
  155. package/build/queries/unsafe-type.js +0 -49
  156. package/build/queries/unsafe-type.js.map +0 -1
  157. package/build/render-act.d.ts +0 -2
  158. package/build/render-act.js +0 -22
  159. package/build/render-act.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"test-id.js","names":["_findAll","require","_matches","_makeQueries","matchTestId","node","testId","options","exact","normalizer","matches","props","testID","queryAllByTestId","instance","queryAllByTestIdFn","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByTestIdQueries","getByTestId","getAllByTestId","queryByTestId","findByTestId","findAllByTestId","exports"],"sources":["../../src/queries/test-id.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-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 ByTestIdOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchTestId = (\n node: ReactTestInstance,\n testId: TextMatch,\n options: TextMatchOptions = {},\n) => {\n const { exact, normalizer } = options;\n return matches(testId, node.props.testID, normalizer, exact);\n};\n\nconst queryAllByTestId = (\n instance: ReactTestInstance,\n): QueryAllByQuery<TextMatch, ByTestIdOptions> =>\n function queryAllByTestIdFn(testId, queryOptions) {\n return findAll(instance, (node) => matchTestId(node, testId, queryOptions), queryOptions);\n };\n\nconst getMultipleError = (testId: TextMatch) =>\n `Found multiple elements with testID: ${String(testId)}`;\nconst getMissingError = (testId: TextMatch) =>\n `Unable to find an element with testID: ${String(testId)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByTestId,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByTestIdQueries = {\n getByTestId: GetByQuery<TextMatch, ByTestIdOptions>;\n getAllByTestId: GetAllByQuery<TextMatch, ByTestIdOptions>;\n queryByTestId: QueryByQuery<TextMatch, ByTestIdOptions>;\n queryAllByTestId: QueryAllByQuery<TextMatch, ByTestIdOptions>;\n findByTestId: FindByQuery<TextMatch, ByTestIdOptions>;\n findAllByTestId: FindAllByQuery<TextMatch, ByTestIdOptions>;\n};\n\nexport const bindByTestIdQueries = (instance: ReactTestInstance): ByTestIdQueries => ({\n getByTestId: getBy(instance),\n getAllByTestId: getAllBy(instance),\n queryByTestId: queryBy(instance),\n queryAllByTestId: queryAllBy(instance),\n findByTestId: findBy(instance),\n findAllByTestId: findAllBy(instance),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AAKA,MAAMG,WAAW,GAAGA,CAClBC,IAAuB,EACvBC,MAAiB,EACjBC,OAAyB,GAAG,CAAC,CAAC,KAC3B;EACH,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,MAAM,EAAED,IAAI,CAACM,KAAK,CAACC,MAAM,EAAEH,UAAU,EAAED,KAAK,CAAC;AAC9D,CAAC;AAED,MAAMK,gBAAgB,GACpBC,QAA2B,IAE3B,SAASC,kBAAkBA,CAACT,MAAM,EAAEU,YAAY,EAAE;EAChD,OAAO,IAAAC,gBAAO,EAACH,QAAQ,EAAGT,IAAI,IAAKD,WAAW,CAACC,IAAI,EAAEC,MAAM,EAAEU,YAAY,CAAC,EAAEA,YAAY,CAAC;AAC3F,CAAC;AAEH,MAAME,gBAAgB,GAAIZ,MAAiB,IACzC,wCAAwCa,MAAM,CAACb,MAAM,CAAC,EAAE;AAC1D,MAAMc,eAAe,GAAId,MAAiB,IACxC,0CAA0Ca,MAAM,CAACb,MAAM,CAAC,EAAE;AAE5D,MAAM;EAAEe,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ed,gBAAgB,EAChBO,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,mBAAmB,GAAId,QAA2B,KAAuB;EACpFe,WAAW,EAAER,KAAK,CAACP,QAAQ,CAAC;EAC5BgB,cAAc,EAAER,QAAQ,CAACR,QAAQ,CAAC;EAClCiB,aAAa,EAAER,OAAO,CAACT,QAAQ,CAAC;EAChCD,gBAAgB,EAAEW,UAAU,CAACV,QAAQ,CAAC;EACtCkB,YAAY,EAAEP,MAAM,CAACX,QAAQ,CAAC;EAC9BmB,eAAe,EAAEP,SAAS,CAACZ,QAAQ;AACrC,CAAC,CAAC;AAACoB,OAAA,CAAAN,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"test-id.js","names":["_findAll","require","_matches","_makeQueries","matchTestId","node","testId","options","exact","normalizer","matches","props","testID","queryAllByTestId","instance","queryAllByTestIdFn","queryOptions","findAll","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByTestIdQueries","getByTestId","getAllByTestId","queryByTestId","findByTestId","findAllByTestId","exports"],"sources":["../../src/queries/test-id.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 ByTestIdOptions = CommonQueryOptions & TextMatchOptions;\n\nconst matchTestId = (node: HostElement, testId: TextMatch, options: TextMatchOptions = {}) => {\n const { exact, normalizer } = options;\n return matches(testId, node.props.testID, normalizer, exact);\n};\n\nconst queryAllByTestId = (instance: HostElement): QueryAllByQuery<TextMatch, ByTestIdOptions> =>\n function queryAllByTestIdFn(testId, queryOptions) {\n return findAll(instance, (node) => matchTestId(node, testId, queryOptions), queryOptions);\n };\n\nconst getMultipleError = (testId: TextMatch) =>\n `Found multiple elements with testID: ${String(testId)}`;\nconst getMissingError = (testId: TextMatch) =>\n `Unable to find an element with testID: ${String(testId)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByTestId,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByTestIdQueries = {\n getByTestId: GetByQuery<TextMatch, ByTestIdOptions>;\n getAllByTestId: GetAllByQuery<TextMatch, ByTestIdOptions>;\n queryByTestId: QueryByQuery<TextMatch, ByTestIdOptions>;\n queryAllByTestId: QueryAllByQuery<TextMatch, ByTestIdOptions>;\n findByTestId: FindByQuery<TextMatch, ByTestIdOptions>;\n findAllByTestId: FindAllByQuery<TextMatch, ByTestIdOptions>;\n};\n\nexport const bindByTestIdQueries = (instance: HostElement): ByTestIdQueries => ({\n getByTestId: getBy(instance),\n getAllByTestId: getAllBy(instance),\n queryByTestId: queryBy(instance),\n queryAllByTestId: queryAllBy(instance),\n findByTestId: findBy(instance),\n findAllByTestId: findAllBy(instance),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,YAAA,GAAAF,OAAA;AAKA,MAAMG,WAAW,GAAGA,CAACC,IAAiB,EAAEC,MAAiB,EAAEC,OAAyB,GAAG,CAAC,CAAC,KAAK;EAC5F,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,OAAO;EACrC,OAAO,IAAAG,gBAAO,EAACJ,MAAM,EAAED,IAAI,CAACM,KAAK,CAACC,MAAM,EAAEH,UAAU,EAAED,KAAK,CAAC;AAC9D,CAAC;AAED,MAAMK,gBAAgB,GAAIC,QAAqB,IAC7C,SAASC,kBAAkBA,CAACT,MAAM,EAAEU,YAAY,EAAE;EAChD,OAAO,IAAAC,gBAAO,EAACH,QAAQ,EAAGT,IAAI,IAAKD,WAAW,CAACC,IAAI,EAAEC,MAAM,EAAEU,YAAY,CAAC,EAAEA,YAAY,CAAC;AAC3F,CAAC;AAEH,MAAME,gBAAgB,GAAIZ,MAAiB,IACzC,wCAAwCa,MAAM,CAACb,MAAM,CAAC,EAAE;AAC1D,MAAMc,eAAe,GAAId,MAAiB,IACxC,0CAA0Ca,MAAM,CAACb,MAAM,CAAC,EAAE;AAE5D,MAAM;EAAEe,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7Ed,gBAAgB,EAChBO,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,mBAAmB,GAAId,QAAqB,KAAuB;EAC9Ee,WAAW,EAAER,KAAK,CAACP,QAAQ,CAAC;EAC5BgB,cAAc,EAAER,QAAQ,CAACR,QAAQ,CAAC;EAClCiB,aAAa,EAAER,OAAO,CAACT,QAAQ,CAAC;EAChCD,gBAAgB,EAAEW,UAAU,CAACV,QAAQ,CAAC;EACtCkB,YAAY,EAAEP,MAAM,CAACX,QAAQ,CAAC;EAC9BmB,eAAe,EAAEP,SAAS,CAACZ,QAAQ;AACrC,CAAC,CAAC;AAACoB,OAAA,CAAAN,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { ReactTestInstance } from 'react-test-renderer';
1
+ import type { HostElement } from 'universal-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';
@@ -11,5 +11,5 @@ export type ByTextQueries = {
11
11
  findByText: FindByQuery<TextMatch, ByTextOptions>;
12
12
  findAllByText: FindAllByQuery<TextMatch, ByTextOptions>;
13
13
  };
14
- export declare const bindByTextQueries: (instance: ReactTestInstance) => ByTextQueries;
14
+ export declare const bindByTextQueries: (instance: HostElement) => ByTextQueries;
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","names":["_findAll","require","_hostComponentNames","_matchTextContent","_makeQueries","queryAllByText","instance","queryAllByTextFn","text","options","findAll","node","isHostText","matchTextContent","matchDeepestOnly","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByTextQueries","getByText","getAllByText","queryByText","findByText","findAllByText","exports"],"sources":["../../src/queries/text.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostText } from '../helpers/host-component-names';\nimport { matchTextContent } from '../helpers/matchers/match-text-content';\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 ByTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst queryAllByText = (instance: ReactTestInstance): QueryAllByQuery<TextMatch, ByTextOptions> =>\n function queryAllByTextFn(text, options = {}) {\n return findAll(instance, (node) => isHostText(node) && matchTextContent(node, text, options), {\n ...options,\n matchDeepestOnly: true,\n });\n };\n\nconst getMultipleError = (text: TextMatch) => `Found multiple elements with text: ${String(text)}`;\n\nconst getMissingError = (text: TextMatch) => `Unable to find an element with text: ${String(text)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByTextQueries = {\n getByText: GetByQuery<TextMatch, ByTextOptions>;\n getAllByText: GetAllByQuery<TextMatch, ByTextOptions>;\n queryByText: QueryByQuery<TextMatch, ByTextOptions>;\n queryAllByText: QueryAllByQuery<TextMatch, ByTextOptions>;\n findByText: FindByQuery<TextMatch, ByTextOptions>;\n findAllByText: FindAllByQuery<TextMatch, ByTextOptions>;\n};\n\nexport const bindByTextQueries = (instance: ReactTestInstance): ByTextQueries => ({\n getByText: getBy(instance),\n getAllByText: getAllBy(instance),\n queryByText: queryBy(instance),\n queryAllByText: queryAllBy(instance),\n findByText: findBy(instance),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[]}
1
+ {"version":3,"file":"text.js","names":["_findAll","require","_hostComponentNames","_matchTextContent","_makeQueries","queryAllByText","instance","queryAllByTextFn","text","options","findAll","node","isHostText","matchTextContent","matchDeepestOnly","getMultipleError","String","getMissingError","getBy","getAllBy","queryBy","queryAllBy","findBy","findAllBy","makeQueries","bindByTextQueries","getByText","getAllByText","queryByText","findByText","findAllByText","exports"],"sources":["../../src/queries/text.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { findAll } from '../helpers/find-all';\nimport { isHostText } from '../helpers/host-component-names';\nimport { matchTextContent } from '../helpers/matchers/match-text-content';\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 ByTextOptions = CommonQueryOptions & TextMatchOptions;\n\nconst queryAllByText = (instance: HostElement): QueryAllByQuery<TextMatch, ByTextOptions> =>\n function queryAllByTextFn(text, options = {}) {\n return findAll(instance, (node) => isHostText(node) && matchTextContent(node, text, options), {\n ...options,\n matchDeepestOnly: true,\n });\n };\n\nconst getMultipleError = (text: TextMatch) => `Found multiple elements with text: ${String(text)}`;\n\nconst getMissingError = (text: TextMatch) => `Unable to find an element with text: ${String(text)}`;\n\nconst { getBy, getAllBy, queryBy, queryAllBy, findBy, findAllBy } = makeQueries(\n queryAllByText,\n getMissingError,\n getMultipleError,\n);\n\nexport type ByTextQueries = {\n getByText: GetByQuery<TextMatch, ByTextOptions>;\n getAllByText: GetAllByQuery<TextMatch, ByTextOptions>;\n queryByText: QueryByQuery<TextMatch, ByTextOptions>;\n queryAllByText: QueryAllByQuery<TextMatch, ByTextOptions>;\n findByText: FindByQuery<TextMatch, ByTextOptions>;\n findAllByText: FindAllByQuery<TextMatch, ByTextOptions>;\n};\n\nexport const bindByTextQueries = (instance: HostElement): ByTextQueries => ({\n getByText: getBy(instance),\n getAllByText: getAllBy(instance),\n queryByText: queryBy(instance),\n queryAllByText: queryAllBy(instance),\n findByText: findBy(instance),\n findAllByText: findAllBy(instance),\n});\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAUA,IAAAG,YAAA,GAAAH,OAAA;AAKA,MAAMI,cAAc,GAAIC,QAAqB,IAC3C,SAASC,gBAAgBA,CAACC,IAAI,EAAEC,OAAO,GAAG,CAAC,CAAC,EAAE;EAC5C,OAAO,IAAAC,gBAAO,EAACJ,QAAQ,EAAGK,IAAI,IAAK,IAAAC,8BAAU,EAACD,IAAI,CAAC,IAAI,IAAAE,kCAAgB,EAACF,IAAI,EAAEH,IAAI,EAAEC,OAAO,CAAC,EAAE;IAC5F,GAAGA,OAAO;IACVK,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAEH,MAAMC,gBAAgB,GAAIP,IAAe,IAAK,sCAAsCQ,MAAM,CAACR,IAAI,CAAC,EAAE;AAElG,MAAMS,eAAe,GAAIT,IAAe,IAAK,wCAAwCQ,MAAM,CAACR,IAAI,CAAC,EAAE;AAEnG,MAAM;EAAEU,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAU,CAAC,GAAG,IAAAC,wBAAW,EAC7EnB,cAAc,EACdY,eAAe,EACfF,gBACF,CAAC;AAWM,MAAMU,iBAAiB,GAAInB,QAAqB,KAAqB;EAC1EoB,SAAS,EAAER,KAAK,CAACZ,QAAQ,CAAC;EAC1BqB,YAAY,EAAER,QAAQ,CAACb,QAAQ,CAAC;EAChCsB,WAAW,EAAER,OAAO,CAACd,QAAQ,CAAC;EAC9BD,cAAc,EAAEgB,UAAU,CAACf,QAAQ,CAAC;EACpCuB,UAAU,EAAEP,MAAM,CAAChB,QAAQ,CAAC;EAC5BwB,aAAa,EAAEP,SAAS,CAACjB,QAAQ;AACnC,CAAC,CAAC;AAACyB,OAAA,CAAAN,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -26,7 +26,7 @@ function renderHook(hookToRender, options) {
26
26
  const {
27
27
  rerender: componentRerender,
28
28
  unmount
29
- } = (0, _render.renderInternal)(
29
+ } = (0, _render.render)(
30
30
  /*#__PURE__*/
31
31
  // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt
32
32
  React.createElement(TestComponent, {
@@ -1 +1 @@
1
- {"version":3,"file":"render-hook.js","names":["React","_interopRequireWildcard","require","_render","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","renderHook","hookToRender","options","initialProps","renderOptions","result","createRef","TestComponent","hookProps","renderResult","useEffect","current","rerender","componentRerender","unmount","renderInternal","createElement"],"sources":["../src/render-hook.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { renderInternal } from './render';\n\nexport type RenderHookResult<Result, Props> = {\n rerender: (props: Props) => void;\n result: React.MutableRefObject<Result>;\n unmount: () => void;\n};\n\nexport type RenderHookOptions<Props> = {\n /**\n * The initial props to pass to the hook.\n */\n initialProps?: Props;\n\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `renderHook` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n};\n\nexport function renderHook<Result, Props>(\n hookToRender: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): RenderHookResult<Result, Props> {\n const { initialProps, ...renderOptions } = options ?? {};\n\n const result: React.MutableRefObject<Result | null> = React.createRef();\n\n function TestComponent({ hookProps }: { hookProps: Props }) {\n const renderResult = hookToRender(hookProps);\n\n React.useEffect(() => {\n result.current = renderResult;\n });\n\n return null;\n }\n\n const { rerender: componentRerender, unmount } = renderInternal(\n // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt\n <TestComponent hookProps={initialProps} />,\n renderOptions,\n );\n\n function rerender(hookProps: Props) {\n return componentRerender(<TestComponent hookProps={hookProps} />);\n }\n\n return {\n // Result should already be set after the first render effects are run.\n result: result as React.MutableRefObject<Result>,\n rerender,\n unmount,\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAA0C,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AA4BnC,SAASW,UAAUA,CACxBC,YAAsC,EACtCC,OAAkC,EACD;EACjC,MAAM;IAAEC,YAAY;IAAE,GAAGC;EAAc,CAAC,GAAGF,OAAO,IAAI,CAAC,CAAC;EAExD,MAAMG,MAA6C,gBAAG7B,KAAK,CAAC8B,SAAS,CAAC,CAAC;EAEvE,SAASC,aAAaA,CAAC;IAAEC;EAAgC,CAAC,EAAE;IAC1D,MAAMC,YAAY,GAAGR,YAAY,CAACO,SAAS,CAAC;IAE5ChC,KAAK,CAACkC,SAAS,CAAC,MAAM;MACpBL,MAAM,CAACM,OAAO,GAAGF,YAAY;IAC/B,CAAC,CAAC;IAEF,OAAO,IAAI;EACb;EAEA,MAAM;IAAEG,QAAQ,EAAEC,iBAAiB;IAAEC;EAAQ,CAAC,GAAG,IAAAC,sBAAc;EAAA;EAC7D;EACAvC,KAAA,CAAAwC,aAAA,CAACT,aAAa;IAACC,SAAS,EAAEL;EAAa,CAAE,CAAC,EAC1CC,aACF,CAAC;EAED,SAASQ,QAAQA,CAACJ,SAAgB,EAAE;IAClC,OAAOK,iBAAiB,cAACrC,KAAA,CAAAwC,aAAA,CAACT,aAAa;MAACC,SAAS,EAAEA;IAAU,CAAE,CAAC,CAAC;EACnE;EAEA,OAAO;IACL;IACAH,MAAM,EAAEA,MAAwC;IAChDO,QAAQ;IACRE;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"render-hook.js","names":["React","_interopRequireWildcard","require","_render","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","renderHook","hookToRender","options","initialProps","renderOptions","result","createRef","TestComponent","hookProps","renderResult","useEffect","current","rerender","componentRerender","unmount","render","createElement"],"sources":["../src/render-hook.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { render } from './render';\n\nexport type RenderHookResult<Result, Props> = {\n rerender: (props: Props) => void;\n result: React.MutableRefObject<Result>;\n unmount: () => void;\n};\n\nexport type RenderHookOptions<Props> = {\n /**\n * The initial props to pass to the hook.\n */\n initialProps?: Props;\n\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `renderHook` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n};\n\nexport function renderHook<Result, Props>(\n hookToRender: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): RenderHookResult<Result, Props> {\n const { initialProps, ...renderOptions } = options ?? {};\n\n const result: React.MutableRefObject<Result | null> = React.createRef();\n\n function TestComponent({ hookProps }: { hookProps: Props }) {\n const renderResult = hookToRender(hookProps);\n\n React.useEffect(() => {\n result.current = renderResult;\n });\n\n return null;\n }\n\n const { rerender: componentRerender, unmount } = render(\n // @ts-expect-error since option can be undefined, initialProps can be undefined when it should'nt\n <TestComponent hookProps={initialProps} />,\n renderOptions,\n );\n\n function rerender(hookProps: Props) {\n return componentRerender(<TestComponent hookProps={hookProps} />);\n }\n\n return {\n // Result should already be set after the first render effects are run.\n result: result as React.MutableRefObject<Result>,\n rerender,\n unmount,\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAkC,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAA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SAAS,CAAC;IAE5ChC,KAAK,CAACkC,SAAS,CAAC,MAAM;MACpBL,MAAM,CAACM,OAAO,GAAGF,YAAY;IAC/B,CAAC,CAAC;IAEF,OAAO,IAAI;EACb;EAEA,MAAM;IAAEG,QAAQ,EAAEC,iBAAiB;IAAEC;EAAQ,CAAC,GAAG,IAAAC,cAAM;EAAA;EACrD;EACAvC,KAAA,CAAAwC,aAAA,CAACT,aAAa;IAACC,SAAS,EAAEL;EAAa,CAAE,CAAC,EAC1CC,aACF,CAAC;EAED,SAASQ,QAAQA,CAACJ,SAAgB,EAAE;IAClC,OAAOK,iBAAiB,cAACrC,KAAA,CAAAwC,aAAA,CAACT,aAAa;MAACC,SAAS,EAAEA;IAAU,CAAE,CAAC,CAAC;EACnE;EAEA,OAAO;IACL;IACAH,MAAM,EAAEA,MAAwC;IAChDO,QAAQ;IACRE;EACF,CAAC;AACH","ignoreList":[]}
package/build/render.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ReactTestInstance } from 'react-test-renderer';
2
+ import type { HostElement } from 'universal-test-renderer';
3
3
  import type { DebugOptions } from './helpers/debug';
4
4
  export interface RenderOptions {
5
5
  /**
@@ -7,128 +7,45 @@ export interface RenderOptions {
7
7
  * reusable custom render functions for common data providers.
8
8
  */
9
9
  wrapper?: React.ComponentType<any>;
10
- /**
11
- * Set to `false` to disable concurrent rendering.
12
- * Otherwise `render` will default to concurrent rendering.
13
- */
14
- concurrentRoot?: boolean;
15
- createNodeMock?: (element: React.ReactElement) => unknown;
16
- unstable_validateStringsRenderedWithinText?: boolean;
10
+ createNodeMock?: (element: React.ReactElement) => object;
17
11
  }
18
12
  export type RenderResult = ReturnType<typeof render>;
19
13
  /**
20
14
  * Renders test component deeply using React Test Renderer and exposes helpers
21
15
  * to assert on the output.
22
16
  */
23
- export default function render<T>(component: React.ReactElement<T>, options?: RenderOptions): {
24
- update: (component: React.ReactElement) => void;
17
+ export declare function render<T>(element: React.ReactElement<T>, options?: RenderOptions): {
18
+ update: (element: React.ReactElement) => void;
25
19
  unmount: () => void;
26
- rerender: (component: React.ReactElement) => void;
27
- toJSON: () => null | import("react-test-renderer").ReactTestRendererJSON | import("react-test-renderer").ReactTestRendererJSON[];
20
+ rerender: (element: React.ReactElement) => void;
21
+ toJSON: () => import("universal-test-renderer").JsonNode | null | undefined;
28
22
  debug: DebugFunction;
29
- root: ReactTestInstance;
30
- UNSAFE_root: ReactTestInstance;
31
- UNSAFE_getByProps: (props: {
32
- [x: string]: unknown;
33
- }) => ReactTestInstance;
34
- UNSAFE_getAllByProps: (props: {
35
- [x: string]: unknown;
36
- }) => Array<ReactTestInstance>;
37
- UNSAFE_queryByProps: (props: {
38
- [x: string]: unknown;
39
- }) => ReactTestInstance | null;
40
- UNSAFE_queryAllByProps: (props: {
41
- [x: string]: unknown;
42
- }) => Array<ReactTestInstance>;
43
- UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
44
- UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
45
- UNSAFE_queryByType: <P>(type: React.ComponentType<P>) => ReactTestInstance | null;
46
- UNSAFE_queryAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
47
- getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
48
- getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
49
- queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
50
- queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
51
- findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
52
- findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
53
- getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
54
- getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
55
- queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
56
- queryAllByHintText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
57
- findByHintText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
58
- findAllByHintText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
59
- getByA11yHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
60
- getAllByA11yHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
61
- queryByA11yHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
62
- queryAllByA11yHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
63
- findByA11yHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
64
- findAllByA11yHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
65
- getByAccessibilityHint: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
66
- getAllByAccessibilityHint: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
67
- queryByAccessibilityHint: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
68
- queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
69
- findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
70
- findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
71
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
72
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
73
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
74
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
75
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
76
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
77
- getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
78
- getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
79
- queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
80
- queryAllByPlaceholderText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
81
- findByPlaceholderText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
82
- findAllByPlaceholderText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
83
- getByDisplayValue: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
84
- getAllByDisplayValue: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
85
- queryByDisplayValue: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
86
- queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
87
- findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
88
- findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
89
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
90
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
91
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
92
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
93
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
94
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
23
+ container: HostElement;
24
+ root: HostElement | null;
95
25
  getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
96
26
  getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
97
27
  queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
98
28
  queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
99
29
  findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
100
30
  findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
101
- };
102
- export declare function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions): {
103
- update: (component: React.ReactElement) => void;
104
- unmount: () => void;
105
- rerender: (component: React.ReactElement) => void;
106
- toJSON: () => null | import("react-test-renderer").ReactTestRendererJSON | import("react-test-renderer").ReactTestRendererJSON[];
107
- debug: DebugFunction;
108
- root: ReactTestInstance;
109
- UNSAFE_root: ReactTestInstance;
110
- UNSAFE_getByProps: (props: {
111
- [x: string]: unknown;
112
- }) => ReactTestInstance;
113
- UNSAFE_getAllByProps: (props: {
114
- [x: string]: unknown;
115
- }) => Array<ReactTestInstance>;
116
- UNSAFE_queryByProps: (props: {
117
- [x: string]: unknown;
118
- }) => ReactTestInstance | null;
119
- UNSAFE_queryAllByProps: (props: {
120
- [x: string]: unknown;
121
- }) => Array<ReactTestInstance>;
122
- UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
123
- UNSAFE_getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
124
- UNSAFE_queryByType: <P>(type: React.ComponentType<P>) => ReactTestInstance | null;
125
- UNSAFE_queryAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
31
+ getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
32
+ getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
33
+ queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
34
+ queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
35
+ findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
36
+ findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
126
37
  getByRole: import("./queries/make-queries").GetByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
127
38
  getAllByRole: import("./queries/make-queries").GetAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
128
39
  queryByRole: import("./queries/make-queries").QueryByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
129
40
  queryAllByRole: import("./queries/make-queries").QueryAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
130
41
  findByRole: import("./queries/make-queries").FindByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
131
42
  findAllByRole: import("./queries/make-queries").FindAllByQuery<import("./queries/role").ByRoleMatcher, import("./queries/role").ByRoleOptions>;
43
+ getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
44
+ getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
45
+ queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
46
+ queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
47
+ findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
48
+ findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
132
49
  getByHintText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
133
50
  getAllByHintText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
134
51
  queryByHintText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -147,12 +64,6 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
147
64
  queryAllByAccessibilityHint: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
148
65
  findByAccessibilityHint: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
149
66
  findAllByAccessibilityHint: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
150
- getByLabelText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
151
- getAllByLabelText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
152
- queryByLabelText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
153
- queryAllByLabelText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
154
- findByLabelText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
155
- findAllByLabelText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
156
67
  getByPlaceholderText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
157
68
  getAllByPlaceholderText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
158
69
  queryByPlaceholderText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
@@ -165,17 +76,5 @@ export declare function renderInternal<T>(component: React.ReactElement<T>, opti
165
76
  queryAllByDisplayValue: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
166
77
  findByDisplayValue: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
167
78
  findAllByDisplayValue: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
168
- getByTestId: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
169
- getAllByTestId: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
170
- queryByTestId: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
171
- queryAllByTestId: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
172
- findByTestId: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
173
- findAllByTestId: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
174
- getByText: import("./queries/make-queries").GetByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
175
- getAllByText: import("./queries/make-queries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
176
- queryByText: import("./queries/make-queries").QueryByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
177
- queryAllByText: import("./queries/make-queries").QueryAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
178
- findByText: import("./queries/make-queries").FindByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
179
- findAllByText: import("./queries/make-queries").FindAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("./matches").TextMatchOptions>;
180
79
  };
181
80
  export type DebugFunction = (options?: DebugOptions) => void;
package/build/render.js CHANGED
@@ -3,71 +3,47 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = render;
7
- exports.renderInternal = renderInternal;
6
+ exports.render = render;
8
7
  var React = _interopRequireWildcard(require("react"));
8
+ var _universalTestRenderer = require("universal-test-renderer");
9
9
  var _act = _interopRequireDefault(require("./act"));
10
10
  var _cleanup = require("./cleanup");
11
11
  var _config = require("./config");
12
- var _componentTree = require("./helpers/component-tree");
13
12
  var _debug = require("./helpers/debug");
14
- var _stringValidation = require("./helpers/string-validation");
15
- var _renderAct = require("./render-act");
13
+ var _hostComponentNames = require("./helpers/host-component-names");
16
14
  var _screen = require("./screen");
17
15
  var _within = require("./within");
18
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ const createRootOptions = {
20
+ textComponents: _hostComponentNames.HOST_TEXT_NAMES
21
+ };
22
+
21
23
  /**
22
24
  * Renders test component deeply using React Test Renderer and exposes helpers
23
25
  * to assert on the output.
24
26
  */
25
- function render(component, options = {}) {
26
- return renderInternal(component, options);
27
- }
28
- function renderInternal(component, options) {
27
+ function render(element, options = {}) {
29
28
  const {
30
- wrapper: Wrapper,
31
- concurrentRoot,
32
- unstable_validateStringsRenderedWithinText,
33
- ...rest
29
+ wrapper: Wrapper
34
30
  } = options || {};
35
- const testRendererOptions = {
36
- ...rest,
37
- // @ts-expect-error incomplete typing on RTR package
38
- unstable_isConcurrent: concurrentRoot ?? (0, _config.getConfig)().concurrentRoot
39
- };
40
- if (unstable_validateStringsRenderedWithinText) {
41
- return renderWithStringValidation(component, {
42
- wrapper: Wrapper,
43
- ...testRendererOptions
44
- });
45
- }
46
31
  const wrap = element => Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element;
47
- const renderer = (0, _renderAct.renderWithAct)(wrap(component), testRendererOptions);
48
- return buildRenderResult(renderer, wrap);
49
- }
50
- function renderWithStringValidation(component, options = {}) {
51
- const {
52
- wrapper: Wrapper,
53
- ...testRendererOptions
54
- } = options ?? {};
55
- const wrap = element => /*#__PURE__*/React.createElement(React.Profiler, {
56
- id: "renderProfiler",
57
- onRender: handleRender
58
- }, Wrapper ? /*#__PURE__*/React.createElement(Wrapper, null, element) : element);
59
- const handleRender = (_, phase) => {
60
- if (renderer && phase === 'update') {
61
- (0, _stringValidation.validateStringsRenderedWithinText)(renderer.toJSON());
62
- }
63
- };
64
- const renderer = (0, _renderAct.renderWithAct)(wrap(component), testRendererOptions);
65
- (0, _stringValidation.validateStringsRenderedWithinText)(renderer.toJSON());
32
+ const renderer = (0, _universalTestRenderer.createRoot)({
33
+ ...createRootOptions,
34
+ createNodeMock: options?.createNodeMock
35
+ });
36
+ void (0, _act.default)(() => {
37
+ renderer.render(wrap(element));
38
+ });
66
39
  return buildRenderResult(renderer, wrap);
67
40
  }
68
41
  function buildRenderResult(renderer, wrap) {
69
- const update = updateWithAct(renderer, wrap);
70
- const instance = renderer.root;
42
+ const update = element => {
43
+ void (0, _act.default)(() => {
44
+ renderer.render(wrap(element));
45
+ });
46
+ };
71
47
  const unmount = () => {
72
48
  void (0, _act.default)(() => {
73
49
  renderer.unmount();
@@ -75,37 +51,21 @@ function buildRenderResult(renderer, wrap) {
75
51
  };
76
52
  (0, _cleanup.addToCleanupQueue)(unmount);
77
53
  const result = {
78
- ...(0, _within.getQueriesForElement)(instance),
54
+ ...(0, _within.getQueriesForElement)(renderer.container),
79
55
  update,
80
56
  unmount,
81
57
  rerender: update,
82
58
  // alias for `update`
83
- toJSON: renderer.toJSON,
59
+ toJSON: () => renderer.root?.toJSON(),
84
60
  debug: makeDebug(renderer),
61
+ container: renderer.container,
85
62
  get root() {
86
- return (0, _componentTree.getHostSelves)(instance)[0];
87
- },
88
- UNSAFE_root: instance
89
- };
90
-
91
- // Add as non-enumerable property, so that it's safe to enumerate
92
- // `render` result, e.g. using destructuring rest syntax.
93
- Object.defineProperty(result, 'container', {
94
- enumerable: false,
95
- get() {
96
- throw new Error("'container' property has been renamed to 'UNSAFE_root'.\n\n" + "Consider using 'root' property which returns root host element.");
63
+ return renderer.root;
97
64
  }
98
- });
65
+ };
99
66
  (0, _screen.setRenderResult)(result);
100
67
  return result;
101
68
  }
102
- function updateWithAct(renderer, wrap) {
103
- return function (component) {
104
- void (0, _act.default)(() => {
105
- renderer.update(wrap(component));
106
- });
107
- };
108
- }
109
69
  function makeDebug(renderer) {
110
70
  function debugImpl(options) {
111
71
  const {
@@ -115,7 +75,7 @@ function makeDebug(renderer) {
115
75
  ...defaultDebugOptions,
116
76
  ...options
117
77
  };
118
- const json = renderer.toJSON();
78
+ const json = renderer.root?.toJSON();
119
79
  if (json) {
120
80
  return (0, _debug.debug)(json, debugOptions);
121
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","_interopRequireWildcard","require","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debug","_stringValidation","_renderAct","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","concurrentRoot","unstable_validateStringsRenderedWithinText","rest","testRendererOptions","unstable_isConcurrent","getConfig","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","Profiler","id","onRender","handleRender","_","phase","validateStringsRenderedWithinText","toJSON","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","makeDebug","getHostSelves","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","debugOptions","json"],"sources":["../src/render.tsx"],"sourcesContent":["import * as React from 'react';\nimport type {\n ReactTestInstance,\n ReactTestRenderer,\n TestRendererOptions,\n} from 'react-test-renderer';\n\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostSelves } from './helpers/component-tree';\nimport type { DebugOptions } from './helpers/debug';\nimport { debug } from './helpers/debug';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n\n /**\n * Set to `false` to disable concurrent rendering.\n * Otherwise `render` will default to concurrent rendering.\n */\n concurrentRoot?: boolean;\n\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport function renderInternal<T>(component: React.ReactElement<T>, options?: RenderOptions) {\n const {\n wrapper: Wrapper,\n concurrentRoot,\n unstable_validateStringsRenderedWithinText,\n ...rest\n } = options || {};\n\n const testRendererOptions: TestRendererOptions = {\n ...rest,\n // @ts-expect-error incomplete typing on RTR package\n unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,\n };\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const wrap = (element: React.ReactElement) => (\n <React.Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </React.Profiler>\n );\n\n const handleRender: React.ProfilerOnRenderCallback = (_, phase) => {\n if (renderer && phase === 'update') {\n validateStringsRenderedWithinText(renderer.toJSON());\n }\n };\n\n const renderer: ReactTestRenderer = renderWithAct(wrap(component), testRendererOptions);\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => React.JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: makeDebug(renderer),\n get root(): ReactTestInstance {\n return getHostSelves(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport type DebugFunction = (options?: DebugOptions) => void;\n\nfunction makeDebug(renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions = { ...defaultDebugOptions, ...options };\n const json = renderer.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n return debugImpl;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAAgD,SAAAE,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,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,GAAG,IAAAlC,iBAAS,EAAC,CAAC;IAC3C,MAAMmC,YAAY,GAAG;MAAE,GAAGD,mBAAmB;MAAE,GAAG3C;IAAQ,CAAC;IAC3D,MAAM6C,IAAI,GAAG/B,QAAQ,CAACU,MAAM,CAAC,CAAC;IAC9B,IAAIqB,IAAI,EAAE;MACR,OAAO,IAAAV,YAAK,EAACU,IAAI,EAAED,YAAY,CAAC;IAClC;EACF;EACA,OAAOF,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["React","_interopRequireWildcard","require","_universalTestRenderer","_act","_interopRequireDefault","_cleanup","_config","_debug","_hostComponentNames","_screen","_within","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createRootOptions","textComponents","HOST_TEXT_NAMES","render","element","options","wrapper","Wrapper","wrap","createElement","renderer","createRoot","createNodeMock","act","buildRenderResult","update","unmount","addToCleanupQueue","result","getQueriesForElement","container","rerender","toJSON","root","debug","makeDebug","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions","json"],"sources":["../src/render.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { HostElement, Root, RootOptions } from 'universal-test-renderer';\nimport { createRoot } from 'universal-test-renderer';\n\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport type { DebugOptions } from './helpers/debug';\nimport { debug } from './helpers/debug';\nimport { HOST_TEXT_NAMES } from './helpers/host-component-names';\nimport { setRenderResult } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n /**\n * Pass a React Component as the wrapper option to have it rendered around the inner element. This is most useful for creating\n * reusable custom render functions for common data providers.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrapper?: React.ComponentType<any>;\n createNodeMock?: (element: React.ReactElement) => object;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\nconst createRootOptions: RootOptions = {\n textComponents: HOST_TEXT_NAMES,\n};\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport function render<T>(element: React.ReactElement<T>, options: RenderOptions = {}) {\n const { wrapper: Wrapper } = options || {};\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = createRoot({\n ...createRootOptions,\n createNodeMock: options?.createNodeMock,\n });\n void act(() => {\n renderer.render(wrap(element));\n });\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: Root,\n wrap: (element: React.ReactElement) => React.JSX.Element,\n) {\n const update = (element: React.ReactElement) => {\n void act(() => {\n renderer.render(wrap(element));\n });\n };\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(renderer.container),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: () => renderer.root?.toJSON(),\n debug: makeDebug(renderer),\n container: renderer.container,\n get root(): HostElement | null {\n return renderer.root;\n },\n };\n\n setRenderResult(result);\n return result;\n}\n\nexport type DebugFunction = (options?: DebugOptions) => void;\n\nfunction makeDebug(renderer: Root): DebugFunction {\n function debugImpl(options?: DebugOptions) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions = { ...defaultDebugOptions, ...options };\n const json = renderer.root?.toJSON();\n if (json) {\n return debug(json, debugOptions);\n }\n }\n\n return debugImpl;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,O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;IACrCE,KAAK,EAAEC,SAAS,CAACf,QAAQ,CAAC;IAC1BU,SAAS,EAAEV,QAAQ,CAACU,SAAS;IAC7B,IAAIG,IAAIA,CAAA,EAAuB;MAC7B,OAAOb,QAAQ,CAACa,IAAI;IACtB;EACF,CAAC;EAED,IAAAG,uBAAe,EAACR,MAAM,CAAC;EACvB,OAAOA,MAAM;AACf;AAIA,SAASO,SAASA,CAACf,QAAc,EAAiB;EAChD,SAASiB,SAASA,CAACtB,OAAsB,EAAE;IACzC,MAAM;MAAEuB;IAAoB,CAAC,GAAG,IAAAC,iBAAS,EAAC,CAAC;IAC3C,MAAMC,YAAY,GAAG;MAAE,GAAGF,mBAAmB;MAAE,GAAGvB;IAAQ,CAAC;IAC3D,MAAM0B,IAAI,GAAGrB,QAAQ,CAACa,IAAI,EAAED,MAAM,CAAC,CAAC;IACpC,IAAIS,IAAI,EAAE;MACR,OAAO,IAAAP,YAAK,EAACO,IAAI,EAAED,YAAY,CAAC;IAClC;EACF;EAEA,OAAOH,SAAS;AAClB","ignoreList":[]}
package/build/screen.js CHANGED
@@ -18,7 +18,7 @@ const defaultScreen = {
18
18
  get root() {
19
19
  throw new Error(SCREEN_ERROR);
20
20
  },
21
- get UNSAFE_root() {
21
+ get container() {
22
22
  throw new Error(SCREEN_ERROR);
23
23
  },
24
24
  debug: notImplementedDebug,
@@ -56,14 +56,6 @@ const defaultScreen = {
56
56
  queryAllByRole: notImplemented,
57
57
  findByRole: notImplemented,
58
58
  findAllByRole: notImplemented,
59
- UNSAFE_getByProps: notImplemented,
60
- UNSAFE_getAllByProps: notImplemented,
61
- UNSAFE_queryByProps: notImplemented,
62
- UNSAFE_queryAllByProps: notImplemented,
63
- UNSAFE_getByType: notImplemented,
64
- UNSAFE_getAllByType: notImplemented,
65
- UNSAFE_queryByType: notImplemented,
66
- UNSAFE_queryAllByType: notImplemented,
67
59
  getByPlaceholderText: notImplemented,
68
60
  getAllByPlaceholderText: notImplemented,
69
61
  queryByPlaceholderText: notImplemented,
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport type { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAIA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAMD,MAAMI,aAAqB,GAAG;EAC5BC,UAAU,EAAE,IAAI;EAChB,IAAIC,IAAIA,CAAA,EAAsB;IAC5B,MAAM,IAAIJ,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACD,IAAIO,WAAWA,CAAA,EAAsB;IACnC,MAAM,IAAIL,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACDQ,KAAK,EAAEL,mBAAmB;EAC1BM,MAAM,EAAER,cAAc;EACtBS,OAAO,EAAET,cAAc;EACvBU,QAAQ,EAAEV,cAAc;EACxBW,MAAM,EAAEX,cAAc;EACtBY,cAAc,EAAEZ,cAAc;EAC9Ba,iBAAiB,EAAEb,cAAc;EACjCc,gBAAgB,EAAEd,cAAc;EAChCe,mBAAmB,EAAEf,cAAc;EACnCgB,eAAe,EAAEhB,cAAc;EAC/BiB,kBAAkB,EAAEjB,cAAc;EAClCkB,aAAa,EAAElB,cAAc;EAC7BmB,gBAAgB,EAAEnB,cAAc;EAChCoB,eAAe,EAAEpB,cAAc;EAC/BqB,kBAAkB,EAAErB,cAAc;EAClCsB,cAAc,EAAEtB,cAAc;EAC9BuB,iBAAiB,EAAEvB,cAAc;EACjCwB,aAAa,EAAExB,c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AAc;EAC7BiE,gBAAgB,EAAEjE,cAAc;EAChCkE,YAAY,EAAElE,cAAc;EAC5BmE,eAAe,EAAEnE,cAAc;EAC/BoE,SAAS,EAAEpE,cAAc;EACzBqE,YAAY,EAAErE,cAAc;EAC5BsE,WAAW,EAAEtE,cAAc;EAC3BuE,cAAc,EAAEvE,cAAc;EAC9BwE,UAAU,EAAExE,cAAc;EAC1ByE,aAAa,EAAEzE;AACjB,CAAC;AAEM,IAAI0E,MAAc,GAAAC,OAAA,CAAAD,MAAA,GAAGvE,aAAa;AAElC,SAASyE,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGvE,aAAa;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","defaultScreen","isDetached","root","container","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): HostElement | null {\n throw new Error(SCREEN_ERROR);\n },\n get container(): HostElement {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAIA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAMD,MAAMI,aAAqB,GAAG;EAC5BC,UAAU,EAAE,IAAI;EAChB,IAAIC,IAAIA,CAAA,EAAuB;IAC7B,MAAM,IAAIJ,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACD,IAAIO,SAASA,CAAA,EAAgB;IAC3B,MAAM,IAAIL,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACDQ,KAAK,EAAEL,mBAAmB;EAC1BM,MAAM,EAAER,cAAc;EACtBS,OAAO,EAAET,cAAc;EACvBU,QAAQ,EAAEV,cAAc;EACxBW,MAAM,EAAEX,cAAc;EACtBY,cAAc,EAAEZ,cAAc;EAC9Ba,iBAAiB,EAAEb,cAAc;EACjCc,gBAAgB,EAAEd,cAAc;EAChCe,mBAAmB,EAAEf,cAAc;EACnCgB,eAAe,EAAEhB,cAAc;EAC/BiB,kBAAkB,EAAEjB,cAAc;EAClCkB,aAAa,EAAElB,cAAc;EAC7BmB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EAAE3D,cAAc;EAC/B4D,SAAS,EAAE5D,cAAc;EACzB6D,YAAY,EAAE7D,cAAc;EAC5B8D,WAAW,EAAE9D,cAAc;EAC3B+D,cAAc,EAAE/D,cAAc;EAC9BgE,UAAU,EAAEhE,cAAc;EAC1BiE,aAAa,EAAEjE;AACjB,CAAC;AAEM,IAAIkE,MAAc,GAAAC,OAAA,CAAAD,MAAA,GAAG/D,aAAa;AAElC,SAASiE,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAG/D,aAAa;AACxB","ignoreList":[]}
@@ -1 +1 @@
1
- {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/event-handler.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-act.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/ensure-peer-deps.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-element.ts","../src/helpers/host-component-names.ts","../src/helpers/logger.ts","../src/helpers/map-props.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/string-validation.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/queries/unsafe-props.ts","../src/queries/unsafe-type.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.7.3"}
1
+ {"root":["../src/act.ts","../src/cleanup.ts","../src/config.ts","../src/event-handler.ts","../src/fire-event.ts","../src/flush-micro-tasks.ts","../src/index.ts","../src/matches.ts","../src/native-state.ts","../src/pure.ts","../src/react-versions.ts","../src/render-hook.tsx","../src/render.tsx","../src/screen.ts","../src/types.ts","../src/wait-for-element-to-be-removed.ts","../src/wait-for.ts","../src/within.ts","../src/helpers/accessibility.ts","../src/helpers/component-tree.ts","../src/helpers/debug.ts","../src/helpers/errors.ts","../src/helpers/find-all.ts","../src/helpers/format-element.ts","../src/helpers/host-component-names.ts","../src/helpers/logger.ts","../src/helpers/map-props.ts","../src/helpers/object.ts","../src/helpers/pointer-events.ts","../src/helpers/text-content.ts","../src/helpers/text-input.ts","../src/helpers/timers.ts","../src/helpers/wrap-async.ts","../src/helpers/matchers/match-accessibility-state.ts","../src/helpers/matchers/match-accessibility-value.ts","../src/helpers/matchers/match-array-prop.ts","../src/helpers/matchers/match-label-text.ts","../src/helpers/matchers/match-object-prop.ts","../src/helpers/matchers/match-string-prop.ts","../src/helpers/matchers/match-text-content.ts","../src/matchers/extend-expect.ts","../src/matchers/index.ts","../src/matchers/to-be-busy.ts","../src/matchers/to-be-checked.ts","../src/matchers/to-be-disabled.ts","../src/matchers/to-be-empty-element.ts","../src/matchers/to-be-expanded.ts","../src/matchers/to-be-on-the-screen.ts","../src/matchers/to-be-partially-checked.ts","../src/matchers/to-be-selected.ts","../src/matchers/to-be-visible.ts","../src/matchers/to-contain-element.ts","../src/matchers/to-have-accessibility-value.ts","../src/matchers/to-have-accessible-name.ts","../src/matchers/to-have-display-value.ts","../src/matchers/to-have-prop.ts","../src/matchers/to-have-style.ts","../src/matchers/to-have-text-content.ts","../src/matchers/types.ts","../src/matchers/utils.ts","../src/queries/display-value.ts","../src/queries/hint-text.ts","../src/queries/label-text.ts","../src/queries/make-queries.ts","../src/queries/options.ts","../src/queries/placeholder-text.ts","../src/queries/role.ts","../src/queries/test-id.ts","../src/queries/text.ts","../src/test-utils/events.ts","../src/test-utils/index.ts","../src/user-event/clear.ts","../src/user-event/index.ts","../src/user-event/paste.ts","../src/user-event/event-builder/base.ts","../src/user-event/event-builder/common.ts","../src/user-event/event-builder/index.ts","../src/user-event/event-builder/scroll-view.ts","../src/user-event/event-builder/text-input.ts","../src/user-event/press/index.ts","../src/user-event/press/press.ts","../src/user-event/scroll/index.ts","../src/user-event/scroll/scroll-to.ts","../src/user-event/scroll/utils.ts","../src/user-event/setup/index.ts","../src/user-event/setup/setup.ts","../src/user-event/type/index.ts","../src/user-event/type/parse-keys.ts","../src/user-event/type/type.ts","../src/user-event/utils/content-size.ts","../src/user-event/utils/dispatch-event.ts","../src/user-event/utils/index.ts","../src/user-event/utils/text-range.ts","../src/user-event/utils/wait.ts"],"version":"5.8.2"}
@@ -1,3 +1,3 @@
1
- import type { ReactTestInstance } from 'react-test-renderer';
1
+ import type { HostElement } from 'universal-test-renderer';
2
2
  import type { UserEventInstance } from './setup';
3
- export declare function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void>;
3
+ export declare function clear(this: UserEventInstance, element: HostElement): Promise<void>;