@testing-library/react-native 14.0.0-alpha.5 → 14.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +18 -7
  2. package/build/act.d.ts +0 -3
  3. package/build/act.js +2 -3
  4. package/build/act.js.map +1 -1
  5. package/build/config.js +10 -4
  6. package/build/config.js.map +1 -1
  7. package/build/event-handler.d.ts +0 -1
  8. package/build/event-handler.js +0 -1
  9. package/build/event-handler.js.map +1 -1
  10. package/build/fire-event.d.ts +2 -11
  11. package/build/fire-event.js +0 -32
  12. package/build/fire-event.js.map +1 -1
  13. package/build/helpers/accessibility.d.ts +1 -1
  14. package/build/helpers/accessibility.js.map +1 -1
  15. package/build/helpers/component-tree.d.ts +1 -1
  16. package/build/helpers/component-tree.js.map +1 -1
  17. package/build/helpers/debug.d.ts +1 -1
  18. package/build/helpers/debug.js.map +1 -1
  19. package/build/helpers/errors.d.ts +1 -3
  20. package/build/helpers/errors.js +3 -36
  21. package/build/helpers/errors.js.map +1 -1
  22. package/build/helpers/find-all.d.ts +1 -1
  23. package/build/helpers/find-all.js.map +1 -1
  24. package/build/helpers/format-element.d.ts +1 -1
  25. package/build/helpers/format-element.js.map +1 -1
  26. package/build/helpers/host-component-names.d.ts +1 -1
  27. package/build/helpers/host-component-names.js.map +1 -1
  28. package/build/helpers/matchers/match-accessibility-state.d.ts +1 -1
  29. package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
  30. package/build/helpers/matchers/match-accessibility-value.d.ts +1 -1
  31. package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
  32. package/build/helpers/matchers/match-label-text.d.ts +1 -1
  33. package/build/helpers/matchers/match-label-text.js.map +1 -1
  34. package/build/helpers/matchers/match-text-content.d.ts +1 -1
  35. package/build/helpers/matchers/match-text-content.js.map +1 -1
  36. package/build/helpers/pointer-events.d.ts +1 -1
  37. package/build/helpers/pointer-events.js.map +1 -1
  38. package/build/helpers/text-content.d.ts +1 -1
  39. package/build/helpers/text-content.js.map +1 -1
  40. package/build/helpers/text-input.d.ts +1 -1
  41. package/build/helpers/text-input.js.map +1 -1
  42. package/build/helpers/validate-options.d.ts +9 -0
  43. package/build/helpers/validate-options.js +32 -0
  44. package/build/helpers/validate-options.js.map +1 -0
  45. package/build/matchers/to-be-busy.d.ts +1 -1
  46. package/build/matchers/to-be-busy.js.map +1 -1
  47. package/build/matchers/to-be-checked.d.ts +1 -1
  48. package/build/matchers/to-be-checked.js.map +1 -1
  49. package/build/matchers/to-be-disabled.d.ts +1 -1
  50. package/build/matchers/to-be-disabled.js.map +1 -1
  51. package/build/matchers/to-be-empty-element.d.ts +1 -1
  52. package/build/matchers/to-be-empty-element.js.map +1 -1
  53. package/build/matchers/to-be-expanded.d.ts +1 -1
  54. package/build/matchers/to-be-expanded.js.map +1 -1
  55. package/build/matchers/to-be-on-the-screen.d.ts +1 -1
  56. package/build/matchers/to-be-on-the-screen.js.map +1 -1
  57. package/build/matchers/to-be-partially-checked.d.ts +1 -1
  58. package/build/matchers/to-be-partially-checked.js.map +1 -1
  59. package/build/matchers/to-be-selected.d.ts +1 -1
  60. package/build/matchers/to-be-selected.js.map +1 -1
  61. package/build/matchers/to-be-visible.d.ts +1 -1
  62. package/build/matchers/to-be-visible.js.map +1 -1
  63. package/build/matchers/to-contain-element.d.ts +1 -1
  64. package/build/matchers/to-contain-element.js.map +1 -1
  65. package/build/matchers/to-have-accessibility-value.d.ts +1 -1
  66. package/build/matchers/to-have-accessibility-value.js.map +1 -1
  67. package/build/matchers/to-have-accessible-name.d.ts +1 -1
  68. package/build/matchers/to-have-accessible-name.js.map +1 -1
  69. package/build/matchers/to-have-display-value.d.ts +1 -1
  70. package/build/matchers/to-have-display-value.js.map +1 -1
  71. package/build/matchers/to-have-prop.d.ts +1 -1
  72. package/build/matchers/to-have-prop.js.map +1 -1
  73. package/build/matchers/to-have-style.d.ts +1 -1
  74. package/build/matchers/to-have-style.js.map +1 -1
  75. package/build/matchers/to-have-text-content.d.ts +1 -1
  76. package/build/matchers/to-have-text-content.js.map +1 -1
  77. package/build/matchers/types.d.ts +1 -1
  78. package/build/matchers/types.js.map +1 -1
  79. package/build/matchers/utils.d.ts +1 -1
  80. package/build/matchers/utils.js.map +1 -1
  81. package/build/native-state.d.ts +1 -1
  82. package/build/native-state.js.map +1 -1
  83. package/build/pure.d.ts +5 -7
  84. package/build/pure.js +0 -31
  85. package/build/pure.js.map +1 -1
  86. package/build/queries/display-value.d.ts +1 -1
  87. package/build/queries/display-value.js.map +1 -1
  88. package/build/queries/hint-text.d.ts +1 -1
  89. package/build/queries/hint-text.js.map +1 -1
  90. package/build/queries/label-text.d.ts +1 -1
  91. package/build/queries/label-text.js.map +1 -1
  92. package/build/queries/make-queries.d.ts +1 -1
  93. package/build/queries/make-queries.js.map +1 -1
  94. package/build/queries/placeholder-text.d.ts +1 -1
  95. package/build/queries/placeholder-text.js.map +1 -1
  96. package/build/queries/role.d.ts +1 -1
  97. package/build/queries/role.js.map +1 -1
  98. package/build/queries/test-id.d.ts +1 -1
  99. package/build/queries/test-id.js.map +1 -1
  100. package/build/queries/text.d.ts +1 -1
  101. package/build/queries/text.js.map +1 -1
  102. package/build/render-hook.d.ts +0 -8
  103. package/build/render-hook.js +7 -39
  104. package/build/render-hook.js.map +1 -1
  105. package/build/render.d.ts +2 -3
  106. package/build/render.js +12 -9
  107. package/build/render.js.map +1 -1
  108. package/build/screen.js +0 -1
  109. package/build/screen.js.map +1 -1
  110. package/build/test-utils/json.d.ts +1 -1
  111. package/build/test-utils/json.js.map +1 -1
  112. package/build/test-utils/timers.d.ts +2 -0
  113. package/build/test-utils/timers.js +20 -0
  114. package/build/test-utils/timers.js.map +1 -0
  115. package/build/tsconfig.release.tsbuildinfo +1 -1
  116. package/build/user-event/clear.d.ts +1 -1
  117. package/build/user-event/clear.js.map +1 -1
  118. package/build/user-event/event-builder/base.d.ts +5 -1
  119. package/build/user-event/event-builder/base.js +1 -1
  120. package/build/user-event/event-builder/base.js.map +1 -1
  121. package/build/user-event/event-builder/common.d.ts +5 -0
  122. package/build/user-event/event-builder/index.d.ts +12 -0
  123. package/build/user-event/event-builder/scroll-view.d.ts +1 -0
  124. package/build/user-event/event-builder/text-input.d.ts +6 -0
  125. package/build/user-event/index.d.ts +1 -1
  126. package/build/user-event/index.js.map +1 -1
  127. package/build/user-event/paste.d.ts +1 -1
  128. package/build/user-event/paste.js.map +1 -1
  129. package/build/user-event/press/press.d.ts +1 -1
  130. package/build/user-event/press/press.js.map +1 -1
  131. package/build/user-event/scroll/scroll-to.d.ts +1 -1
  132. package/build/user-event/scroll/scroll-to.js.map +1 -1
  133. package/build/user-event/setup/setup.d.ts +1 -1
  134. package/build/user-event/setup/setup.js +17 -3
  135. package/build/user-event/setup/setup.js.map +1 -1
  136. package/build/user-event/type/type.d.ts +1 -1
  137. package/build/user-event/type/type.js.map +1 -1
  138. package/build/user-event/utils/dispatch-event.d.ts +1 -1
  139. package/build/user-event/utils/dispatch-event.js.map +1 -1
  140. package/build/wait-for.js +8 -13
  141. package/build/wait-for.js.map +1 -1
  142. package/build/within.d.ts +1 -1
  143. package/build/within.js.map +1 -1
  144. package/package.json +11 -10
  145. package/build/react-versions.d.ts +0 -1
  146. package/build/react-versions.js +0 -14
  147. package/build/react-versions.js.map +0 -1
  148. package/build/unsafe-render-sync.d.ts +0 -144
  149. package/build/unsafe-render-sync.js +0 -114
  150. package/build/unsafe-render-sync.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"format-element.js","names":["_prettyFormat","_interopRequireWildcard","require","_mapProps","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","formatElement","element","compact","highlight","mapProps","defaultMapProps","children","props","childrenToDisplay","undefined","prettyFormat","$$typeof","Symbol","for","type","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","min","formatElementList","elements","options","length","map","join","formatJson","json","getElementJsonPlugin","test","val","serialize","config","indentation","depth","refs","printer","newVal"],"sources":["../../src/helpers/format-element.ts"],"sourcesContent":["import type { NewPlugin } from 'pretty-format';\nimport prettyFormat, { plugins } from 'pretty-format';\nimport type { HostElement, JsonNode } from 'universal-test-renderer';\n\nimport type { MapPropsFunction } from './map-props';\nimport { defaultMapProps } from './map-props';\n\nexport type FormatElementOptions = {\n /** Minimize used space. */\n compact?: boolean;\n\n /** Highlight the output. */\n highlight?: boolean;\n\n /** Filter or map props to display. */\n mapProps?: MapPropsFunction | null;\n};\n\n/***\n * Format given element as a pretty-printed string.\n *\n * @param element Element to format.\n */\nexport function formatElement(\n element: HostElement | null,\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n if (element == null) {\n return '(null)';\n }\n\n const { children, ...props } = element.props;\n const childrenToDisplay = typeof children === 'string' ? [children] : undefined;\n\n return prettyFormat(\n {\n // This prop is needed persuade the prettyFormat that the element is\n // a JsonNode instance, so it is formatted as JSX.\n $$typeof: Symbol.for('react.test.json'),\n type: `${element.type}`,\n props: mapProps ? mapProps(props) : props,\n children: childrenToDisplay,\n },\n // See: https://www.npmjs.com/package/pretty-format#usage-with-options\n {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n printFunctionName: false,\n printBasicPrototype: false,\n highlight: highlight,\n min: compact,\n },\n );\n}\n\nexport function formatElementList(elements: HostElement[], options?: FormatElementOptions) {\n if (elements.length === 0) {\n return '(no elements)';\n }\n\n return elements.map((element) => formatElement(element, options)).join('\\n');\n}\n\nexport function formatJson(\n json: JsonNode | JsonNode[],\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n return prettyFormat(json, {\n plugins: [getElementJsonPlugin(mapProps), plugins.ReactElement],\n highlight: highlight,\n printBasicPrototype: false,\n min: compact,\n });\n}\n\nfunction getElementJsonPlugin(mapProps?: MapPropsFunction | null): NewPlugin {\n return {\n test: (val) => plugins.ReactTestComponent.test(val),\n serialize: (val, config, indentation, depth, refs, printer) => {\n let newVal = val;\n if (mapProps && val.props) {\n newVal = { ...val, props: mapProps(val.props) };\n }\n return plugins.ReactTestComponent.serialize(\n newVal,\n config,\n indentation,\n depth,\n refs,\n printer,\n );\n },\n };\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"format-element.js","names":["_prettyFormat","_interopRequireWildcard","require","_mapProps","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","formatElement","element","compact","highlight","mapProps","defaultMapProps","children","props","childrenToDisplay","undefined","prettyFormat","$$typeof","Symbol","for","type","plugins","ReactTestComponent","ReactElement","printFunctionName","printBasicPrototype","min","formatElementList","elements","options","length","map","join","formatJson","json","getElementJsonPlugin","test","val","serialize","config","indentation","depth","refs","printer","newVal"],"sources":["../../src/helpers/format-element.ts"],"sourcesContent":["import type { NewPlugin } from 'pretty-format';\nimport prettyFormat, { plugins } from 'pretty-format';\nimport type { HostElement, JsonNode } from 'test-renderer';\n\nimport type { MapPropsFunction } from './map-props';\nimport { defaultMapProps } from './map-props';\n\nexport type FormatElementOptions = {\n /** Minimize used space. */\n compact?: boolean;\n\n /** Highlight the output. */\n highlight?: boolean;\n\n /** Filter or map props to display. */\n mapProps?: MapPropsFunction | null;\n};\n\n/***\n * Format given element as a pretty-printed string.\n *\n * @param element Element to format.\n */\nexport function formatElement(\n element: HostElement | null,\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n if (element == null) {\n return '(null)';\n }\n\n const { children, ...props } = element.props;\n const childrenToDisplay = typeof children === 'string' ? [children] : undefined;\n\n return prettyFormat(\n {\n // This prop is needed persuade the prettyFormat that the element is\n // a JsonNode instance, so it is formatted as JSX.\n $$typeof: Symbol.for('react.test.json'),\n type: `${element.type}`,\n props: mapProps ? mapProps(props) : props,\n children: childrenToDisplay,\n },\n // See: https://www.npmjs.com/package/pretty-format#usage-with-options\n {\n plugins: [plugins.ReactTestComponent, plugins.ReactElement],\n printFunctionName: false,\n printBasicPrototype: false,\n highlight: highlight,\n min: compact,\n },\n );\n}\n\nexport function formatElementList(elements: HostElement[], options?: FormatElementOptions) {\n if (elements.length === 0) {\n return '(no elements)';\n }\n\n return elements.map((element) => formatElement(element, options)).join('\\n');\n}\n\nexport function formatJson(\n json: JsonNode | JsonNode[],\n { compact, highlight = true, mapProps = defaultMapProps }: FormatElementOptions = {},\n) {\n return prettyFormat(json, {\n plugins: [getElementJsonPlugin(mapProps), plugins.ReactElement],\n highlight: highlight,\n printBasicPrototype: false,\n min: compact,\n });\n}\n\nfunction getElementJsonPlugin(mapProps?: MapPropsFunction | null): NewPlugin {\n return {\n test: (val) => plugins.ReactTestComponent.test(val),\n serialize: (val, config, indentation, depth, refs, printer) => {\n let newVal = val;\n if (mapProps && val.props) {\n newVal = { ...val, props: mapProps(val.props) };\n }\n return plugins.ReactTestComponent.serialize(\n newVal,\n config,\n indentation,\n depth,\n refs,\n printer,\n );\n },\n };\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AAA8C,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,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;AAa9C;AACA;AACA;AACA;AACA;AACO,SAASkB,aAAaA,CAC3BC,OAA2B,EAC3B;EAAEC,OAAO;EAAEC,SAAS,GAAG,IAAI;EAAEC,QAAQ,GAAGC;AAAsC,CAAC,GAAG,CAAC,CAAC,EACpF;EACA,IAAIJ,OAAO,IAAI,IAAI,EAAE;IACnB,OAAO,QAAQ;EACjB;EAEA,MAAM;IAAEK,QAAQ;IAAE,GAAGC;EAAM,CAAC,GAAGN,OAAO,CAACM,KAAK;EAC5C,MAAMC,iBAAiB,GAAG,OAAOF,QAAQ,KAAK,QAAQ,GAAG,CAACA,QAAQ,CAAC,GAAGG,SAAS;EAE/E,OAAO,IAAAC,qBAAY,EACjB;IACE;IACA;IACAC,QAAQ,EAAEC,MAAM,CAACC,GAAG,CAAC,iBAAiB,CAAC;IACvCC,IAAI,EAAE,GAAGb,OAAO,CAACa,IAAI,EAAE;IACvBP,KAAK,EAAEH,QAAQ,GAAGA,QAAQ,CAACG,KAAK,CAAC,GAAGA,KAAK;IACzCD,QAAQ,EAAEE;EACZ,CAAC;EACD;EACA;IACEO,OAAO,EAAE,CAACA,qBAAO,CAACC,kBAAkB,EAAED,qBAAO,CAACE,YAAY,CAAC;IAC3DC,iBAAiB,EAAE,KAAK;IACxBC,mBAAmB,EAAE,KAAK;IAC1BhB,SAAS,EAAEA,SAAS;IACpBiB,GAAG,EAAElB;EACP,CACF,CAAC;AACH;AAEO,SAASmB,iBAAiBA,CAACC,QAAuB,EAAEC,OAA8B,EAAE;EACzF,IAAID,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;IACzB,OAAO,eAAe;EACxB;EAEA,OAAOF,QAAQ,CAACG,GAAG,CAAExB,OAAO,IAAKD,aAAa,CAACC,OAAO,EAAEsB,OAAO,CAAC,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC;AAC9E;AAEO,SAASC,UAAUA,CACxBC,IAA2B,EAC3B;EAAE1B,OAAO;EAAEC,SAAS,GAAG,IAAI;EAAEC,QAAQ,GAAGC;AAAsC,CAAC,GAAG,CAAC,CAAC,EACpF;EACA,OAAO,IAAAK,qBAAY,EAACkB,IAAI,EAAE;IACxBb,OAAO,EAAE,CAACc,oBAAoB,CAACzB,QAAQ,CAAC,EAAEW,qBAAO,CAACE,YAAY,CAAC;IAC/Dd,SAAS,EAAEA,SAAS;IACpBgB,mBAAmB,EAAE,KAAK;IAC1BC,GAAG,EAAElB;EACP,CAAC,CAAC;AACJ;AAEA,SAAS2B,oBAAoBA,CAACzB,QAAkC,EAAa;EAC3E,OAAO;IACL0B,IAAI,EAAGC,GAAG,IAAKhB,qBAAO,CAACC,kBAAkB,CAACc,IAAI,CAACC,GAAG,CAAC;IACnDC,SAAS,EAAEA,CAACD,GAAG,EAAEE,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,KAAK;MAC7D,IAAIC,MAAM,GAAGP,GAAG;MAChB,IAAI3B,QAAQ,IAAI2B,GAAG,CAACxB,KAAK,EAAE;QACzB+B,MAAM,GAAG;UAAE,GAAGP,GAAG;UAAExB,KAAK,EAAEH,QAAQ,CAAC2B,GAAG,CAACxB,KAAK;QAAE,CAAC;MACjD;MACA,OAAOQ,qBAAO,CAACC,kBAAkB,CAACgB,SAAS,CACzCM,MAAM,EACNL,MAAM,EACNC,WAAW,EACXC,KAAK,EACLC,IAAI,EACJC,OACF,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare const HOST_TEXT_NAMES: string[];
3
3
  /**
4
4
  * Checks if the given element is a host Text element.
@@ -1 +1 @@
1
- {"version":3,"file":"host-component-names.js","names":["HOST_TEXT_NAMES","exports","HOST_TEXT_INPUT_NAMES","HOST_IMAGE_NAMES","HOST_SWITCH_NAMES","HOST_SCROLL_VIEW_NAMES","HOST_MODAL_NAMES","isHostText","element","type","includes","isHostTextInput","isHostImage","isHostSwitch","isHostScrollView","isHostModal"],"sources":["../../src/helpers/host-component-names.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nexport const HOST_TEXT_NAMES = ['Text', 'RCTText'];\nconst HOST_TEXT_INPUT_NAMES = ['TextInput'];\nconst HOST_IMAGE_NAMES = ['Image'];\nconst HOST_SWITCH_NAMES = ['RCTSwitch'];\nconst HOST_SCROLL_VIEW_NAMES = ['RCTScrollView'];\nconst HOST_MODAL_NAMES = ['Modal'];\n\n/**\n * Checks if the given element is a host Text element.\n * @param element The element to check.\n */\nexport function isHostText(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host TextInput element.\n * @param element The element to check.\n */\nexport function isHostTextInput(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Image element.\n * @param element The element to check.\n */\nexport function isHostImage(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_IMAGE_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Switch element.\n * @param element The element to check.\n */\nexport function isHostSwitch(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SWITCH_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host ScrollView element.\n * @param element The element to check.\n */\nexport function isHostScrollView(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Modal element.\n * @param element The element to check.\n */\nexport function isHostModal(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_MODAL_NAMES.includes(element.type);\n}\n"],"mappings":";;;;;;;;;;;;AAEO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;AAClD,MAAME,qBAAqB,GAAG,CAAC,WAAW,CAAC;AAC3C,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;AAClC,MAAMC,iBAAiB,GAAG,CAAC,WAAW,CAAC;AACvC,MAAMC,sBAAsB,GAAG,CAAC,eAAe,CAAC;AAChD,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;;AAElC;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,OAA2B,EAAE;EACtD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIT,eAAe,CAACU,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACpF;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACH,OAA2B,EAAE;EAC3D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIP,qBAAqB,CAACQ,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC1F;;AAEA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACJ,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIN,gBAAgB,CAACO,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF;;AAEA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAACL,OAA2B,EAAE;EACxD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIL,iBAAiB,CAACM,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACtF;;AAEA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAACN,OAA2B,EAAE;EAC5D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIJ,sBAAsB,CAACK,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC3F;;AAEA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAACP,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIH,gBAAgB,CAACI,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF","ignoreList":[]}
1
+ {"version":3,"file":"host-component-names.js","names":["HOST_TEXT_NAMES","exports","HOST_TEXT_INPUT_NAMES","HOST_IMAGE_NAMES","HOST_SWITCH_NAMES","HOST_SCROLL_VIEW_NAMES","HOST_MODAL_NAMES","isHostText","element","type","includes","isHostTextInput","isHostImage","isHostSwitch","isHostScrollView","isHostModal"],"sources":["../../src/helpers/host-component-names.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nexport const HOST_TEXT_NAMES = ['Text', 'RCTText'];\nconst HOST_TEXT_INPUT_NAMES = ['TextInput'];\nconst HOST_IMAGE_NAMES = ['Image'];\nconst HOST_SWITCH_NAMES = ['RCTSwitch'];\nconst HOST_SCROLL_VIEW_NAMES = ['RCTScrollView'];\nconst HOST_MODAL_NAMES = ['Modal'];\n\n/**\n * Checks if the given element is a host Text element.\n * @param element The element to check.\n */\nexport function isHostText(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host TextInput element.\n * @param element The element to check.\n */\nexport function isHostTextInput(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Image element.\n * @param element The element to check.\n */\nexport function isHostImage(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_IMAGE_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Switch element.\n * @param element The element to check.\n */\nexport function isHostSwitch(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SWITCH_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host ScrollView element.\n * @param element The element to check.\n */\nexport function isHostScrollView(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_SCROLL_VIEW_NAMES.includes(element.type);\n}\n\n/**\n * Checks if the given element is a host Modal element.\n * @param element The element to check.\n */\nexport function isHostModal(element: HostElement | null) {\n return typeof element?.type === 'string' && HOST_MODAL_NAMES.includes(element.type);\n}\n"],"mappings":";;;;;;;;;;;;AAEO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC;AAClD,MAAME,qBAAqB,GAAG,CAAC,WAAW,CAAC;AAC3C,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;AAClC,MAAMC,iBAAiB,GAAG,CAAC,WAAW,CAAC;AACvC,MAAMC,sBAAsB,GAAG,CAAC,eAAe,CAAC;AAChD,MAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;;AAElC;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,OAA2B,EAAE;EACtD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIT,eAAe,CAACU,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACpF;;AAEA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACH,OAA2B,EAAE;EAC3D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIP,qBAAqB,CAACQ,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC1F;;AAEA;AACA;AACA;AACA;AACO,SAASG,WAAWA,CAACJ,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIN,gBAAgB,CAACO,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF;;AAEA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAACL,OAA2B,EAAE;EACxD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIL,iBAAiB,CAACM,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACtF;;AAEA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAACN,OAA2B,EAAE;EAC5D,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIJ,sBAAsB,CAACK,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AAC3F;;AAEA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAACP,OAA2B,EAAE;EACvD,OAAO,OAAOA,OAAO,EAAEC,IAAI,KAAK,QAAQ,IAAIH,gBAAgB,CAACI,QAAQ,CAACF,OAAO,CAACC,IAAI,CAAC;AACrF","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export interface AccessibilityStateMatcher {
3
3
  disabled?: boolean;
4
4
  selected?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"match-accessibility-state.js","names":["_accessibility","require","matchAccessibilityState","node","matcher","busy","undefined","computeAriaBusy","checked","computeAriaChecked","disabled","computeAriaDisabled","expanded","computeAriaExpanded","selected","computeAriaSelected"],"sources":["../../../src/helpers/matchers/match-accessibility-state.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport {\n computeAriaBusy,\n computeAriaChecked,\n computeAriaDisabled,\n computeAriaExpanded,\n computeAriaSelected,\n} from '../accessibility';\n\n// This type is the same as AccessibilityState from `react-native` package\n// It is re-declared here due to issues with migration from `@types/react-native` to\n// built in `react-native` types.\n// See: https://github.com/callstack/react-native-testing-library/issues/1351\nexport interface AccessibilityStateMatcher {\n disabled?: boolean;\n selected?: boolean;\n checked?: boolean | 'mixed';\n busy?: boolean;\n expanded?: boolean;\n}\n\nexport function matchAccessibilityState(node: HostElement, matcher: AccessibilityStateMatcher) {\n if (matcher.busy !== undefined && matcher.busy !== computeAriaBusy(node)) {\n return false;\n }\n if (matcher.checked !== undefined && matcher.checked !== computeAriaChecked(node)) {\n return false;\n }\n if (matcher.disabled !== undefined && matcher.disabled !== computeAriaDisabled(node)) {\n return false;\n }\n if (matcher.expanded !== undefined && matcher.expanded !== computeAriaExpanded(node)) {\n return false;\n }\n if (matcher.selected !== undefined && matcher.selected !== computeAriaSelected(node)) {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAQA;AACA;AACA;AACA;;AASO,SAASC,uBAAuBA,CAACC,IAAiB,EAAEC,OAAkC,EAAE;EAC7F,IAAIA,OAAO,CAACC,IAAI,KAAKC,SAAS,IAAIF,OAAO,CAACC,IAAI,KAAK,IAAAE,8BAAe,EAACJ,IAAI,CAAC,EAAE;IACxE,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACI,OAAO,KAAKF,SAAS,IAAIF,OAAO,CAACI,OAAO,KAAK,IAAAC,iCAAkB,EAACN,IAAI,CAAC,EAAE;IACjF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACM,QAAQ,KAAKJ,SAAS,IAAIF,OAAO,CAACM,QAAQ,KAAK,IAAAC,kCAAmB,EAACR,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACQ,QAAQ,KAAKN,SAAS,IAAIF,OAAO,CAACQ,QAAQ,KAAK,IAAAC,kCAAmB,EAACV,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACU,QAAQ,KAAKR,SAAS,IAAIF,OAAO,CAACU,QAAQ,KAAK,IAAAC,kCAAmB,EAACZ,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
1
+ {"version":3,"file":"match-accessibility-state.js","names":["_accessibility","require","matchAccessibilityState","node","matcher","busy","undefined","computeAriaBusy","checked","computeAriaChecked","disabled","computeAriaDisabled","expanded","computeAriaExpanded","selected","computeAriaSelected"],"sources":["../../../src/helpers/matchers/match-accessibility-state.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport {\n computeAriaBusy,\n computeAriaChecked,\n computeAriaDisabled,\n computeAriaExpanded,\n computeAriaSelected,\n} from '../accessibility';\n\n// This type is the same as AccessibilityState from `react-native` package\n// It is re-declared here due to issues with migration from `@types/react-native` to\n// built in `react-native` types.\n// See: https://github.com/callstack/react-native-testing-library/issues/1351\nexport interface AccessibilityStateMatcher {\n disabled?: boolean;\n selected?: boolean;\n checked?: boolean | 'mixed';\n busy?: boolean;\n expanded?: boolean;\n}\n\nexport function matchAccessibilityState(node: HostElement, matcher: AccessibilityStateMatcher) {\n if (matcher.busy !== undefined && matcher.busy !== computeAriaBusy(node)) {\n return false;\n }\n if (matcher.checked !== undefined && matcher.checked !== computeAriaChecked(node)) {\n return false;\n }\n if (matcher.disabled !== undefined && matcher.disabled !== computeAriaDisabled(node)) {\n return false;\n }\n if (matcher.expanded !== undefined && matcher.expanded !== computeAriaExpanded(node)) {\n return false;\n }\n if (matcher.selected !== undefined && matcher.selected !== computeAriaSelected(node)) {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAQA;AACA;AACA;AACA;;AASO,SAASC,uBAAuBA,CAACC,IAAiB,EAAEC,OAAkC,EAAE;EAC7F,IAAIA,OAAO,CAACC,IAAI,KAAKC,SAAS,IAAIF,OAAO,CAACC,IAAI,KAAK,IAAAE,8BAAe,EAACJ,IAAI,CAAC,EAAE;IACxE,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACI,OAAO,KAAKF,SAAS,IAAIF,OAAO,CAACI,OAAO,KAAK,IAAAC,iCAAkB,EAACN,IAAI,CAAC,EAAE;IACjF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACM,QAAQ,KAAKJ,SAAS,IAAIF,OAAO,CAACM,QAAQ,KAAK,IAAAC,kCAAmB,EAACR,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACQ,QAAQ,KAAKN,SAAS,IAAIF,OAAO,CAACQ,QAAQ,KAAK,IAAAC,kCAAmB,EAACV,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EACA,IAAIC,OAAO,CAACU,QAAQ,KAAKR,SAAS,IAAIF,OAAO,CAACU,QAAQ,KAAK,IAAAC,kCAAmB,EAACZ,IAAI,CAAC,EAAE;IACpF,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  import type { TextMatch } from '../../matches';
3
3
  export interface AccessibilityValueMatcher {
4
4
  min?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"match-accessibility-value.js","names":["_accessibility","require","_matchStringProp","matchAccessibilityValue","node","matcher","value","computeAriaValue","min","undefined","max","now","text","matchStringProp"],"sources":["../../../src/helpers/matchers/match-accessibility-value.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { TextMatch } from '../../matches';\nimport { computeAriaValue } from '../accessibility';\nimport { matchStringProp } from './match-string-prop';\n\nexport interface AccessibilityValueMatcher {\n min?: number;\n max?: number;\n now?: number;\n text?: TextMatch;\n}\n\nexport function matchAccessibilityValue(\n node: HostElement,\n matcher: AccessibilityValueMatcher,\n): boolean {\n const value = computeAriaValue(node);\n return (\n (matcher.min === undefined || matcher.min === value?.min) &&\n (matcher.max === undefined || matcher.max === value?.max) &&\n (matcher.now === undefined || matcher.now === value?.now) &&\n (matcher.text === undefined || matchStringProp(value?.text, matcher.text))\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AASO,SAASE,uBAAuBA,CACrCC,IAAiB,EACjBC,OAAkC,EACzB;EACT,MAAMC,KAAK,GAAG,IAAAC,+BAAgB,EAACH,IAAI,CAAC;EACpC,OACE,CAACC,OAAO,CAACG,GAAG,KAAKC,SAAS,IAAIJ,OAAO,CAACG,GAAG,KAAKF,KAAK,EAAEE,GAAG,MACvDH,OAAO,CAACK,GAAG,KAAKD,SAAS,IAAIJ,OAAO,CAACK,GAAG,KAAKJ,KAAK,EAAEI,GAAG,CAAC,KACxDL,OAAO,CAACM,GAAG,KAAKF,SAAS,IAAIJ,OAAO,CAACM,GAAG,KAAKL,KAAK,EAAEK,GAAG,CAAC,KACxDN,OAAO,CAACO,IAAI,KAAKH,SAAS,IAAI,IAAAI,gCAAe,EAACP,KAAK,EAAEM,IAAI,EAAEP,OAAO,CAACO,IAAI,CAAC,CAAC;AAE9E","ignoreList":[]}
1
+ {"version":3,"file":"match-accessibility-value.js","names":["_accessibility","require","_matchStringProp","matchAccessibilityValue","node","matcher","value","computeAriaValue","min","undefined","max","now","text","matchStringProp"],"sources":["../../../src/helpers/matchers/match-accessibility-value.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch } from '../../matches';\nimport { computeAriaValue } from '../accessibility';\nimport { matchStringProp } from './match-string-prop';\n\nexport interface AccessibilityValueMatcher {\n min?: number;\n max?: number;\n now?: number;\n text?: TextMatch;\n}\n\nexport function matchAccessibilityValue(\n node: HostElement,\n matcher: AccessibilityValueMatcher,\n): boolean {\n const value = computeAriaValue(node);\n return (\n (matcher.min === undefined || matcher.min === value?.min) &&\n (matcher.max === undefined || matcher.max === value?.max) &&\n (matcher.now === undefined || matcher.now === value?.now) &&\n (matcher.text === undefined || matchStringProp(value?.text, matcher.text))\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AASO,SAASE,uBAAuBA,CACrCC,IAAiB,EACjBC,OAAkC,EACzB;EACT,MAAMC,KAAK,GAAG,IAAAC,+BAAgB,EAACH,IAAI,CAAC;EACpC,OACE,CAACC,OAAO,CAACG,GAAG,KAAKC,SAAS,IAAIJ,OAAO,CAACG,GAAG,KAAKF,KAAK,EAAEE,GAAG,MACvDH,OAAO,CAACK,GAAG,KAAKD,SAAS,IAAIJ,OAAO,CAACK,GAAG,KAAKJ,KAAK,EAAEI,GAAG,CAAC,KACxDL,OAAO,CAACM,GAAG,KAAKF,SAAS,IAAIJ,OAAO,CAACM,GAAG,KAAKL,KAAK,EAAEK,GAAG,CAAC,KACxDN,OAAO,CAACO,IAAI,KAAKH,SAAS,IAAI,IAAAI,gCAAe,EAACP,KAAK,EAAEM,IAAI,EAAEP,OAAO,CAACO,IAAI,CAAC,CAAC;AAE9E","ignoreList":[]}
@@ -1,3 +1,3 @@
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
  export declare function matchAccessibilityLabel(element: HostElement, expectedLabel: TextMatch, options?: TextMatchOptions): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"match-label-text.js","names":["_matches","require","_accessibility","matchAccessibilityLabel","element","expectedLabel","options","matches","computeAriaLabel","normalizer","exact"],"sources":["../../../src/helpers/matchers/match-label-text.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { computeAriaLabel } from '../accessibility';\n\nexport function matchAccessibilityLabel(\n element: HostElement,\n expectedLabel: TextMatch,\n options?: TextMatchOptions,\n) {\n return matches(expectedLabel, computeAriaLabel(element), options?.normalizer, options?.exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,OAAoB,EACpBC,aAAwB,EACxBC,OAA0B,EAC1B;EACA,OAAO,IAAAC,gBAAO,EAACF,aAAa,EAAE,IAAAG,+BAAgB,EAACJ,OAAO,CAAC,EAAEE,OAAO,EAAEG,UAAU,EAAEH,OAAO,EAAEI,KAAK,CAAC;AAC/F","ignoreList":[]}
1
+ {"version":3,"file":"match-label-text.js","names":["_matches","require","_accessibility","matchAccessibilityLabel","element","expectedLabel","options","matches","computeAriaLabel","normalizer","exact"],"sources":["../../../src/helpers/matchers/match-label-text.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { computeAriaLabel } from '../accessibility';\n\nexport function matchAccessibilityLabel(\n element: HostElement,\n expectedLabel: TextMatch,\n options?: TextMatchOptions,\n) {\n return matches(expectedLabel, computeAriaLabel(element), options?.normalizer, options?.exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,OAAoB,EACpBC,aAAwB,EACxBC,OAA0B,EAC1B;EACA,OAAO,IAAAC,gBAAO,EAACF,aAAa,EAAE,IAAAG,+BAAgB,EAACJ,OAAO,CAAC,EAAEE,OAAO,EAAEG,UAAU,EAAEH,OAAO,EAAEI,KAAK,CAAC;AAC/F","ignoreList":[]}
@@ -1,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
  /**
4
4
  * Matches the given node's text content against string or regex matcher.
@@ -1 +1 @@
1
- {"version":3,"file":"match-text-content.js","names":["_matches","require","_textContent","matchTextContent","node","text","options","textContent","getTextContent","exact","normalizer","matches"],"sources":["../../../src/helpers/matchers/match-text-content.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { getTextContent } from '../text-content';\n\n/**\n * Matches the given node's text content against string or regex matcher.\n *\n * @param node - Node which text content will be matched\n * @param text - The string or regex to match.\n * @returns - Whether the node's text content matches the given string or regex.\n */\nexport function matchTextContent(\n node: HostElement,\n text: TextMatch,\n options: TextMatchOptions = {},\n) {\n const textContent = getTextContent(node);\n const { exact, normalizer } = options;\n return matches(text, textContent, normalizer, exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAC9BC,IAAiB,EACjBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,EAC9B;EACA,MAAMC,WAAW,GAAG,IAAAC,2BAAc,EAACJ,IAAI,CAAC;EACxC,MAAM;IAAEK,KAAK;IAAEC;EAAW,CAAC,GAAGJ,OAAO;EACrC,OAAO,IAAAK,gBAAO,EAACN,IAAI,EAAEE,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACtD","ignoreList":[]}
1
+ {"version":3,"file":"match-text-content.js","names":["_matches","require","_textContent","matchTextContent","node","text","options","textContent","getTextContent","exact","normalizer","matches"],"sources":["../../../src/helpers/matchers/match-text-content.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport type { TextMatch, TextMatchOptions } from '../../matches';\nimport { matches } from '../../matches';\nimport { getTextContent } from '../text-content';\n\n/**\n * Matches the given node's text content against string or regex matcher.\n *\n * @param node - Node which text content will be matched\n * @param text - The string or regex to match.\n * @returns - Whether the node's text content matches the given string or regex.\n */\nexport function matchTextContent(\n node: HostElement,\n text: TextMatch,\n options: TextMatchOptions = {},\n) {\n const textContent = getTextContent(node);\n const { exact, normalizer } = options;\n return matches(text, textContent, normalizer, exact);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAC9BC,IAAiB,EACjBC,IAAe,EACfC,OAAyB,GAAG,CAAC,CAAC,EAC9B;EACA,MAAMC,WAAW,GAAG,IAAAC,2BAAc,EAACJ,IAAI,CAAC;EACxC,MAAM;IAAEK,KAAK;IAAEC;EAAW,CAAC,GAAGJ,OAAO;EACrC,OAAO,IAAAK,gBAAO,EAACN,IAAI,EAAEE,WAAW,EAAEG,UAAU,EAAED,KAAK,CAAC;AACtD","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  /**
3
3
  * pointerEvents controls whether the View can be the target of touch events.
4
4
  * 'auto': The View and its children can be the target of touch events.
@@ -1 +1 @@
1
- {"version":3,"file":"pointer-events.js","names":["_reactNative","require","isPointerEventEnabled","element","isParent","pointerEvents","props","StyleSheet","flatten","style","parentCondition","parent","exports"],"sources":["../../src/helpers/pointer-events.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport type { HostElement } from 'universal-test-renderer';\n\n/**\n * pointerEvents controls whether the View can be the target of touch events.\n * 'auto': The View and its children can be the target of touch events.\n * 'none': The View is never the target of touch events.\n * 'box-none': The View is never the target of touch events but its subviews can be\n * 'box-only': The view can be the target of touch events but its subviews cannot be\n * see the official react native doc https://reactnative.dev/docs/view#pointerevents */\nexport const isPointerEventEnabled = (element: HostElement, isParent?: boolean): boolean => {\n // Check both props.pointerEvents and props.style.pointerEvents\n const pointerEvents =\n element?.props.pointerEvents ?? StyleSheet.flatten(element?.props.style)?.pointerEvents;\n\n const parentCondition = isParent ? pointerEvents === 'box-only' : pointerEvents === 'box-none';\n\n if (pointerEvents === 'none' || parentCondition) {\n return false;\n }\n\n if (!element.parent) {\n return true;\n }\n\n return isPointerEventEnabled(element.parent, true);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAGA,CAACC,OAAoB,EAAEC,QAAkB,KAAc;EAC1F;EACA,MAAMC,aAAa,GACjBF,OAAO,EAAEG,KAAK,CAACD,aAAa,IAAIE,uBAAU,CAACC,OAAO,CAACL,OAAO,EAAEG,KAAK,CAACG,KAAK,CAAC,EAAEJ,aAAa;EAEzF,MAAMK,eAAe,GAAGN,QAAQ,GAAGC,aAAa,KAAK,UAAU,GAAGA,aAAa,KAAK,UAAU;EAE9F,IAAIA,aAAa,KAAK,MAAM,IAAIK,eAAe,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,IAAI,CAACP,OAAO,CAACQ,MAAM,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAOT,qBAAqB,CAACC,OAAO,CAACQ,MAAM,EAAE,IAAI,CAAC;AACpD,CAAC;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"pointer-events.js","names":["_reactNative","require","isPointerEventEnabled","element","isParent","pointerEvents","props","StyleSheet","flatten","style","parentCondition","parent","exports"],"sources":["../../src/helpers/pointer-events.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport type { HostElement } from 'test-renderer';\n\n/**\n * pointerEvents controls whether the View can be the target of touch events.\n * 'auto': The View and its children can be the target of touch events.\n * 'none': The View is never the target of touch events.\n * 'box-none': The View is never the target of touch events but its subviews can be\n * 'box-only': The view can be the target of touch events but its subviews cannot be\n * see the official react native doc https://reactnative.dev/docs/view#pointerevents */\nexport const isPointerEventEnabled = (element: HostElement, isParent?: boolean): boolean => {\n // Check both props.pointerEvents and props.style.pointerEvents\n const pointerEvents =\n element?.props.pointerEvents ?? StyleSheet.flatten(element?.props.style)?.pointerEvents;\n\n const parentCondition = isParent ? pointerEvents === 'box-only' : pointerEvents === 'box-none';\n\n if (pointerEvents === 'none' || parentCondition) {\n return false;\n }\n\n if (!element.parent) {\n return true;\n }\n\n return isPointerEventEnabled(element.parent, true);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAGA,CAACC,OAAoB,EAAEC,QAAkB,KAAc;EAC1F;EACA,MAAMC,aAAa,GACjBF,OAAO,EAAEG,KAAK,CAACD,aAAa,IAAIE,uBAAU,CAACC,OAAO,CAACL,OAAO,EAAEG,KAAK,CAACG,KAAK,CAAC,EAAEJ,aAAa;EAEzF,MAAMK,eAAe,GAAGN,QAAQ,GAAGC,aAAa,KAAK,UAAU,GAAGA,aAAa,KAAK,UAAU;EAE9F,IAAIA,aAAa,KAAK,MAAM,IAAIK,eAAe,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,IAAI,CAACP,OAAO,CAACQ,MAAM,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAOT,qBAAqB,CAACC,OAAO,CAACQ,MAAM,EAAE,IAAI,CAAC;AACpD,CAAC;AAACC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function getTextContent(element: HostElement | string | null): string;
@@ -1 +1 @@
1
- {"version":3,"file":"text-content.js","names":["getTextContent","element","result","children","forEach","child","push","join"],"sources":["../../src/helpers/text-content.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nexport function getTextContent(element: HostElement | string | null): string {\n if (!element) {\n return '';\n }\n\n if (typeof element === 'string') {\n return element;\n }\n\n const result: string[] = [];\n element.children?.forEach((child) => {\n result.push(getTextContent(child));\n });\n\n return result.join('');\n}\n"],"mappings":";;;;;;AAEO,SAASA,cAAcA,CAACC,OAAoC,EAAU;EAC3E,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,EAAE;EACX;EAEA,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAMC,MAAgB,GAAG,EAAE;EAC3BD,OAAO,CAACE,QAAQ,EAAEC,OAAO,CAAEC,KAAK,IAAK;IACnCH,MAAM,CAACI,IAAI,CAACN,cAAc,CAACK,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACK,IAAI,CAAC,EAAE,CAAC;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"text-content.js","names":["getTextContent","element","result","children","forEach","child","push","join"],"sources":["../../src/helpers/text-content.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nexport function getTextContent(element: HostElement | string | null): string {\n if (!element) {\n return '';\n }\n\n if (typeof element === 'string') {\n return element;\n }\n\n const result: string[] = [];\n element.children?.forEach((child) => {\n result.push(getTextContent(child));\n });\n\n return result.join('');\n}\n"],"mappings":";;;;;;AAEO,SAASA,cAAcA,CAACC,OAAoC,EAAU;EAC3E,IAAI,CAACA,OAAO,EAAE;IACZ,OAAO,EAAE;EACX;EAEA,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAMC,MAAgB,GAAG,EAAE;EAC3BD,OAAO,CAACE,QAAQ,EAAEC,OAAO,CAAEC,KAAK,IAAK;IACnCH,MAAM,CAACI,IAAI,CAACN,cAAc,CAACK,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACK,IAAI,CAAC,EAAE,CAAC;AACxB","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function isEditableTextInput(element: HostElement): boolean;
3
3
  export declare function getTextInputValue(element: HostElement): any;
@@ -1 +1 @@
1
- {"version":3,"file":"text-input.js","names":["_nativeState","require","_hostComponentNames","isEditableTextInput","element","isHostTextInput","props","editable","getTextInputValue","Error","type","value","nativeState","valueForElement","get","defaultValue"],"sources":["../../src/helpers/text-input.ts"],"sourcesContent":["import type { HostElement } from 'universal-test-renderer';\n\nimport { nativeState } from '../native-state';\nimport { isHostTextInput } from './host-component-names';\n\nexport function isEditableTextInput(element: HostElement) {\n return isHostTextInput(element) && element.props.editable !== false;\n}\n\nexport function getTextInputValue(element: HostElement) {\n if (!isHostTextInput(element)) {\n throw new Error(`Element is not a \"TextInput\", but it has type \"${element.type}\".`);\n }\n\n return (\n element.props.value ??\n nativeState.valueForElement.get(element) ??\n element.props.defaultValue ??\n ''\n );\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAACC,OAAoB,EAAE;EACxD,OAAO,IAAAC,mCAAe,EAACD,OAAO,CAAC,IAAIA,OAAO,CAACE,KAAK,CAACC,QAAQ,KAAK,KAAK;AACrE;AAEO,SAASC,iBAAiBA,CAACJ,OAAoB,EAAE;EACtD,IAAI,CAAC,IAAAC,mCAAe,EAACD,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIK,KAAK,CAAC,kDAAkDL,OAAO,CAACM,IAAI,IAAI,CAAC;EACrF;EAEA,OACEN,OAAO,CAACE,KAAK,CAACK,KAAK,IACnBC,wBAAW,CAACC,eAAe,CAACC,GAAG,CAACV,OAAO,CAAC,IACxCA,OAAO,CAACE,KAAK,CAACS,YAAY,IAC1B,EAAE;AAEN","ignoreList":[]}
1
+ {"version":3,"file":"text-input.js","names":["_nativeState","require","_hostComponentNames","isEditableTextInput","element","isHostTextInput","props","editable","getTextInputValue","Error","type","value","nativeState","valueForElement","get","defaultValue"],"sources":["../../src/helpers/text-input.ts"],"sourcesContent":["import type { HostElement } from 'test-renderer';\n\nimport { nativeState } from '../native-state';\nimport { isHostTextInput } from './host-component-names';\n\nexport function isEditableTextInput(element: HostElement) {\n return isHostTextInput(element) && element.props.editable !== false;\n}\n\nexport function getTextInputValue(element: HostElement) {\n if (!isHostTextInput(element)) {\n throw new Error(`Element is not a \"TextInput\", but it has type \"${element.type}\".`);\n }\n\n return (\n element.props.value ??\n nativeState.valueForElement.get(element) ??\n element.props.defaultValue ??\n ''\n );\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAACC,OAAoB,EAAE;EACxD,OAAO,IAAAC,mCAAe,EAACD,OAAO,CAAC,IAAIA,OAAO,CAACE,KAAK,CAACC,QAAQ,KAAK,KAAK;AACrE;AAEO,SAASC,iBAAiBA,CAACJ,OAAoB,EAAE;EACtD,IAAI,CAAC,IAAAC,mCAAe,EAACD,OAAO,CAAC,EAAE;IAC7B,MAAM,IAAIK,KAAK,CAAC,kDAAkDL,OAAO,CAACM,IAAI,IAAI,CAAC;EACrF;EAEA,OACEN,OAAO,CAACE,KAAK,CAACK,KAAK,IACnBC,wBAAW,CAACC,eAAe,CAACC,GAAG,CAACV,OAAO,CAAC,IACxCA,OAAO,CAACE,KAAK,CAACS,YAAY,IAC1B,EAAE;AAEN","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Validates that no unknown options are passed to a function.
3
+ * Logs a warning if unknown options are found.
4
+ *
5
+ * @param functionName - The name of the function being called (for error messages)
6
+ * @param restOptions - The rest object from destructuring that contains unknown options
7
+ * @param callsite - The function where the validation is called from (e.g., render, renderHook)
8
+ */
9
+ export declare function validateOptions(functionName: string, restOptions: Record<string, unknown>, callsite: Function): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateOptions = validateOptions;
7
+ var _errors = require("./errors");
8
+ var _logger = require("./logger");
9
+ /**
10
+ * Validates that no unknown options are passed to a function.
11
+ * Logs a warning if unknown options are found.
12
+ *
13
+ * @param functionName - The name of the function being called (for error messages)
14
+ * @param restOptions - The rest object from destructuring that contains unknown options
15
+ * @param callsite - The function where the validation is called from (e.g., render, renderHook)
16
+ */
17
+ function validateOptions(functionName, restOptions,
18
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
19
+ callsite) {
20
+ const unknownKeys = Object.keys(restOptions);
21
+ if (unknownKeys.length > 0) {
22
+ // Pass the callsite function (e.g., render) to remove it from stack
23
+ // This leaves only where the user called the function from (e.g., test file)
24
+ const stackTraceError = new _errors.ErrorWithStack('STACK_TRACE_ERROR', callsite);
25
+ const stackLines = stackTraceError.stack ? stackTraceError.stack.split('\n') : [];
26
+ // Skip the first line (Error: STACK_TRACE_ERROR) to show the actual call sites
27
+ // The remaining lines show where the user called the function from
28
+ const stackTrace = stackLines.length > 1 ? `\n\n${stackLines.slice(1).join('\n')}` : '';
29
+ _logger.logger.warn(`Unknown option(s) passed to ${functionName}: ${unknownKeys.join(', ')}${stackTrace}`);
30
+ }
31
+ }
32
+ //# sourceMappingURL=validate-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-options.js","names":["_errors","require","_logger","validateOptions","functionName","restOptions","callsite","unknownKeys","Object","keys","length","stackTraceError","ErrorWithStack","stackLines","stack","split","stackTrace","slice","join","logger","warn"],"sources":["../../src/helpers/validate-options.ts"],"sourcesContent":["import { ErrorWithStack } from './errors';\nimport { logger } from './logger';\n\n/**\n * Validates that no unknown options are passed to a function.\n * Logs a warning if unknown options are found.\n *\n * @param functionName - The name of the function being called (for error messages)\n * @param restOptions - The rest object from destructuring that contains unknown options\n * @param callsite - The function where the validation is called from (e.g., render, renderHook)\n */\nexport function validateOptions(\n functionName: string,\n restOptions: Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n callsite: Function,\n): void {\n const unknownKeys = Object.keys(restOptions);\n if (unknownKeys.length > 0) {\n // Pass the callsite function (e.g., render) to remove it from stack\n // This leaves only where the user called the function from (e.g., test file)\n const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', callsite);\n const stackLines = stackTraceError.stack ? stackTraceError.stack.split('\\n') : [];\n // Skip the first line (Error: STACK_TRACE_ERROR) to show the actual call sites\n // The remaining lines show where the user called the function from\n const stackTrace = stackLines.length > 1 ? `\\n\\n${stackLines.slice(1).join('\\n')}` : '';\n logger.warn(\n `Unknown option(s) passed to ${functionName}: ${unknownKeys.join(', ')}${stackTrace}`,\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAC7BC,YAAoB,EACpBC,WAAoC;AACpC;AACAC,QAAkB,EACZ;EACN,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACJ,WAAW,CAAC;EAC5C,IAAIE,WAAW,CAACG,MAAM,GAAG,CAAC,EAAE;IAC1B;IACA;IACA,MAAMC,eAAe,GAAG,IAAIC,sBAAc,CAAC,mBAAmB,EAAEN,QAAQ,CAAC;IACzE,MAAMO,UAAU,GAAGF,eAAe,CAACG,KAAK,GAAGH,eAAe,CAACG,KAAK,CAACC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;IACjF;IACA;IACA,MAAMC,UAAU,GAAGH,UAAU,CAACH,MAAM,GAAG,CAAC,GAAG,OAAOG,UAAU,CAACI,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE;IACvFC,cAAM,CAACC,IAAI,CACT,+BAA+BhB,YAAY,KAAKG,WAAW,CAACW,IAAI,CAAC,IAAI,CAAC,GAAGF,UAAU,EACrF,CAAC;EACH;AACF","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeBusy(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-busy.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeBusy","element","checkHostElement","pass","computeAriaBusy","message","matcher","matcherHint","isNot","redent","formatElement","join"],"sources":["../../src/matchers/to-be-busy.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaBusy } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeBusy(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeBusy, this);\n\n return {\n pass: computeAriaBusy(element),\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeBusy`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}busy:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,QAAQA,CAA4BC,OAAoB,EAAE;EACxE,IAAAC,uBAAgB,EAACD,OAAO,EAAED,QAAQ,EAAE,IAAI,CAAC;EAEzC,OAAO;IACLG,IAAI,EAAE,IAAAC,8BAAe,EAACH,OAAO,CAAC;IAC9BI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC;MAClF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,OAAO,EACtD,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-busy.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeBusy","element","checkHostElement","pass","computeAriaBusy","message","matcher","matcherHint","isNot","redent","formatElement","join"],"sources":["../../src/matchers/to-be-busy.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaBusy } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeBusy(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeBusy, this);\n\n return {\n pass: computeAriaBusy(element),\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeBusy`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}busy:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,QAAQA,CAA4BC,OAAoB,EAAE;EACxE,IAAAC,uBAAgB,EAACD,OAAO,EAAED,QAAQ,EAAE,IAAI,CAAC;EAEzC,OAAO;IACLG,IAAI,EAAE,IAAAC,8BAAe,EAACH,OAAO,CAAC;IAC9BI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC;MAClF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,OAAO,EACtD,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeChecked(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-checked.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_errors","_formatElement","_hostComponentNames","_utils","e","__esModule","default","toBeChecked","element","checkHostElement","isHostSwitch","isSupportedAccessibilityElement","ErrorWithStack","pass","computeAriaChecked","message","is","isNot","matcherHint","redent","formatElement","join","isAccessibilityElement","role","getRole","rolesSupportingCheckedState"],"sources":["../../src/matchers/to-be-checked.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport {\n computeAriaChecked,\n getRole,\n isAccessibilityElement,\n rolesSupportingCheckedState,\n} from '../helpers/accessibility';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatElement } from '../helpers/format-element';\nimport { isHostSwitch } from '../helpers/host-component-names';\nimport { checkHostElement } from './utils';\n\nexport function toBeChecked(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeChecked, this);\n\n if (!isHostSwitch(element) && !isSupportedAccessibilityElement(element)) {\n throw new ErrorWithStack(\n `toBeChecked() works only on host \"Switch\" elements or accessibility elements with \"checkbox\", \"radio\" or \"switch\" role.`,\n toBeChecked,\n );\n }\n\n return {\n pass: computeAriaChecked(element) === true,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeChecked`, 'element', ''),\n '',\n `Received element ${is} checked:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isSupportedAccessibilityElement(element: HostElement) {\n if (!isAccessibilityElement(element)) {\n return false;\n }\n\n const role = getRole(element);\n return rolesSupportingCheckedState[role];\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA2C,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,WAAWA,CAA4BC,OAAoB,EAAE;EAC3E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,WAAW,EAAE,IAAI,CAAC;EAE5C,IAAI,CAAC,IAAAG,gCAAY,EAACF,OAAO,CAAC,IAAI,CAACG,+BAA+B,CAACH,OAAO,CAAC,EAAE;IACvE,MAAM,IAAII,sBAAc,CACtB,yHAAyH,EACzHL,WACF,CAAC;EACH;EAEA,OAAO;IACLM,IAAI,EAAE,IAAAC,iCAAkB,EAACN,OAAO,CAAC,KAAK,IAAI;IAC1CO,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACZ,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASV,+BAA+BA,CAACH,OAAoB,EAAE;EAC7D,IAAI,CAAC,IAAAc,qCAAsB,EAACd,OAAO,CAAC,EAAE;IACpC,OAAO,KAAK;EACd;EAEA,MAAMe,IAAI,GAAG,IAAAC,sBAAO,EAAChB,OAAO,CAAC;EAC7B,OAAOiB,0CAA2B,CAACF,IAAI,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"file":"to-be-checked.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_errors","_formatElement","_hostComponentNames","_utils","e","__esModule","default","toBeChecked","element","checkHostElement","isHostSwitch","isSupportedAccessibilityElement","ErrorWithStack","pass","computeAriaChecked","message","is","isNot","matcherHint","redent","formatElement","join","isAccessibilityElement","role","getRole","rolesSupportingCheckedState"],"sources":["../../src/matchers/to-be-checked.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport {\n computeAriaChecked,\n getRole,\n isAccessibilityElement,\n rolesSupportingCheckedState,\n} from '../helpers/accessibility';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatElement } from '../helpers/format-element';\nimport { isHostSwitch } from '../helpers/host-component-names';\nimport { checkHostElement } from './utils';\n\nexport function toBeChecked(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeChecked, this);\n\n if (!isHostSwitch(element) && !isSupportedAccessibilityElement(element)) {\n throw new ErrorWithStack(\n `toBeChecked() works only on host \"Switch\" elements or accessibility elements with \"checkbox\", \"radio\" or \"switch\" role.`,\n toBeChecked,\n );\n }\n\n return {\n pass: computeAriaChecked(element) === true,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeChecked`, 'element', ''),\n '',\n `Received element ${is} checked:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isSupportedAccessibilityElement(element: HostElement) {\n if (!isAccessibilityElement(element)) {\n return false;\n }\n\n const role = getRole(element);\n return rolesSupportingCheckedState[role];\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA2C,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,WAAWA,CAA4BC,OAAoB,EAAE;EAC3E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,WAAW,EAAE,IAAI,CAAC;EAE5C,IAAI,CAAC,IAAAG,gCAAY,EAACF,OAAO,CAAC,IAAI,CAACG,+BAA+B,CAACH,OAAO,CAAC,EAAE;IACvE,MAAM,IAAII,sBAAc,CACtB,yHAAyH,EACzHL,WACF,CAAC;EACH;EAEA,OAAO;IACLM,IAAI,EAAE,IAAAC,iCAAkB,EAACN,OAAO,CAAC,KAAK,IAAI;IAC1CO,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACZ,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASV,+BAA+BA,CAACH,OAAoB,EAAE;EAC7D,IAAI,CAAC,IAAAc,qCAAsB,EAACd,OAAO,CAAC,EAAE;IACpC,OAAO,KAAK;EACd;EAEA,MAAMe,IAAI,GAAG,IAAAC,sBAAO,EAAChB,OAAO,CAAC;EAC7B,OAAOiB,0CAA2B,CAACF,IAAI,CAAC;AAC1C","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeDisabled(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-disabled.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeDisabled","element","checkHostElement","isDisabled","computeAriaDisabled","isAncestorDisabled","pass","message","is","isNot","matcherHint","redent","formatElement","join","toBeEnabled","isEnabled","parent"],"sources":["../../src/matchers/to-be-disabled.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaDisabled } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeDisabled(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeDisabled, this);\n\n const isDisabled = computeAriaDisabled(element) || isAncestorDisabled(element);\n\n return {\n pass: isDisabled,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeDisabled`, 'element', ''),\n '',\n `Received element ${is} disabled:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nexport function toBeEnabled(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeEnabled, this);\n\n const isEnabled = !computeAriaDisabled(element) && !isAncestorDisabled(element);\n\n return {\n pass: isEnabled,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeEnabled`, 'element', ''),\n '',\n `Received element ${is} enabled:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isAncestorDisabled(element: HostElement): boolean {\n const parent = element.parent;\n if (parent == null) {\n return false;\n }\n\n return computeAriaDisabled(parent) || isAncestorDisabled(parent);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,MAAMG,UAAU,GAAG,IAAAC,kCAAmB,EAACH,OAAO,CAAC,IAAII,kBAAkB,CAACJ,OAAO,CAAC;EAE9E,OAAO;IACLK,IAAI,EAAEH,UAAU;IAChBI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC,EACtE,EAAE,EACF,oBAAoBD,EAAE,YAAY,EAClC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEO,SAASC,WAAWA,CAA4Bb,OAAoB,EAAE;EAC3E,IAAAC,uBAAgB,EAACD,OAAO,EAAEa,WAAW,EAAE,IAAI,CAAC;EAE5C,MAAMC,SAAS,GAAG,CAAC,IAAAX,kCAAmB,EAACH,OAAO,CAAC,IAAI,CAACI,kBAAkB,CAACJ,OAAO,CAAC;EAE/E,OAAO;IACLK,IAAI,EAAES,SAAS;IACfR,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASR,kBAAkBA,CAACJ,OAAoB,EAAW;EACzD,MAAMe,MAAM,GAAGf,OAAO,CAACe,MAAM;EAC7B,IAAIA,MAAM,IAAI,IAAI,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,OAAO,IAAAZ,kCAAmB,EAACY,MAAM,CAAC,IAAIX,kBAAkB,CAACW,MAAM,CAAC;AAClE","ignoreList":[]}
1
+ {"version":3,"file":"to-be-disabled.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeDisabled","element","checkHostElement","isDisabled","computeAriaDisabled","isAncestorDisabled","pass","message","is","isNot","matcherHint","redent","formatElement","join","toBeEnabled","isEnabled","parent"],"sources":["../../src/matchers/to-be-disabled.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaDisabled } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeDisabled(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeDisabled, this);\n\n const isDisabled = computeAriaDisabled(element) || isAncestorDisabled(element);\n\n return {\n pass: isDisabled,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeDisabled`, 'element', ''),\n '',\n `Received element ${is} disabled:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nexport function toBeEnabled(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeEnabled, this);\n\n const isEnabled = !computeAriaDisabled(element) && !isAncestorDisabled(element);\n\n return {\n pass: isEnabled,\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeEnabled`, 'element', ''),\n '',\n `Received element ${is} enabled:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isAncestorDisabled(element: HostElement): boolean {\n const parent = element.parent;\n if (parent == null) {\n return false;\n }\n\n return computeAriaDisabled(parent) || isAncestorDisabled(parent);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,MAAMG,UAAU,GAAG,IAAAC,kCAAmB,EAACH,OAAO,CAAC,IAAII,kBAAkB,CAACJ,OAAO,CAAC;EAE9E,OAAO;IACLK,IAAI,EAAEH,UAAU;IAChBI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC,EACtE,EAAE,EACF,oBAAoBD,EAAE,YAAY,EAClC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEO,SAASC,WAAWA,CAA4Bb,OAAoB,EAAE;EAC3E,IAAAC,uBAAgB,EAACD,OAAO,EAAEa,WAAW,EAAE,IAAI,CAAC;EAE5C,MAAMC,SAAS,GAAG,CAAC,IAAAX,kCAAmB,EAACH,OAAO,CAAC,IAAI,CAACI,kBAAkB,CAACJ,OAAO,CAAC;EAE/E,OAAO;IACLK,IAAI,EAAES,SAAS;IACfR,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASR,kBAAkBA,CAACJ,OAAoB,EAAW;EACzD,MAAMe,MAAM,GAAGf,OAAO,CAACe,MAAM;EAC7B,IAAIA,MAAM,IAAI,IAAI,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,OAAO,IAAAZ,kCAAmB,EAACY,MAAM,CAAC,IAAIX,kBAAkB,CAACW,MAAM,CAAC;AAClE","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeEmptyElement(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-empty-element.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","_formatElement","_utils","e","__esModule","default","toBeEmptyElement","element","checkHostElement","children","filter","child","isHostElement","pass","length","message","matcherHint","isNot","RECEIVED_COLOR","redent","formatElementList","join"],"sources":["../../src/matchers/to-be-empty-element.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { isHostElement } from '../helpers/component-tree';\nimport { formatElementList } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeEmptyElement(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeEmptyElement, this);\n\n // TODO check\n const children = element.children.filter((child) => isHostElement(child));\n\n return {\n pass: children.length === 0,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeEmptyElement`, 'element', ''),\n '',\n 'Received:',\n `${RECEIVED_COLOR(redent(formatElementList(children), 2))}`,\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,gBAAgBA,CAA4BC,OAAoB,EAAE;EAChF,IAAAC,uBAAgB,EAACD,OAAO,EAAED,gBAAgB,EAAE,IAAI,CAAC;;EAEjD;EACA,MAAMG,QAAQ,GAAGF,OAAO,CAACE,QAAQ,CAACC,MAAM,CAAEC,KAAK,IAAK,IAAAC,4BAAa,EAACD,KAAK,CAAC,CAAC;EAEzE,OAAO;IACLE,IAAI,EAAEJ,QAAQ,CAACK,MAAM,KAAK,CAAC;IAC3BC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC1E,EAAE,EACF,WAAW,EACX,GAAG,IAAAC,gCAAc,EAAC,IAAAC,eAAM,EAAC,IAAAC,gCAAiB,EAACX,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC5D,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-empty-element.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","_formatElement","_utils","e","__esModule","default","toBeEmptyElement","element","checkHostElement","children","filter","child","isHostElement","pass","length","message","matcherHint","isNot","RECEIVED_COLOR","redent","formatElementList","join"],"sources":["../../src/matchers/to-be-empty-element.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { isHostElement } from '../helpers/component-tree';\nimport { formatElementList } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeEmptyElement(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeEmptyElement, this);\n\n // TODO check\n const children = element.children.filter((child) => isHostElement(child));\n\n return {\n pass: children.length === 0,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeEmptyElement`, 'element', ''),\n '',\n 'Received:',\n `${RECEIVED_COLOR(redent(formatElementList(children), 2))}`,\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,gBAAgBA,CAA4BC,OAAoB,EAAE;EAChF,IAAAC,uBAAgB,EAACD,OAAO,EAAED,gBAAgB,EAAE,IAAI,CAAC;;EAEjD;EACA,MAAMG,QAAQ,GAAGF,OAAO,CAACE,QAAQ,CAACC,MAAM,CAAEC,KAAK,IAAK,IAAAC,4BAAa,EAACD,KAAK,CAAC,CAAC;EAEzE,OAAO;IACLE,IAAI,EAAEJ,QAAQ,CAACK,MAAM,KAAK,CAAC;IAC3BC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC1E,EAAE,EACF,WAAW,EACX,GAAG,IAAAC,gCAAc,EAAC,IAAAC,eAAM,EAAC,IAAAC,gCAAiB,EAACX,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC5D,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeExpanded(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-expanded.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeExpanded","element","checkHostElement","pass","computeAriaExpanded","message","matcher","matcherHint","isNot","redent","formatElement","join","toBeCollapsed"],"sources":["../../src/matchers/to-be-expanded.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaExpanded } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeExpanded(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeExpanded, this);\n\n return {\n pass: computeAriaExpanded(element) === true,\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeExpanded`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}expanded:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nexport function toBeCollapsed(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeCollapsed, this);\n\n return {\n pass: computeAriaExpanded(element) === false,\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeCollapsed`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}collapsed:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,OAAO;IACLG,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC,KAAK,IAAI;IAC3CI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC;MACtF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,WAAW,EAC1D,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEO,SAASC,aAAaA,CAA4BX,OAAoB,EAAE;EAC7E,IAAAC,uBAAgB,EAACD,OAAO,EAAEW,aAAa,EAAE,IAAI,CAAC;EAE9C,OAAO;IACLT,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC,KAAK,KAAK;IAC5CI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,CAAC;MACvF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,YAAY,EAC3D,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-expanded.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeExpanded","element","checkHostElement","pass","computeAriaExpanded","message","matcher","matcherHint","isNot","redent","formatElement","join","toBeCollapsed"],"sources":["../../src/matchers/to-be-expanded.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaExpanded } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeExpanded(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeExpanded, this);\n\n return {\n pass: computeAriaExpanded(element) === true,\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeExpanded`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}expanded:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nexport function toBeCollapsed(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeCollapsed, this);\n\n return {\n pass: computeAriaExpanded(element) === false,\n message: () => {\n const matcher = matcherHint(`${this.isNot ? '.not' : ''}.toBeCollapsed`, 'element', '');\n return [\n matcher,\n '',\n `Received element is ${this.isNot ? '' : 'not '}collapsed:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,OAAO;IACLG,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC,KAAK,IAAI;IAC3CI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC;MACtF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,WAAW,EAC1D,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEO,SAASC,aAAaA,CAA4BX,OAAoB,EAAE;EAC7E,IAAAC,uBAAgB,EAACD,OAAO,EAAEW,aAAa,EAAE,IAAI,CAAC;EAE9C,OAAO;IACLT,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC,KAAK,KAAK;IAC5CI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,CAAC;MACvF,OAAO,CACLF,OAAO,EACP,EAAE,EACF,uBAAuB,IAAI,CAACE,KAAK,GAAG,EAAE,GAAG,MAAM,YAAY,EAC3D,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeOnTheScreen(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-on-the-screen.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","_formatElement","_screen","_utils","e","__esModule","default","toBeOnTheScreen","element","isNot","checkHostElement","pass","screen","container","getContainerElement","errorFound","redent","formatElement","errorNotFound","message","matcherHint","RECEIVED_COLOR","join"],"sources":["../../src/matchers/to-be-on-the-screen.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { getContainerElement } from '../helpers/component-tree';\nimport { formatElement } from '../helpers/format-element';\nimport { screen } from '../screen';\nimport { checkHostElement } from './utils';\n\nexport function toBeOnTheScreen(this: jest.MatcherContext, element: HostElement) {\n if (element !== null || !this.isNot) {\n checkHostElement(element, toBeOnTheScreen, this);\n }\n\n const pass = element === null ? false : screen.container === getContainerElement(element);\n\n const errorFound = () => {\n return `expected element tree not to contain element, but found\\n${redent(\n formatElement(element),\n 2,\n )}`;\n };\n\n const errorNotFound = () => {\n return `element could not be found in the element tree`;\n };\n\n return {\n pass,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeOnTheScreen`, 'element', ''),\n '',\n RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound()),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,eAAeA,CAA4BC,OAAoB,EAAE;EAC/E,IAAIA,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;IACnC,IAAAC,uBAAgB,EAACF,OAAO,EAAED,eAAe,EAAE,IAAI,CAAC;EAClD;EAEA,MAAMI,IAAI,GAAGH,OAAO,KAAK,IAAI,GAAG,KAAK,GAAGI,cAAM,CAACC,SAAS,KAAK,IAAAC,kCAAmB,EAACN,OAAO,CAAC;EAEzF,MAAMO,UAAU,GAAGA,CAAA,KAAM;IACvB,OAAO,4DAA4D,IAAAC,eAAM,EACvE,IAAAC,4BAAa,EAACT,OAAO,CAAC,EACtB,CACF,CAAC,EAAE;EACL,CAAC;EAED,MAAMU,aAAa,GAAGA,CAAA,KAAM;IAC1B,OAAO,gDAAgD;EACzD,CAAC;EAED,OAAO;IACLP,IAAI;IACJQ,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACX,KAAK,GAAG,MAAM,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,CAAC,EACzE,EAAE,EACF,IAAAY,gCAAc,EAAC,IAAI,CAACZ,KAAK,GAAGM,UAAU,CAAC,CAAC,GAAGG,aAAa,CAAC,CAAC,CAAC,CAC5D,CAACI,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-on-the-screen.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_componentTree","_formatElement","_screen","_utils","e","__esModule","default","toBeOnTheScreen","element","isNot","checkHostElement","pass","screen","container","getContainerElement","errorFound","redent","formatElement","errorNotFound","message","matcherHint","RECEIVED_COLOR","join"],"sources":["../../src/matchers/to-be-on-the-screen.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { getContainerElement } from '../helpers/component-tree';\nimport { formatElement } from '../helpers/format-element';\nimport { screen } from '../screen';\nimport { checkHostElement } from './utils';\n\nexport function toBeOnTheScreen(this: jest.MatcherContext, element: HostElement) {\n if (element !== null || !this.isNot) {\n checkHostElement(element, toBeOnTheScreen, this);\n }\n\n const pass = element === null ? false : screen.container === getContainerElement(element);\n\n const errorFound = () => {\n return `expected element tree not to contain element, but found\\n${redent(\n formatElement(element),\n 2,\n )}`;\n };\n\n const errorNotFound = () => {\n return `element could not be found in the element tree`;\n };\n\n return {\n pass,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeOnTheScreen`, 'element', ''),\n '',\n RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound()),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,eAAeA,CAA4BC,OAAoB,EAAE;EAC/E,IAAIA,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;IACnC,IAAAC,uBAAgB,EAACF,OAAO,EAAED,eAAe,EAAE,IAAI,CAAC;EAClD;EAEA,MAAMI,IAAI,GAAGH,OAAO,KAAK,IAAI,GAAG,KAAK,GAAGI,cAAM,CAACC,SAAS,KAAK,IAAAC,kCAAmB,EAACN,OAAO,CAAC;EAEzF,MAAMO,UAAU,GAAGA,CAAA,KAAM;IACvB,OAAO,4DAA4D,IAAAC,eAAM,EACvE,IAAAC,4BAAa,EAACT,OAAO,CAAC,EACtB,CACF,CAAC,EAAE;EACL,CAAC;EAED,MAAMU,aAAa,GAAGA,CAAA,KAAM;IAC1B,OAAO,gDAAgD;EACzD,CAAC;EAED,OAAO;IACLP,IAAI;IACJQ,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACX,KAAK,GAAG,MAAM,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE,CAAC,EACzE,EAAE,EACF,IAAAY,gCAAc,EAAC,IAAI,CAACZ,KAAK,GAAGM,UAAU,CAAC,CAAC,GAAGG,aAAa,CAAC,CAAC,CAAC,CAC5D,CAACI,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBePartiallyChecked(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-partially-checked.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_errors","_formatElement","_utils","e","__esModule","default","toBePartiallyChecked","element","checkHostElement","hasValidAccessibilityRole","ErrorWithStack","pass","computeAriaChecked","message","is","isNot","matcherHint","redent","formatElement","join","role","getRole","isAccessibilityElement"],"sources":["../../src/matchers/to-be-partially-checked.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaChecked, getRole, isAccessibilityElement } from '../helpers/accessibility';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBePartiallyChecked(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBePartiallyChecked, this);\n\n if (!hasValidAccessibilityRole(element)) {\n throw new ErrorWithStack(\n 'toBePartiallyChecked() works only on accessibility elements with \"checkbox\" role.',\n toBePartiallyChecked,\n );\n }\n\n return {\n pass: computeAriaChecked(element) === 'mixed',\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBePartiallyChecked`, 'element', ''),\n '',\n `Received element ${is} partially checked:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction hasValidAccessibilityRole(element: HostElement) {\n const role = getRole(element);\n return isAccessibilityElement(element) && role === 'checkbox';\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,oBAAoBA,CAA4BC,OAAoB,EAAE;EACpF,IAAAC,uBAAgB,EAACD,OAAO,EAAED,oBAAoB,EAAE,IAAI,CAAC;EAErD,IAAI,CAACG,yBAAyB,CAACF,OAAO,CAAC,EAAE;IACvC,MAAM,IAAIG,sBAAc,CACtB,mFAAmF,EACnFJ,oBACF,CAAC;EACH;EAEA,OAAO;IACLK,IAAI,EAAE,IAAAC,iCAAkB,EAACL,OAAO,CAAC,KAAK,OAAO;IAC7CM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC9E,EAAE,EACF,oBAAoBD,EAAE,qBAAqB,EAC3C,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASV,yBAAyBA,CAACF,OAAoB,EAAE;EACvD,MAAMa,IAAI,GAAG,IAAAC,sBAAO,EAACd,OAAO,CAAC;EAC7B,OAAO,IAAAe,qCAAsB,EAACf,OAAO,CAAC,IAAIa,IAAI,KAAK,UAAU;AAC/D","ignoreList":[]}
1
+ {"version":3,"file":"to-be-partially-checked.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_errors","_formatElement","_utils","e","__esModule","default","toBePartiallyChecked","element","checkHostElement","hasValidAccessibilityRole","ErrorWithStack","pass","computeAriaChecked","message","is","isNot","matcherHint","redent","formatElement","join","role","getRole","isAccessibilityElement"],"sources":["../../src/matchers/to-be-partially-checked.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaChecked, getRole, isAccessibilityElement } from '../helpers/accessibility';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBePartiallyChecked(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBePartiallyChecked, this);\n\n if (!hasValidAccessibilityRole(element)) {\n throw new ErrorWithStack(\n 'toBePartiallyChecked() works only on accessibility elements with \"checkbox\" role.',\n toBePartiallyChecked,\n );\n }\n\n return {\n pass: computeAriaChecked(element) === 'mixed',\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBePartiallyChecked`, 'element', ''),\n '',\n `Received element ${is} partially checked:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction hasValidAccessibilityRole(element: HostElement) {\n const role = getRole(element);\n return isAccessibilityElement(element) && role === 'checkbox';\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,oBAAoBA,CAA4BC,OAAoB,EAAE;EACpF,IAAAC,uBAAgB,EAACD,OAAO,EAAED,oBAAoB,EAAE,IAAI,CAAC;EAErD,IAAI,CAACG,yBAAyB,CAACF,OAAO,CAAC,EAAE;IACvC,MAAM,IAAIG,sBAAc,CACtB,mFAAmF,EACnFJ,oBACF,CAAC;EACH;EAEA,OAAO;IACLK,IAAI,EAAE,IAAAC,iCAAkB,EAACL,OAAO,CAAC,KAAK,OAAO;IAC7CM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC9E,EAAE,EACF,oBAAoBD,EAAE,qBAAqB,EAC3C,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACX,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACY,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASV,yBAAyBA,CAACF,OAAoB,EAAE;EACvD,MAAMa,IAAI,GAAG,IAAAC,sBAAO,EAACd,OAAO,CAAC;EAC7B,OAAO,IAAAe,qCAAsB,EAACf,OAAO,CAAC,IAAIa,IAAI,KAAK,UAAU;AAC/D","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeSelected(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-selected.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeSelected","element","checkHostElement","pass","computeAriaSelected","message","is","isNot","matcherHint","redent","formatElement","join"],"sources":["../../src/matchers/to-be-selected.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaSelected } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeSelected(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeSelected, this);\n\n return {\n pass: computeAriaSelected(element),\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeSelected`, 'element', ''),\n '',\n `Received element ${is} selected`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,OAAO;IACLG,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC;IAClCI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC,EACtE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-be-selected.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_accessibility","_formatElement","_utils","e","__esModule","default","toBeSelected","element","checkHostElement","pass","computeAriaSelected","message","is","isNot","matcherHint","redent","formatElement","join"],"sources":["../../src/matchers/to-be-selected.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaSelected } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toBeSelected(this: jest.MatcherContext, element: HostElement) {\n checkHostElement(element, toBeSelected, this);\n\n return {\n pass: computeAriaSelected(element),\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeSelected`, 'element', ''),\n '',\n `Received element ${is} selected`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA2C,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,YAAYA,CAA4BC,OAAoB,EAAE;EAC5E,IAAAC,uBAAgB,EAACD,OAAO,EAAED,YAAY,EAAE,IAAI,CAAC;EAE7C,OAAO;IACLG,IAAI,EAAE,IAAAC,kCAAmB,EAACH,OAAO,CAAC;IAClCI,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACC,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACD,KAAK,GAAG,MAAM,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,CAAC,EACtE,EAAE,EACF,oBAAoBD,EAAE,WAAW,EACjC,IAAAG,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toBeVisible(this: jest.MatcherContext, element: HostElement): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-be-visible.js","names":["_reactNative","require","_jestMatcherUtils","_redent","_interopRequireDefault","_accessibility","_formatElement","_hostComponentNames","_utils","e","__esModule","default","toBeVisible","element","isNot","checkHostElement","pass","isElementVisible","message","is","matcherHint","redent","formatElement","join","accessibilityCache","cache","WeakMap","isHiddenFromAccessibility","isHiddenForStyles","isHostModal","props","visible","parent","flatStyle","StyleSheet","flatten","style","display","opacity"],"sources":["../../src/matchers/to-be-visible.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { isHiddenFromAccessibility } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { isHostModal } from '../helpers/host-component-names';\nimport { checkHostElement } from './utils';\n\nexport function toBeVisible(this: jest.MatcherContext, element: HostElement) {\n if (element !== null || !this.isNot) {\n checkHostElement(element, toBeVisible, this);\n }\n\n return {\n pass: isElementVisible(element),\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeVisible`, 'element', ''),\n '',\n `Received element ${is} visible:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isElementVisible(\n element: HostElement,\n accessibilityCache?: WeakMap<HostElement, boolean>,\n): boolean {\n // Use cache to speed up repeated searches by `isHiddenFromAccessibility`.\n const cache = accessibilityCache ?? new WeakMap<HostElement, boolean>();\n if (isHiddenFromAccessibility(element, { cache })) {\n return false;\n }\n\n if (isHiddenForStyles(element)) {\n return false;\n }\n\n // Note: this seems to be a bug in React Native.\n // PR with fix: https://github.com/facebook/react-native/pull/39157\n if (isHostModal(element) && element.props.visible === false) {\n return false;\n }\n\n const parent = element.parent;\n if (parent === null) {\n return true;\n }\n\n return isElementVisible(parent, cache);\n}\n\nfunction isHiddenForStyles(element: HostElement) {\n const flatStyle = StyleSheet.flatten(element.props.style);\n return flatStyle?.display === 'none' || flatStyle?.opacity === 0;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA2C,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,WAAWA,CAA4BC,OAAoB,EAAE;EAC3E,IAAIA,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;IACnC,IAAAC,uBAAgB,EAACF,OAAO,EAAED,WAAW,EAAE,IAAI,CAAC;EAC9C;EAEA,OAAO;IACLI,IAAI,EAAEC,gBAAgB,CAACJ,OAAO,CAAC;IAC/BK,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACL,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAM,6BAAW,EAAC,GAAG,IAAI,CAACN,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBK,EAAE,WAAW,EACjC,IAAAE,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASN,gBAAgBA,CACvBJ,OAAoB,EACpBW,kBAAkD,EACzC;EACT;EACA,MAAMC,KAAK,GAAGD,kBAAkB,IAAI,IAAIE,OAAO,CAAuB,CAAC;EACvE,IAAI,IAAAC,wCAAyB,EAACd,OAAO,EAAE;IAAEY;EAAM,CAAC,CAAC,EAAE;IACjD,OAAO,KAAK;EACd;EAEA,IAAIG,iBAAiB,CAACf,OAAO,CAAC,EAAE;IAC9B,OAAO,KAAK;EACd;;EAEA;EACA;EACA,IAAI,IAAAgB,+BAAW,EAAChB,OAAO,CAAC,IAAIA,OAAO,CAACiB,KAAK,CAACC,OAAO,KAAK,KAAK,EAAE;IAC3D,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGnB,OAAO,CAACmB,MAAM;EAC7B,IAAIA,MAAM,KAAK,IAAI,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAOf,gBAAgB,CAACe,MAAM,EAAEP,KAAK,CAAC;AACxC;AAEA,SAASG,iBAAiBA,CAACf,OAAoB,EAAE;EAC/C,MAAMoB,SAAS,GAAGC,uBAAU,CAACC,OAAO,CAACtB,OAAO,CAACiB,KAAK,CAACM,KAAK,CAAC;EACzD,OAAOH,SAAS,EAAEI,OAAO,KAAK,MAAM,IAAIJ,SAAS,EAAEK,OAAO,KAAK,CAAC;AAClE","ignoreList":[]}
1
+ {"version":3,"file":"to-be-visible.js","names":["_reactNative","require","_jestMatcherUtils","_redent","_interopRequireDefault","_accessibility","_formatElement","_hostComponentNames","_utils","e","__esModule","default","toBeVisible","element","isNot","checkHostElement","pass","isElementVisible","message","is","matcherHint","redent","formatElement","join","accessibilityCache","cache","WeakMap","isHiddenFromAccessibility","isHiddenForStyles","isHostModal","props","visible","parent","flatStyle","StyleSheet","flatten","style","display","opacity"],"sources":["../../src/matchers/to-be-visible.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { matcherHint } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { isHiddenFromAccessibility } from '../helpers/accessibility';\nimport { formatElement } from '../helpers/format-element';\nimport { isHostModal } from '../helpers/host-component-names';\nimport { checkHostElement } from './utils';\n\nexport function toBeVisible(this: jest.MatcherContext, element: HostElement) {\n if (element !== null || !this.isNot) {\n checkHostElement(element, toBeVisible, this);\n }\n\n return {\n pass: isElementVisible(element),\n message: () => {\n const is = this.isNot ? 'is' : 'is not';\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toBeVisible`, 'element', ''),\n '',\n `Received element ${is} visible:`,\n redent(formatElement(element), 2),\n ].join('\\n');\n },\n };\n}\n\nfunction isElementVisible(\n element: HostElement,\n accessibilityCache?: WeakMap<HostElement, boolean>,\n): boolean {\n // Use cache to speed up repeated searches by `isHiddenFromAccessibility`.\n const cache = accessibilityCache ?? new WeakMap<HostElement, boolean>();\n if (isHiddenFromAccessibility(element, { cache })) {\n return false;\n }\n\n if (isHiddenForStyles(element)) {\n return false;\n }\n\n // Note: this seems to be a bug in React Native.\n // PR with fix: https://github.com/facebook/react-native/pull/39157\n if (isHostModal(element) && element.props.visible === false) {\n return false;\n }\n\n const parent = element.parent;\n if (parent === null) {\n return true;\n }\n\n return isElementVisible(parent, cache);\n}\n\nfunction isHiddenForStyles(element: HostElement) {\n const flatStyle = StyleSheet.flatten(element.props.style);\n return flatStyle?.display === 'none' || flatStyle?.opacity === 0;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA2C,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,WAAWA,CAA4BC,OAAoB,EAAE;EAC3E,IAAIA,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACC,KAAK,EAAE;IACnC,IAAAC,uBAAgB,EAACF,OAAO,EAAED,WAAW,EAAE,IAAI,CAAC;EAC9C;EAEA,OAAO;IACLI,IAAI,EAAEC,gBAAgB,CAACJ,OAAO,CAAC;IAC/BK,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,EAAE,GAAG,IAAI,CAACL,KAAK,GAAG,IAAI,GAAG,QAAQ;MACvC,OAAO,CACL,IAAAM,6BAAW,EAAC,GAAG,IAAI,CAACN,KAAK,GAAG,MAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,EACrE,EAAE,EACF,oBAAoBK,EAAE,WAAW,EACjC,IAAAE,eAAM,EAAC,IAAAC,4BAAa,EAACT,OAAO,CAAC,EAAE,CAAC,CAAC,CAClC,CAACU,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH;AAEA,SAASN,gBAAgBA,CACvBJ,OAAoB,EACpBW,kBAAkD,EACzC;EACT;EACA,MAAMC,KAAK,GAAGD,kBAAkB,IAAI,IAAIE,OAAO,CAAuB,CAAC;EACvE,IAAI,IAAAC,wCAAyB,EAACd,OAAO,EAAE;IAAEY;EAAM,CAAC,CAAC,EAAE;IACjD,OAAO,KAAK;EACd;EAEA,IAAIG,iBAAiB,CAACf,OAAO,CAAC,EAAE;IAC9B,OAAO,KAAK;EACd;;EAEA;EACA;EACA,IAAI,IAAAgB,+BAAW,EAAChB,OAAO,CAAC,IAAIA,OAAO,CAACiB,KAAK,CAACC,OAAO,KAAK,KAAK,EAAE;IAC3D,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGnB,OAAO,CAACmB,MAAM;EAC7B,IAAIA,MAAM,KAAK,IAAI,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAOf,gBAAgB,CAACe,MAAM,EAAEP,KAAK,CAAC;AACxC;AAEA,SAASG,iBAAiBA,CAACf,OAAoB,EAAE;EAC/C,MAAMoB,SAAS,GAAGC,uBAAU,CAACC,OAAO,CAACtB,OAAO,CAACiB,KAAK,CAACM,KAAK,CAAC;EACzD,OAAOH,SAAS,EAAEI,OAAO,KAAK,MAAM,IAAIJ,SAAS,EAAEK,OAAO,KAAK,CAAC;AAClE","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HostElement } from 'universal-test-renderer';
1
+ import type { HostElement } from 'test-renderer';
2
2
  export declare function toContainElement(this: jest.MatcherContext, container: HostElement, element: HostElement | null): {
3
3
  pass: boolean;
4
4
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-contain-element.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_formatElement","_utils","e","__esModule","default","toContainElement","container","element","checkHostElement","matches","queryAll","node","pass","length","message","matcherHint","isNot","RECEIVED_COLOR","redent","formatElement","join"],"sources":["../../src/matchers/to-contain-element.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toContainElement(\n this: jest.MatcherContext,\n container: HostElement,\n element: HostElement | null,\n) {\n checkHostElement(container, toContainElement, this);\n\n if (element !== null) {\n checkHostElement(element, toContainElement, this);\n }\n\n let matches: HostElement[] = [];\n if (element) {\n matches = container.queryAll((node) => node === element);\n }\n\n return {\n pass: matches.length > 0,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toContainElement`, 'container', 'element'),\n '',\n RECEIVED_COLOR(`${redent(formatElement(container), 2)} ${\n this.isNot ? '\\n\\ncontains:\\n\\n' : '\\n\\ndoes not contain:\\n\\n'\n } ${redent(formatElement(element), 2)}\n `),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA2C,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,gBAAgBA,CAE9BC,SAAsB,EACtBC,OAA2B,EAC3B;EACA,IAAAC,uBAAgB,EAACF,SAAS,EAAED,gBAAgB,EAAE,IAAI,CAAC;EAEnD,IAAIE,OAAO,KAAK,IAAI,EAAE;IACpB,IAAAC,uBAAgB,EAACD,OAAO,EAAEF,gBAAgB,EAAE,IAAI,CAAC;EACnD;EAEA,IAAII,OAAsB,GAAG,EAAE;EAC/B,IAAIF,OAAO,EAAE;IACXE,OAAO,GAAGH,SAAS,CAACI,QAAQ,CAAEC,IAAI,IAAKA,IAAI,KAAKJ,OAAO,CAAC;EAC1D;EAEA,OAAO;IACLK,IAAI,EAAEH,OAAO,CAACI,MAAM,GAAG,CAAC;IACxBC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,CAAC,EACnF,EAAE,EACF,IAAAC,gCAAc,EAAC,GAAG,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACb,SAAS,CAAC,EAAE,CAAC,CAAC,IACnD,IAAI,CAACU,KAAK,GAAG,mBAAmB,GAAG,2BAA2B,IAC5D,IAAAE,eAAM,EAAC,IAAAC,4BAAa,EAACZ,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7C,SAAS,CAAC,CACH,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-contain-element.js","names":["_jestMatcherUtils","require","_redent","_interopRequireDefault","_formatElement","_utils","e","__esModule","default","toContainElement","container","element","checkHostElement","matches","queryAll","node","pass","length","message","matcherHint","isNot","RECEIVED_COLOR","redent","formatElement","join"],"sources":["../../src/matchers/to-contain-element.ts"],"sourcesContent":["import { matcherHint, RECEIVED_COLOR } from 'jest-matcher-utils';\nimport redent from 'redent';\nimport type { HostElement } from 'test-renderer';\n\nimport { formatElement } from '../helpers/format-element';\nimport { checkHostElement } from './utils';\n\nexport function toContainElement(\n this: jest.MatcherContext,\n container: HostElement,\n element: HostElement | null,\n) {\n checkHostElement(container, toContainElement, this);\n\n if (element !== null) {\n checkHostElement(element, toContainElement, this);\n }\n\n let matches: HostElement[] = [];\n if (element) {\n matches = container.queryAll((node) => node === element);\n }\n\n return {\n pass: matches.length > 0,\n message: () => {\n return [\n matcherHint(`${this.isNot ? '.not' : ''}.toContainElement`, 'container', 'element'),\n '',\n RECEIVED_COLOR(`${redent(formatElement(container), 2)} ${\n this.isNot ? '\\n\\ncontains:\\n\\n' : '\\n\\ndoes not contain:\\n\\n'\n } ${redent(formatElement(element), 2)}\n `),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA2C,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,SAASG,gBAAgBA,CAE9BC,SAAsB,EACtBC,OAA2B,EAC3B;EACA,IAAAC,uBAAgB,EAACF,SAAS,EAAED,gBAAgB,EAAE,IAAI,CAAC;EAEnD,IAAIE,OAAO,KAAK,IAAI,EAAE;IACpB,IAAAC,uBAAgB,EAACD,OAAO,EAAEF,gBAAgB,EAAE,IAAI,CAAC;EACnD;EAEA,IAAII,OAAsB,GAAG,EAAE;EAC/B,IAAIF,OAAO,EAAE;IACXE,OAAO,GAAGH,SAAS,CAACI,QAAQ,CAAEC,IAAI,IAAKA,IAAI,KAAKJ,OAAO,CAAC;EAC1D;EAEA,OAAO;IACLK,IAAI,EAAEH,OAAO,CAACI,MAAM,GAAG,CAAC;IACxBC,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,CAAC,EACnF,EAAE,EACF,IAAAC,gCAAc,EAAC,GAAG,IAAAC,eAAM,EAAC,IAAAC,4BAAa,EAACb,SAAS,CAAC,EAAE,CAAC,CAAC,IACnD,IAAI,CAACU,KAAK,GAAG,mBAAmB,GAAG,2BAA2B,IAC5D,IAAAE,eAAM,EAAC,IAAAC,4BAAa,EAACZ,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7C,SAAS,CAAC,CACH,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,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 { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';
3
3
  export declare function toHaveAccessibilityValue(this: jest.MatcherContext, element: HostElement, expectedValue: AccessibilityValueMatcher): {
4
4
  pass: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"to-have-accessibility-value.js","names":["_jestMatcherUtils","require","_accessibility","_matchAccessibilityValue","_object","_utils","toHaveAccessibilityValue","element","expectedValue","checkHostElement","receivedValue","computeAriaValue","pass","matchAccessibilityValue","message","matcher","matcherHint","isNot","stringify","formatMessage","removeUndefinedKeys"],"sources":["../../src/matchers/to-have-accessibility-value.ts"],"sourcesContent":["import { matcherHint, stringify } from 'jest-matcher-utils';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAriaValue } from '../helpers/accessibility';\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport { matchAccessibilityValue } from '../helpers/matchers/match-accessibility-value';\nimport { removeUndefinedKeys } from '../helpers/object';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibilityValue(\n this: jest.MatcherContext,\n element: HostElement,\n expectedValue: AccessibilityValueMatcher,\n) {\n checkHostElement(element, toHaveAccessibilityValue, this);\n\n const receivedValue = computeAriaValue(element);\n\n return {\n pass: matchAccessibilityValue(element, expectedValue),\n message: () => {\n const matcher = matcherHint(\n `${this.isNot ? '.not' : ''}.toHaveAccessibilityValue`,\n 'element',\n stringify(expectedValue),\n );\n return formatMessage(\n matcher,\n `Expected the element ${this.isNot ? 'not to' : 'to'} have accessibility value`,\n stringify(expectedValue),\n 'Received element with accessibility value',\n stringify(removeUndefinedKeys(receivedValue)),\n );\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEO,SAASK,wBAAwBA,CAEtCC,OAAoB,EACpBC,aAAwC,EACxC;EACA,IAAAC,uBAAgB,EAACF,OAAO,EAAED,wBAAwB,EAAE,IAAI,CAAC;EAEzD,MAAMI,aAAa,GAAG,IAAAC,+BAAgB,EAACJ,OAAO,CAAC;EAE/C,OAAO;IACLK,IAAI,EAAE,IAAAC,gDAAuB,EAACN,OAAO,EAAEC,aAAa,CAAC;IACrDM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EACzB,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,2BAA2B,EACtD,SAAS,EACT,IAAAC,2BAAS,EAACV,aAAa,CACzB,CAAC;MACD,OAAO,IAAAW,oBAAa,EAClBJ,OAAO,EACP,wBAAwB,IAAI,CAACE,KAAK,GAAG,QAAQ,GAAG,IAAI,2BAA2B,EAC/E,IAAAC,2BAAS,EAACV,aAAa,CAAC,EACxB,2CAA2C,EAC3C,IAAAU,2BAAS,EAAC,IAAAE,2BAAmB,EAACV,aAAa,CAAC,CAC9C,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-have-accessibility-value.js","names":["_jestMatcherUtils","require","_accessibility","_matchAccessibilityValue","_object","_utils","toHaveAccessibilityValue","element","expectedValue","checkHostElement","receivedValue","computeAriaValue","pass","matchAccessibilityValue","message","matcher","matcherHint","isNot","stringify","formatMessage","removeUndefinedKeys"],"sources":["../../src/matchers/to-have-accessibility-value.ts"],"sourcesContent":["import { matcherHint, stringify } from 'jest-matcher-utils';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAriaValue } from '../helpers/accessibility';\nimport type { AccessibilityValueMatcher } from '../helpers/matchers/match-accessibility-value';\nimport { matchAccessibilityValue } from '../helpers/matchers/match-accessibility-value';\nimport { removeUndefinedKeys } from '../helpers/object';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibilityValue(\n this: jest.MatcherContext,\n element: HostElement,\n expectedValue: AccessibilityValueMatcher,\n) {\n checkHostElement(element, toHaveAccessibilityValue, this);\n\n const receivedValue = computeAriaValue(element);\n\n return {\n pass: matchAccessibilityValue(element, expectedValue),\n message: () => {\n const matcher = matcherHint(\n `${this.isNot ? '.not' : ''}.toHaveAccessibilityValue`,\n 'element',\n stringify(expectedValue),\n );\n return formatMessage(\n matcher,\n `Expected the element ${this.isNot ? 'not to' : 'to'} have accessibility value`,\n stringify(expectedValue),\n 'Received element with accessibility value',\n stringify(removeUndefinedKeys(receivedValue)),\n );\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEO,SAASK,wBAAwBA,CAEtCC,OAAoB,EACpBC,aAAwC,EACxC;EACA,IAAAC,uBAAgB,EAACF,OAAO,EAAED,wBAAwB,EAAE,IAAI,CAAC;EAEzD,MAAMI,aAAa,GAAG,IAAAC,+BAAgB,EAACJ,OAAO,CAAC;EAE/C,OAAO;IACLK,IAAI,EAAE,IAAAC,gDAAuB,EAACN,OAAO,EAAEC,aAAa,CAAC;IACrDM,OAAO,EAAEA,CAAA,KAAM;MACb,MAAMC,OAAO,GAAG,IAAAC,6BAAW,EACzB,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,2BAA2B,EACtD,SAAS,EACT,IAAAC,2BAAS,EAACV,aAAa,CACzB,CAAC;MACD,OAAO,IAAAW,oBAAa,EAClBJ,OAAO,EACP,wBAAwB,IAAI,CAACE,KAAK,GAAG,QAAQ,GAAG,IAAI,2BAA2B,EAC/E,IAAAC,2BAAS,EAACV,aAAa,CAAC,EACxB,2CAA2C,EAC3C,IAAAU,2BAAS,EAAC,IAAAE,2BAAmB,EAACV,aAAa,CAAC,CAC9C,CAAC;IACH;EACF,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
  export declare function toHaveAccessibleName(this: jest.MatcherContext, element: HostElement, expectedName?: TextMatch, options?: TextMatchOptions): {
4
4
  pass: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"to-have-accessible-name.js","names":["_jestMatcherUtils","require","_accessibility","_matches","_utils","toHaveAccessibleName","element","expectedName","options","checkHostElement","receivedName","computeAccessibleName","missingExpectedValue","arguments","length","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-accessible-name.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport type { HostElement } from 'universal-test-renderer';\n\nimport { computeAccessibleName } from '../helpers/accessibility';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibleName(\n this: jest.MatcherContext,\n element: HostElement,\n expectedName?: TextMatch,\n options?: TextMatchOptions,\n) {\n checkHostElement(element, toHaveAccessibleName, this);\n\n const receivedName = computeAccessibleName(element);\n const missingExpectedValue = arguments.length === 1;\n\n let pass = false;\n if (missingExpectedValue) {\n pass = receivedName !== '';\n } else {\n pass =\n expectedName != null\n ? matches(expectedName, receivedName, options?.normalizer, options?.exact)\n : false;\n }\n\n return {\n pass,\n message: () => {\n return [\n formatMessage(\n matcherHint(`${this.isNot ? '.not' : ''}.toHaveAccessibleName`, 'element', ''),\n `Expected element ${this.isNot ? 'not to' : 'to'} have accessible name`,\n expectedName,\n 'Received',\n receivedName,\n ),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,SAASI,oBAAoBA,CAElCC,OAAoB,EACpBC,YAAwB,EACxBC,OAA0B,EAC1B;EACA,IAAAC,uBAAgB,EAACH,OAAO,EAAED,oBAAoB,EAAE,IAAI,CAAC;EAErD,MAAMK,YAAY,GAAG,IAAAC,oCAAqB,EAACL,OAAO,CAAC;EACnD,MAAMM,oBAAoB,GAAGC,SAAS,CAACC,MAAM,KAAK,CAAC;EAEnD,IAAIC,IAAI,GAAG,KAAK;EAChB,IAAIH,oBAAoB,EAAE;IACxBG,IAAI,GAAGL,YAAY,KAAK,EAAE;EAC5B,CAAC,MAAM;IACLK,IAAI,GACFR,YAAY,IAAI,IAAI,GAChB,IAAAS,gBAAO,EAACT,YAAY,EAAEG,YAAY,EAAEF,OAAO,EAAES,UAAU,EAAET,OAAO,EAAEU,KAAK,CAAC,GACxE,KAAK;EACb;EAEA,OAAO;IACLH,IAAI;IACJI,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,oBAAa,EACX,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC9E,oBAAoB,IAAI,CAACA,KAAK,GAAG,QAAQ,GAAG,IAAI,uBAAuB,EACvEf,YAAY,EACZ,UAAU,EACVG,YACF,CAAC,CACF,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"to-have-accessible-name.js","names":["_jestMatcherUtils","require","_accessibility","_matches","_utils","toHaveAccessibleName","element","expectedName","options","checkHostElement","receivedName","computeAccessibleName","missingExpectedValue","arguments","length","pass","matches","normalizer","exact","message","formatMessage","matcherHint","isNot","join"],"sources":["../../src/matchers/to-have-accessible-name.ts"],"sourcesContent":["import { matcherHint } from 'jest-matcher-utils';\nimport type { HostElement } from 'test-renderer';\n\nimport { computeAccessibleName } from '../helpers/accessibility';\nimport type { TextMatch, TextMatchOptions } from '../matches';\nimport { matches } from '../matches';\nimport { checkHostElement, formatMessage } from './utils';\n\nexport function toHaveAccessibleName(\n this: jest.MatcherContext,\n element: HostElement,\n expectedName?: TextMatch,\n options?: TextMatchOptions,\n) {\n checkHostElement(element, toHaveAccessibleName, this);\n\n const receivedName = computeAccessibleName(element);\n const missingExpectedValue = arguments.length === 1;\n\n let pass = false;\n if (missingExpectedValue) {\n pass = receivedName !== '';\n } else {\n pass =\n expectedName != null\n ? matches(expectedName, receivedName, options?.normalizer, options?.exact)\n : false;\n }\n\n return {\n pass,\n message: () => {\n return [\n formatMessage(\n matcherHint(`${this.isNot ? '.not' : ''}.toHaveAccessibleName`, 'element', ''),\n `Expected element ${this.isNot ? 'not to' : 'to'} have accessible name`,\n expectedName,\n 'Received',\n receivedName,\n ),\n ].join('\\n');\n },\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,SAASI,oBAAoBA,CAElCC,OAAoB,EACpBC,YAAwB,EACxBC,OAA0B,EAC1B;EACA,IAAAC,uBAAgB,EAACH,OAAO,EAAED,oBAAoB,EAAE,IAAI,CAAC;EAErD,MAAMK,YAAY,GAAG,IAAAC,oCAAqB,EAACL,OAAO,CAAC;EACnD,MAAMM,oBAAoB,GAAGC,SAAS,CAACC,MAAM,KAAK,CAAC;EAEnD,IAAIC,IAAI,GAAG,KAAK;EAChB,IAAIH,oBAAoB,EAAE;IACxBG,IAAI,GAAGL,YAAY,KAAK,EAAE;EAC5B,CAAC,MAAM;IACLK,IAAI,GACFR,YAAY,IAAI,IAAI,GAChB,IAAAS,gBAAO,EAACT,YAAY,EAAEG,YAAY,EAAEF,OAAO,EAAES,UAAU,EAAET,OAAO,EAAEU,KAAK,CAAC,GACxE,KAAK;EACb;EAEA,OAAO;IACLH,IAAI;IACJI,OAAO,EAAEA,CAAA,KAAM;MACb,OAAO,CACL,IAAAC,oBAAa,EACX,IAAAC,6BAAW,EAAC,GAAG,IAAI,CAACC,KAAK,GAAG,MAAM,GAAG,EAAE,uBAAuB,EAAE,SAAS,EAAE,EAAE,CAAC,EAC9E,oBAAoB,IAAI,CAACA,KAAK,GAAG,QAAQ,GAAG,IAAI,uBAAuB,EACvEf,YAAY,EACZ,UAAU,EACVG,YACF,CAAC,CACF,CAACa,IAAI,CAAC,IAAI,CAAC;IACd;EACF,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
  export declare function toHaveDisplayValue(this: jest.MatcherContext, element: HostElement, expectedValue: TextMatch, options?: TextMatchOptions): {
4
4
  pass: boolean;