@testing-library/react-native 12.4.5 → 12.5.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.
- package/README.md +10 -7
- package/build/act.js.map +1 -1
- package/build/cleanup.js.map +1 -1
- package/build/config.js.map +1 -1
- package/build/fire-event.d.ts +3 -3
- package/build/fire-event.js +1 -3
- package/build/fire-event.js.map +1 -1
- package/build/flush-micro-tasks.js.map +1 -1
- package/build/helpers/{accessiblity.d.ts → accessibility.d.ts} +1 -1
- package/build/helpers/{accessiblity.js → accessibility.js} +3 -3
- package/build/helpers/accessibility.js.map +1 -0
- package/build/helpers/component-tree.js.map +1 -1
- package/build/helpers/debug-deep.js.map +1 -1
- package/build/helpers/debug-shallow.js.map +1 -1
- package/build/helpers/deprecation.js.map +1 -1
- package/build/helpers/errors.js.map +1 -1
- package/build/helpers/find-all.js +2 -2
- package/build/helpers/find-all.js.map +1 -1
- package/build/helpers/format-default.js.map +1 -1
- package/build/helpers/format.js +1 -1
- package/build/helpers/format.js.map +1 -1
- package/build/helpers/host-component-names.js +1 -1
- package/build/helpers/host-component-names.js.map +1 -1
- package/build/helpers/matchers/match-accessibility-state.js +3 -3
- package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
- package/build/helpers/matchers/match-accessibility-value.js +2 -2
- package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
- package/build/helpers/matchers/match-array-prop.js.map +1 -1
- package/build/helpers/matchers/match-label-text.js +3 -3
- package/build/helpers/matchers/match-label-text.js.map +1 -1
- package/build/helpers/matchers/match-object-prop.js.map +1 -1
- package/build/helpers/matchers/match-string-prop.js.map +1 -1
- package/build/helpers/matchers/match-text-content.js.map +1 -1
- package/build/helpers/object.js.map +1 -1
- package/build/helpers/pointer-events.js.map +1 -1
- package/build/helpers/query-name.js.map +1 -1
- package/build/helpers/string-validation.js.map +1 -1
- package/build/helpers/text-content.js.map +1 -1
- package/build/helpers/text-input.js.map +1 -1
- package/build/helpers/timers.js.map +1 -1
- package/build/helpers/wrap-async.js +4 -3
- package/build/helpers/wrap-async.js.map +1 -1
- package/build/index.flow.js +3 -0
- package/build/index.js.map +1 -1
- package/build/matchers/extend-expect.js.map +1 -1
- package/build/matchers/index.js.map +1 -1
- package/build/matchers/to-be-busy.js +2 -2
- package/build/matchers/to-be-busy.js.map +1 -1
- package/build/matchers/to-be-checked.js +4 -4
- package/build/matchers/to-be-checked.js.map +1 -1
- package/build/matchers/to-be-collapsed.js +2 -2
- package/build/matchers/to-be-collapsed.js.map +1 -1
- package/build/matchers/to-be-disabled.js.map +1 -1
- package/build/matchers/to-be-empty-element.js.map +1 -1
- package/build/matchers/to-be-expanded.js +2 -2
- package/build/matchers/to-be-expanded.js.map +1 -1
- package/build/matchers/to-be-on-the-screen.js.map +1 -1
- package/build/matchers/to-be-partially-checked.js +4 -4
- package/build/matchers/to-be-partially-checked.js.map +1 -1
- package/build/matchers/to-be-selected.js +2 -2
- package/build/matchers/to-be-selected.js.map +1 -1
- package/build/matchers/to-be-visible.js +2 -2
- package/build/matchers/to-be-visible.js.map +1 -1
- package/build/matchers/to-contain-element.js.map +1 -1
- package/build/matchers/to-have-accessibility-value.js +2 -2
- package/build/matchers/to-have-accessibility-value.js.map +1 -1
- package/build/matchers/to-have-accessible-name.js +2 -2
- package/build/matchers/to-have-accessible-name.js.map +1 -1
- package/build/matchers/to-have-display-value.js.map +1 -1
- package/build/matchers/to-have-prop.js.map +1 -1
- package/build/matchers/to-have-style.js.map +1 -1
- package/build/matchers/to-have-text-content.js.map +1 -1
- package/build/matchers/types.js.map +1 -1
- package/build/matchers/utils.js +1 -1
- package/build/matchers/utils.js.map +1 -1
- package/build/matches.js.map +1 -1
- package/build/pure.d.ts +1 -1
- package/build/pure.js +3 -3
- package/build/pure.js.map +1 -1
- package/build/queries/accessibility-state.js +2 -2
- package/build/queries/accessibility-state.js.map +1 -1
- package/build/queries/accessibility-value.js +2 -2
- package/build/queries/accessibility-value.js.map +1 -1
- package/build/queries/display-value.js.map +1 -1
- package/build/queries/hint-text.js.map +1 -1
- package/build/queries/label-text.js.map +1 -1
- package/build/queries/make-queries.js.map +1 -1
- package/build/queries/options.js.map +1 -1
- package/build/queries/placeholder-text.js.map +1 -1
- package/build/queries/role.d.ts +10 -8
- package/build/queries/role.js +4 -4
- package/build/queries/role.js.map +1 -1
- package/build/queries/test-id.js.map +1 -1
- package/build/queries/text.js.map +1 -1
- package/build/queries/unsafe-props.js.map +1 -1
- package/build/queries/unsafe-type.js.map +1 -1
- package/build/react-versions.js +1 -1
- package/build/react-versions.js.map +1 -1
- package/build/render-act.d.ts +1 -1
- package/build/render-act.js +4 -2
- package/build/render-act.js.map +1 -1
- package/build/render-hook.js.map +1 -1
- package/build/render.d.ts +14 -50
- package/build/render.js +16 -18
- package/build/render.js.map +1 -1
- package/build/screen.js.map +1 -1
- package/build/shallow.js +1 -1
- package/build/shallow.js.map +1 -1
- package/build/test-utils/events.js.map +1 -1
- package/build/test-utils/index.js.map +1 -1
- package/build/types.d.ts +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/build/user-event/clear.js.map +1 -1
- package/build/user-event/event-builder/base.d.ts +3 -0
- package/build/user-event/event-builder/base.js +22 -0
- package/build/user-event/event-builder/base.js.map +1 -0
- package/build/user-event/event-builder/common.d.ts +67 -10
- package/build/user-event/event-builder/common.js +7 -9
- package/build/user-event/event-builder/common.js.map +1 -1
- package/build/user-event/event-builder/index.d.ts +179 -26
- package/build/user-event/event-builder/index.js.map +1 -1
- package/build/user-event/event-builder/scroll-view.d.ts +14 -2
- package/build/user-event/event-builder/scroll-view.js +3 -3
- package/build/user-event/event-builder/scroll-view.js.map +1 -1
- package/build/user-event/event-builder/text-input.d.ts +98 -14
- package/build/user-event/event-builder/text-input.js +15 -21
- package/build/user-event/event-builder/text-input.js.map +1 -1
- package/build/user-event/index.js.map +1 -1
- package/build/user-event/press/constants.js.map +1 -1
- package/build/user-event/press/index.js.map +1 -1
- package/build/user-event/press/press.js +5 -1
- package/build/user-event/press/press.js.map +1 -1
- package/build/user-event/scroll/index.js.map +1 -1
- package/build/user-event/scroll/scroll-to.js.map +1 -1
- package/build/user-event/scroll/state.js.map +1 -1
- package/build/user-event/scroll/utils.js.map +1 -1
- package/build/user-event/setup/index.js.map +1 -1
- package/build/user-event/setup/setup.js.map +1 -1
- package/build/user-event/type/index.js.map +1 -1
- package/build/user-event/type/parse-keys.js.map +1 -1
- package/build/user-event/type/type.js.map +1 -1
- package/build/user-event/utils/content-size.js.map +1 -1
- package/build/user-event/utils/dispatch-event.js.map +1 -1
- package/build/user-event/utils/index.js.map +1 -1
- package/build/user-event/utils/text-range.js.map +1 -1
- package/build/user-event/utils/wait.js.map +1 -1
- package/build/user-event/utils/warn-about-real-timers.js.map +1 -1
- package/build/wait-for-element-to-be-removed.js.map +1 -1
- package/build/wait-for.js.map +1 -1
- package/build/within.d.ts +6 -24
- package/build/within.js.map +1 -1
- package/package.json +12 -12
- package/typings/index.flow.js +3 -0
- package/build/helpers/accessiblity.js.map +0 -1
package/build/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["_react","_interopRequireWildcard","require","React","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debugDeep","_debugShallow","_hostComponentNames","_stringValidation","_renderAct","_screen","_within","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","createNodeMock","unstable_validateStringsRenderedWithinText","detectHostComponentNames","configureHostComponentNamesIfNeeded","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","undefined","buildRenderResult","handleRender","_","phase","validateStringsRenderedWithinText","screen","toJSON","Profiler","id","onRender","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","getHostChildren","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions","message","console","warn","json","debugDeep","shallow","debugShallow"],"sources":["../src/render.tsx"],"sourcesContent":["import type { ReactTestInstance, ReactTestRenderer } from 'react-test-renderer';\nimport * as React from 'react';\nimport { Profiler } from 'react';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostChildren } from './helpers/component-tree';\nimport debugDeep, { DebugOptions } from './helpers/debug-deep';\nimport debugShallow from './helpers/debug-shallow';\nimport { configureHostComponentNamesIfNeeded } from './helpers/host-component-names';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult, screen } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n wrapper?: React.ComponentType<any>;\n createNodeMock?: (element: React.ReactElement) => any;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport interface RenderInternalOptions extends RenderOptions {\n detectHostComponentNames?: boolean;\n}\n\nexport function renderInternal<T>(\n component: React.ReactElement<T>,\n {\n wrapper: Wrapper,\n createNodeMock,\n unstable_validateStringsRenderedWithinText,\n detectHostComponentNames = true,\n }: RenderInternalOptions = {},\n) {\n if (detectHostComponentNames) {\n configureHostComponentNamesIfNeeded();\n }\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n createNodeMock,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n\n const renderer = renderWithAct(wrap(component), createNodeMock ? { createNodeMock } : undefined);\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n {\n wrapper: Wrapper,\n createNodeMock,\n }: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n const handleRender: React.ProfilerProps['onRender'] = (_, phase) => {\n if (phase === 'update') {\n validateStringsRenderedWithinText(screen.toJSON());\n }\n };\n\n const wrap = (element: React.ReactElement) => (\n <Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </Profiler>\n );\n\n const renderer = renderWithAct(wrap(component), createNodeMock ? { createNodeMock } : undefined);\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: debug(instance, renderer),\n get root(): ReactTestInstance {\n return getHostChildren(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport interface DebugFunction {\n (options?: DebugOptions | string): void;\n shallow: (message?: string) => void;\n}\n\nfunction debug(instance: ReactTestInstance, renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message; \"message\" }) instead.',\n );\n }\n\n const json = renderer.toJSON();\n if (json) {\n return debugDeep(json, debugOptions);\n }\n }\n debugImpl.shallow = (message?: string) => debugShallow(instance, message);\n return debugImpl;\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,aAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAAgD,SAAAG,uBAAAW,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAnB,wBAAAmB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA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C,CAAC;IAC3C,MAAMC,YAAY,GAChB,OAAO5C,OAAO,KAAK,QAAQ,GACvB;MAAE,GAAG0C,mBAAmB;MAAEG,OAAO,EAAE7C;IAAQ,CAAC,GAC5C;MAAE,GAAG0C,mBAAmB;MAAE,GAAG1C;IAAQ,CAAC;IAE5C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B;MACA8C,OAAO,CAACC,IAAI,CACV,+HACF,CAAC;IACH;IAEA,MAAMC,IAAI,GAAGpC,QAAQ,CAACS,MAAM,CAAC,CAAC;IAC9B,IAAI2B,IAAI,EAAE;MACR,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAEJ,YAAY,CAAC;IACtC;EACF;EACAH,SAAS,CAACS,OAAO,GAAIL,OAAgB,IAAK,IAAAM,qBAAY,EAACxB,QAAQ,EAAEkB,OAAO,CAAC;EACzE,OAAOJ,SAAS;AAClB"}
|
|
1
|
+
{"version":3,"file":"render.js","names":["_react","_interopRequireWildcard","require","React","_act","_interopRequireDefault","_cleanup","_config","_componentTree","_debugDeep","_debugShallow","_hostComponentNames","_stringValidation","_renderAct","_screen","_within","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","render","component","options","renderInternal","wrapper","Wrapper","detectHostComponentNames","unstable_validateStringsRenderedWithinText","testRendererOptions","configureHostComponentNamesIfNeeded","renderWithStringValidation","wrap","element","createElement","renderer","renderWithAct","buildRenderResult","handleRender","_","phase","validateStringsRenderedWithinText","screen","toJSON","Profiler","id","onRender","update","updateWithAct","instance","root","unmount","act","addToCleanupQueue","result","getQueriesForElement","rerender","debug","getHostChildren","UNSAFE_root","enumerable","Error","setRenderResult","debugImpl","defaultDebugOptions","getConfig","debugOptions","message","console","warn","json","debugDeep","shallow","debugShallow"],"sources":["../src/render.tsx"],"sourcesContent":["import type { ReactTestInstance, ReactTestRenderer } from 'react-test-renderer';\nimport * as React from 'react';\nimport { Profiler } from 'react';\nimport act from './act';\nimport { addToCleanupQueue } from './cleanup';\nimport { getConfig } from './config';\nimport { getHostChildren } from './helpers/component-tree';\nimport debugDeep, { DebugOptions } from './helpers/debug-deep';\nimport debugShallow from './helpers/debug-shallow';\nimport { configureHostComponentNamesIfNeeded } from './helpers/host-component-names';\nimport { validateStringsRenderedWithinText } from './helpers/string-validation';\nimport { renderWithAct } from './render-act';\nimport { setRenderResult, screen } from './screen';\nimport { getQueriesForElement } from './within';\n\nexport interface RenderOptions {\n wrapper?: React.ComponentType<any>;\n createNodeMock?: (element: React.ReactElement) => unknown;\n unstable_validateStringsRenderedWithinText?: boolean;\n}\n\nexport type RenderResult = ReturnType<typeof render>;\n\n/**\n * Renders test component deeply using React Test Renderer and exposes helpers\n * to assert on the output.\n */\nexport default function render<T>(component: React.ReactElement<T>, options: RenderOptions = {}) {\n return renderInternal(component, options);\n}\n\nexport interface RenderInternalOptions extends RenderOptions {\n detectHostComponentNames?: boolean;\n}\n\nexport function renderInternal<T>(\n component: React.ReactElement<T>,\n options?: RenderInternalOptions,\n) {\n const {\n wrapper: Wrapper,\n detectHostComponentNames = true,\n unstable_validateStringsRenderedWithinText,\n ...testRendererOptions\n } = options || {};\n\n if (detectHostComponentNames) {\n configureHostComponentNamesIfNeeded();\n }\n\n if (unstable_validateStringsRenderedWithinText) {\n return renderWithStringValidation(component, {\n wrapper: Wrapper,\n ...testRendererOptions,\n });\n }\n\n const wrap = (element: React.ReactElement) => (Wrapper ? <Wrapper>{element}</Wrapper> : element);\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n return buildRenderResult(renderer, wrap);\n}\n\nfunction renderWithStringValidation<T>(\n component: React.ReactElement<T>,\n options: Omit<RenderOptions, 'unstable_validateStringsRenderedWithinText'> = {},\n) {\n const { wrapper: Wrapper, ...testRendererOptions } = options ?? {};\n\n const handleRender: React.ProfilerProps['onRender'] = (_, phase) => {\n if (phase === 'update') {\n validateStringsRenderedWithinText(screen.toJSON());\n }\n };\n\n const wrap = (element: React.ReactElement) => (\n <Profiler id=\"renderProfiler\" onRender={handleRender}>\n {Wrapper ? <Wrapper>{element}</Wrapper> : element}\n </Profiler>\n );\n\n const renderer = renderWithAct(wrap(component), testRendererOptions);\n validateStringsRenderedWithinText(renderer.toJSON());\n\n return buildRenderResult(renderer, wrap);\n}\n\nfunction buildRenderResult(\n renderer: ReactTestRenderer,\n wrap: (element: React.ReactElement) => JSX.Element,\n) {\n const update = updateWithAct(renderer, wrap);\n const instance = renderer.root;\n\n const unmount = () => {\n void act(() => {\n renderer.unmount();\n });\n };\n\n addToCleanupQueue(unmount);\n\n const result = {\n ...getQueriesForElement(instance),\n update,\n unmount,\n rerender: update, // alias for `update`\n toJSON: renderer.toJSON,\n debug: debug(instance, renderer),\n get root(): ReactTestInstance {\n return getHostChildren(instance)[0];\n },\n UNSAFE_root: instance,\n };\n\n // Add as non-enumerable property, so that it's safe to enumerate\n // `render` result, e.g. using destructuring rest syntax.\n Object.defineProperty(result, 'container', {\n enumerable: false,\n get() {\n throw new Error(\n \"'container' property has been renamed to 'UNSAFE_root'.\\n\\n\" +\n \"Consider using 'root' property which returns root host element.\",\n );\n },\n });\n\n setRenderResult(result);\n return result;\n}\n\nfunction updateWithAct(\n renderer: ReactTestRenderer,\n wrap: (innerElement: React.ReactElement) => React.ReactElement,\n) {\n return function (component: React.ReactElement) {\n void act(() => {\n renderer.update(wrap(component));\n });\n };\n}\n\nexport interface DebugFunction {\n (options?: DebugOptions | string): void;\n shallow: (message?: string) => void;\n}\n\nfunction debug(instance: ReactTestInstance, renderer: ReactTestRenderer): DebugFunction {\n function debugImpl(options?: DebugOptions | string) {\n const { defaultDebugOptions } = getConfig();\n const debugOptions =\n typeof options === 'string'\n ? { ...defaultDebugOptions, message: options }\n : { ...defaultDebugOptions, ...options };\n\n if (typeof options === 'string') {\n // eslint-disable-next-line no-console\n console.warn(\n 'Using debug(\"message\") is deprecated and will be removed in future release, please use debug({ message; \"message\" }) instead.',\n );\n }\n\n const json = renderer.toJSON();\n if (json) {\n return debugDeep(json, debugOptions);\n }\n }\n debugImpl.shallow = (message?: string) => debugShallow(instance, message);\n return debugImpl;\n}\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,IAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,aAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAAgD,SAAAG,uBAAAW,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAnB,wBAAAmB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,K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C;MAAE,GAAGyC,mBAAmB;MAAE,GAAGzC;IAAQ,CAAC;IAE5C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B;MACA6C,OAAO,CAACC,IAAI,CACV,+HACF,CAAC;IACH;IAEA,MAAMC,IAAI,GAAGnC,QAAQ,CAACQ,MAAM,CAAC,CAAC;IAC9B,IAAI2B,IAAI,EAAE;MACR,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAEJ,YAAY,CAAC;IACtC;EACF;EACAH,SAAS,CAACS,OAAO,GAAIL,OAAgB,IAAK,IAAAM,qBAAY,EAACxB,QAAQ,EAAEkB,OAAO,CAAC;EACzE,OAAOJ,SAAS;AAClB","ignoreList":[]}
|
package/build/screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","shallow","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","getByA11yState","getAllByA11yState","queryByA11yState","queryAllByA11yState","findByA11yState","findAllByA11yState","getByAccessibilityState","getAllByAccessibilityState","queryByAccessibilityState","queryAllByAccessibilityState","findByAccessibilityState","findAllByAccessibilityState","getByA11yValue","getAllByA11yValue","queryByA11yValue","queryAllByA11yValue","findByA11yValue","findAllByA11yValue","getByAccessibilityValue","getAllByAccessibilityValue","queryByAccessibilityValue","queryAllByAccessibilityValue","findByAccessibilityValue","findAllByAccessibilityValue","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\nnotImplementedDebug.shallow = notImplemented;\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n getByA11yState: notImplemented,\n getAllByA11yState: notImplemented,\n queryByA11yState: notImplemented,\n queryAllByA11yState: notImplemented,\n findByA11yState: notImplemented,\n findAllByA11yState: notImplemented,\n getByAccessibilityState: notImplemented,\n getAllByAccessibilityState: notImplemented,\n queryByAccessibilityState: notImplemented,\n queryAllByAccessibilityState: notImplemented,\n findByAccessibilityState: notImplemented,\n findAllByAccessibilityState: notImplemented,\n getByA11yValue: notImplemented,\n getAllByA11yValue: notImplemented,\n queryByA11yValue: notImplemented,\n queryAllByA11yValue: notImplemented,\n findByA11yValue: notImplemented,\n findAllByA11yValue: notImplemented,\n getByAccessibilityValue: notImplemented,\n getAllByAccessibilityValue: notImplemented,\n queryByAccessibilityValue: notImplemented,\n queryAllByAccessibilityValue: notImplemented,\n findByAccessibilityValue: notImplemented,\n findAllByAccessibilityValue: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clearRenderResult() {\n screen = defaultScreen;\n}\n"],"mappings":";;;;;;;;AAGA,MAAMA,YAAY,GAAG,qCAAqC;AAE1D,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAC3B,MAAM,IAAIC,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AAED,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EAChC,MAAM,IAAID,KAAK,CAACF,YAAY,CAAC;AAC/B,CAAC;AACDG,mBAAmB,CAACC,OAAO,GAAGH,cAAc;AAM5C,MAAMI,aAAqB,GAAG;EAC5BC,UAAU,EAAE,IAAI;EAChB,IAAIC,IAAIA,CAAA,EAAsB;IAC5B,MAAM,IAAIL,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACD,IAAIQ,WAAWA,CAAA,EAAsB;IACnC,MAAM,IAAIN,KAAK,CAACF,YAAY,CAAC;EAC/B,CAAC;EACDS,KAAK,EAAEN,mBAAmB;EAC1BO,MAAM,EAAET,cAAc;EACtBU,OAAO,EAAEV,cAAc;EACvBW,QAAQ,EAAEX,cAAc;EACxBY,MAAM,EAAEZ,cAAc;EACtBa,cAAc,EAAEb,cAAc;EAC9Bc,iBAAiB,EAAEd,cAAc;EACjCe,gBAAgB,EAAEf,cAAc;EAChCgB,mBAAmB,EAAEhB,cAAc;EACnCiB,eAAe,EAAEjB,cAAc;EAC/BkB,kBAAkB,EAAElB,cAAc;EAClCmB,aAAa,EAAEnB,cAAc;EAC7BoB,gBAAgB,EAAEpB,cAAc;EAChCqB,e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G,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAG/F,aAAa;AACxB"}
|
|
1
|
+
{"version":3,"file":"screen.js","names":["SCREEN_ERROR","notImplemented","Error","notImplementedDebug","shallow","defaultScreen","isDetached","root","UNSAFE_root","debug","update","unmount","rerender","toJSON","getByLabelText","getAllByLabelText","queryByLabelText","queryAllByLabelText","findByLabelText","findAllByLabelText","getByHintText","getAllByHintText","queryByHintText","queryAllByHintText","findByHintText","findAllByHintText","getByA11yHint","getAllByA11yHint","queryByA11yHint","queryAllByA11yHint","findByA11yHint","findAllByA11yHint","getByAccessibilityHint","getAllByAccessibilityHint","queryByAccessibilityHint","queryAllByAccessibilityHint","findByAccessibilityHint","findAllByAccessibilityHint","getByRole","getAllByRole","queryByRole","queryAllByRole","findByRole","findAllByRole","getByA11yState","getAllByA11yState","queryByA11yState","queryAllByA11yState","findByA11yState","findAllByA11yState","getByAccessibilityState","getAllByAccessibilityState","queryByAccessibilityState","queryAllByAccessibilityState","findByAccessibilityState","findAllByAccessibilityState","getByA11yValue","getAllByA11yValue","queryByA11yValue","queryAllByA11yValue","findByA11yValue","findAllByA11yValue","getByAccessibilityValue","getAllByAccessibilityValue","queryByAccessibilityValue","queryAllByAccessibilityValue","findByAccessibilityValue","findAllByAccessibilityValue","UNSAFE_getByProps","UNSAFE_getAllByProps","UNSAFE_queryByProps","UNSAFE_queryAllByProps","UNSAFE_getByType","UNSAFE_getAllByType","UNSAFE_queryByType","UNSAFE_queryAllByType","getByPlaceholderText","getAllByPlaceholderText","queryByPlaceholderText","queryAllByPlaceholderText","findByPlaceholderText","findAllByPlaceholderText","getByDisplayValue","getAllByDisplayValue","queryByDisplayValue","queryAllByDisplayValue","findByDisplayValue","findAllByDisplayValue","getByTestId","getAllByTestId","queryByTestId","queryAllByTestId","findByTestId","findAllByTestId","getByText","getAllByText","queryByText","queryAllByText","findByText","findAllByText","screen","exports","setRenderResult","renderResult","clearRenderResult"],"sources":["../src/screen.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { RenderResult } from './render';\n\nconst SCREEN_ERROR = '`render` method has not been called';\n\nconst notImplemented = () => {\n throw new Error(SCREEN_ERROR);\n};\n\nconst notImplementedDebug = () => {\n throw new Error(SCREEN_ERROR);\n};\nnotImplementedDebug.shallow = notImplemented;\n\ninterface Screen extends RenderResult {\n isDetached?: boolean;\n}\n\nconst defaultScreen: Screen = {\n isDetached: true,\n get root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n get UNSAFE_root(): ReactTestInstance {\n throw new Error(SCREEN_ERROR);\n },\n debug: notImplementedDebug,\n update: notImplemented,\n unmount: notImplemented,\n rerender: notImplemented,\n toJSON: notImplemented,\n getByLabelText: notImplemented,\n getAllByLabelText: notImplemented,\n queryByLabelText: notImplemented,\n queryAllByLabelText: notImplemented,\n findByLabelText: notImplemented,\n findAllByLabelText: notImplemented,\n getByHintText: notImplemented,\n getAllByHintText: notImplemented,\n queryByHintText: notImplemented,\n queryAllByHintText: notImplemented,\n findByHintText: notImplemented,\n findAllByHintText: notImplemented,\n getByA11yHint: notImplemented,\n getAllByA11yHint: notImplemented,\n queryByA11yHint: notImplemented,\n queryAllByA11yHint: notImplemented,\n findByA11yHint: notImplemented,\n findAllByA11yHint: notImplemented,\n getByAccessibilityHint: notImplemented,\n getAllByAccessibilityHint: notImplemented,\n queryByAccessibilityHint: notImplemented,\n queryAllByAccessibilityHint: notImplemented,\n findByAccessibilityHint: notImplemented,\n findAllByAccessibilityHint: notImplemented,\n getByRole: notImplemented,\n getAllByRole: notImplemented,\n queryByRole: notImplemented,\n queryAllByRole: notImplemented,\n findByRole: notImplemented,\n findAllByRole: notImplemented,\n getByA11yState: notImplemented,\n getAllByA11yState: notImplemented,\n queryByA11yState: notImplemented,\n queryAllByA11yState: notImplemented,\n findByA11yState: notImplemented,\n findAllByA11yState: notImplemented,\n getByAccessibilityState: notImplemented,\n getAllByAccessibilityState: notImplemented,\n queryByAccessibilityState: notImplemented,\n queryAllByAccessibilityState: notImplemented,\n findByAccessibilityState: notImplemented,\n findAllByAccessibilityState: notImplemented,\n getByA11yValue: notImplemented,\n getAllByA11yValue: notImplemented,\n queryByA11yValue: notImplemented,\n queryAllByA11yValue: notImplemented,\n findByA11yValue: notImplemented,\n findAllByA11yValue: notImplemented,\n getByAccessibilityValue: notImplemented,\n getAllByAccessibilityValue: notImplemented,\n queryByAccessibilityValue: notImplemented,\n queryAllByAccessibilityValue: notImplemented,\n findByAccessibilityValue: notImplemented,\n findAllByAccessibilityValue: notImplemented,\n UNSAFE_getByProps: notImplemented,\n UNSAFE_getAllByProps: notImplemented,\n UNSAFE_queryByProps: notImplemented,\n UNSAFE_queryAllByProps: notImplemented,\n UNSAFE_getByType: notImplemented,\n UNSAFE_getAllByType: notImplemented,\n UNSAFE_queryByType: notImplemented,\n UNSAFE_queryAllByType: notImplemented,\n getByPlaceholderText: notImplemented,\n getAllByPlaceholderText: notImplemented,\n queryByPlaceholderText: notImplemented,\n queryAllByPlaceholderText: notImplemented,\n findByPlaceholderText: notImplemented,\n findAllByPlaceholderText: notImplemented,\n getByDisplayValue: notImplemented,\n getAllByDisplayValue: notImplemented,\n queryByDisplayValue: notImplemented,\n queryAllByDisplayValue: notImplemented,\n findByDisplayValue: notImplemented,\n findAllByDisplayValue: notImplemented,\n getByTestId: notImplemented,\n getAllByTestId: notImplemented,\n queryByTestId: notImplemented,\n queryAllByTestId: notImplemented,\n findByTestId: notImplemented,\n findAllByTestId: notImplemented,\n getByText: notImplemented,\n getAllByText: notImplemented,\n queryByText: notImplemented,\n queryAllByText: notImplemented,\n findByText: notImplemented,\n findAllByText: notImplemented,\n};\n\nexport let screen: Screen = defaultScreen;\n\nexport function setRenderResult(renderResult: RenderResult) {\n screen = renderResult;\n}\n\nexport function clear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c;EACtCuE,gBAAgB,EAAEvE,cAAc;EAChCwE,mBAAmB,EAAExE,cAAc;EACnCyE,kBAAkB,EAAEzE,cAAc;EAClC0E,qBAAqB,EAAE1E,cAAc;EACrC2E,oBAAoB,EAAE3E,cAAc;EACpC4E,uBAAuB,EAAE5E,cAAc;EACvC6E,sBAAsB,EAAE7E,cAAc;EACtC8E,yBAAyB,EAAE9E,cAAc;EACzC+E,qBAAqB,EAAE/E,cAAc;EACrCgF,wBAAwB,EAAEhF,cAAc;EACxCiF,iBAAiB,EAAEjF,cAAc;EACjCkF,oBAAoB,EAAElF,cAAc;EACpCmF,mBAAmB,EAAEnF,cAAc;EACnCoF,sBAAsB,EAAEpF,cAAc;EACtCqF,kBAAkB,EAAErF,cAAc;EAClCsF,qBAAqB,EAAEtF,cAAc;EACrCuF,WAAW,EAAEvF,cAAc;EAC3BwF,cAAc,EAAExF,cAAc;EAC9ByF,aAAa,EAAEzF,cAAc;EAC7B0F,gBAAgB,EAAE1F,cAAc;EAChC2F,YAAY,EAAE3F,cAAc;EAC5B4F,eAAe,EAAE5F,cAAc;EAC/B6F,SAAS,EAAE7F,cAAc;EACzB8F,YAAY,EAAE9F,cAAc;EAC5B+F,WAAW,EAAE/F,cAAc;EAC3BgG,cAAc,EAAEhG,cAAc;EAC9BiG,UAAU,EAAEjG,cAAc;EAC1BkG,aAAa,EAAElG;AACjB,CAAC;AAEM,IAAImG,MAAc,GAAAC,OAAA,CAAAD,MAAA,GAAG/F,aAAa;AAElC,SAASiG,eAAeA,CAACC,YAA0B,EAAE;EAC1DF,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAGG,YAAY;AACvB;AAEO,SAASC,iBAAiBA,CAAA,EAAG;EAClCH,OAAA,CAAAD,MAAA,GAAAA,MAAM,GAAG/F,aAAa;AACxB","ignoreList":[]}
|
package/build/shallow.js
CHANGED
|
@@ -8,7 +8,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _shallow = _interopRequireDefault(require("react-test-renderer/shallow"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
// eslint-disable-line import/no-extraneous-dependencies
|
|
13
13
|
|
|
14
14
|
/**
|
package/build/shallow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shallow.js","names":["React","_interopRequireWildcard","require","_shallow","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","
|
|
1
|
+
{"version":3,"file":"shallow.js","names":["React","_interopRequireWildcard","require","_shallow","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","shallowInternal","instance","renderer","ShallowRenderer","render","createElement","type","props","output","getRenderOutput"],"sources":["../src/shallow.ts"],"sourcesContent":["import * as React from 'react';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport ShallowRenderer from 'react-test-renderer/shallow'; // eslint-disable-line import/no-extraneous-dependencies\n\n/**\n * Renders test component shallowly using react-test-renderer/shallow\n */\nexport function shallowInternal(instance: ReactTestInstance | React.ReactElement<any>): {\n output: any;\n} {\n const renderer = new (ShallowRenderer as any)();\n\n renderer.render(React.createElement(instance.type, instance.props));\n\n return {\n output: renderer.getRenderOutput(),\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0D,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAd,CAAA,EAAAY,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAX,CAAA,EAAAY,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAZ,CAAA,CAAAY,CAAA,YAAAN,CAAA,CAAAR,OAAA,GAAAE,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAa,GAAA,CAAAhB,CAAA,EAAAM,CAAA,GAAAA,CAAA;AAAC;;AAE3D;AACA;AACA;AACO,SAASW,eAAeA,CAACC,QAAqD,EAEnF;EACA,MAAMC,QAAQ,GAAG,IAAKC,gBAAe,CAAS,CAAC;EAE/CD,QAAQ,CAACE,MAAM,eAAC9B,KAAK,CAAC+B,aAAa,CAACJ,QAAQ,CAACK,IAAI,EAAEL,QAAQ,CAACM,KAAK,CAAC,CAAC;EAEnE,OAAO;IACLC,MAAM,EAAEN,QAAQ,CAACO,eAAe,CAAC;EACnC,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":["createEventLogger","events","logEvent","name","event","eventEntry","payload","push","getEventsName","map"],"sources":["../../src/test-utils/events.ts"],"sourcesContent":["export interface EventEntry {\n name: string;\n payload: any;\n}\n\nexport function createEventLogger() {\n const events: EventEntry[] = [];\n const logEvent = (name: string) => {\n return (event: unknown) => {\n const eventEntry: EventEntry = {\n name,\n payload: event,\n };\n\n events.push(eventEntry);\n };\n };\n\n return { events, logEvent };\n}\n\nexport function getEventsName(events: EventEntry[]) {\n return events.map((event) => event.name);\n}\n"],"mappings":";;;;;;;AAKO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,MAAMC,MAAoB,GAAG,EAAE;EAC/B,MAAMC,QAAQ,GAAIC,IAAY,IAAK;IACjC,OAAQC,KAAc,IAAK;MACzB,MAAMC,UAAsB,GAAG;QAC7BF,IAAI;QACJG,OAAO,EAAEF;MACX,CAAC;MAEDH,MAAM,CAACM,IAAI,CAACF,UAAU,CAAC;IACzB,CAAC;EACH,CAAC;EAED,OAAO;IAAEJ,MAAM;IAAEC;EAAS,CAAC;AAC7B;AAEO,SAASM,aAAaA,CAACP,MAAoB,EAAE;EAClD,OAAOA,MAAM,CAACQ,GAAG,CAAEL,KAAK,IAAKA,KAAK,CAACD,IAAI,CAAC;AAC1C"}
|
|
1
|
+
{"version":3,"file":"events.js","names":["createEventLogger","events","logEvent","name","event","eventEntry","payload","push","getEventsName","map"],"sources":["../../src/test-utils/events.ts"],"sourcesContent":["export interface EventEntry {\n name: string;\n payload: any;\n}\n\nexport function createEventLogger() {\n const events: EventEntry[] = [];\n const logEvent = (name: string) => {\n return (event: unknown) => {\n const eventEntry: EventEntry = {\n name,\n payload: event,\n };\n\n events.push(eventEntry);\n };\n };\n\n return { events, logEvent };\n}\n\nexport function getEventsName(events: EventEntry[]) {\n return events.map((event) => event.name);\n}\n"],"mappings":";;;;;;;AAKO,SAASA,iBAAiBA,CAAA,EAAG;EAClC,MAAMC,MAAoB,GAAG,EAAE;EAC/B,MAAMC,QAAQ,GAAIC,IAAY,IAAK;IACjC,OAAQC,KAAc,IAAK;MACzB,MAAMC,UAAsB,GAAG;QAC7BF,IAAI;QACJG,OAAO,EAAEF;MACX,CAAC;MAEDH,MAAM,CAACM,IAAI,CAACF,UAAU,CAAC;IACzB,CAAC;EACH,CAAC;EAED,OAAO;IAAEJ,MAAM;IAAEC;EAAS,CAAC;AAC7B;AAEO,SAASM,aAAaA,CAACP,MAAoB,EAAE;EAClD,OAAOA,MAAM,CAACQ,GAAG,CAAEL,KAAK,IAAKA,KAAK,CAACD,IAAI,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_events","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/test-utils/index.ts"],"sourcesContent":["export * from './events';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_events","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/test-utils/index.ts"],"sourcesContent":["export * from './events';\n"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type StringWithAutocomplete<T> = T | (string & {});
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["// TS autocomplete trick\n// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939\nexport type StringWithAutocomplete<T> = T | (string & {});\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear.js","names":["_errors","require","_hostComponentNames","_textInput","_pointerEvents","_eventBuilder","_utils","_type","clear","element","isHostTextInput","ErrorWithStack","type","isTextInputEditable","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","previousText","props","value","defaultValue","selectionRange","start","end","length","TextInput","selectionChange","finalText","emitTypingEvents","config","wait","endEditing","blur"],"sources":["../../src/user-event/clear.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { isTextInputEditable } from '../helpers/text-input';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { EventBuilder } from './event-builder';\nimport { UserEventInstance } from './setup';\nimport { dispatchEvent, wait } from './utils';\nimport { emitTypingEvents } from './type/type';\n\nexport async function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `clear() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n clear,\n );\n }\n\n if (!isTextInputEditable(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const previousText = element.props.value ?? element.props.defaultValue ?? '';\n const selectionRange = {\n start: 0,\n end: previousText.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // 3. Press backspace\n const finalText = '';\n await emitTypingEvents(this.config, element, 'Backspace', finalText, previousText);\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));\n\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAA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CAAC,CAAC;AAC5D"}
|
|
1
|
+
{"version":3,"file":"clear.js","names":["_errors","require","_hostComponentNames","_textInput","_pointerEvents","_eventBuilder","_utils","_type","clear","element","isHostTextInput","ErrorWithStack","type","isTextInputEditable","isPointerEventEnabled","dispatchEvent","EventBuilder","Common","focus","previousText","props","value","defaultValue","selectionRange","start","end","length","TextInput","selectionChange","finalText","emitTypingEvents","config","wait","endEditing","blur"],"sources":["../../src/user-event/clear.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../helpers/errors';\nimport { isHostTextInput } from '../helpers/host-component-names';\nimport { isTextInputEditable } from '../helpers/text-input';\nimport { isPointerEventEnabled } from '../helpers/pointer-events';\nimport { EventBuilder } from './event-builder';\nimport { UserEventInstance } from './setup';\nimport { dispatchEvent, wait } from './utils';\nimport { emitTypingEvents } from './type/type';\n\nexport async function clear(this: UserEventInstance, element: ReactTestInstance): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `clear() only supports host \"TextInput\" elements. Passed element has type: \"${element.type}\".`,\n clear,\n );\n }\n\n if (!isTextInputEditable(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n // 1. Enter element\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n // 2. Select all\n const previousText = element.props.value ?? element.props.defaultValue ?? '';\n const selectionRange = {\n start: 0,\n end: previousText.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // 3. Press backspace\n const finalText = '';\n await emitTypingEvents(this.config, element, 'Backspace', finalText, previousText);\n\n // 4. Exit element\n await wait(this.config);\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));\n\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n}\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG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AACC,MAAM,CAACiB,IAAI,CAAC,CAAC,CAAC;AAC5D","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.baseSyntheticEvent = baseSyntheticEvent;
|
|
7
|
+
/** Builds base syntentic event stub, with prop values as inspected in RN runtime. */
|
|
8
|
+
function baseSyntheticEvent() {
|
|
9
|
+
return {
|
|
10
|
+
currentTarget: {},
|
|
11
|
+
target: {},
|
|
12
|
+
preventDefault: () => {},
|
|
13
|
+
isDefaultPrevented: () => false,
|
|
14
|
+
stopPropagation: () => {},
|
|
15
|
+
isPropagationStopped: () => false,
|
|
16
|
+
persist: () => {},
|
|
17
|
+
// @ts-expect-error: `isPersistent` is not a standard prop, but it's used in RN runtime. See: https://react.dev/reference/react-dom/components/common#react-event-object-methods
|
|
18
|
+
isPersistent: () => false,
|
|
19
|
+
timeStamp: 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","names":["baseSyntheticEvent","currentTarget","target","preventDefault","isDefaultPrevented","stopPropagation","isPropagationStopped","persist","isPersistent","timeStamp"],"sources":["../../../src/user-event/event-builder/base.ts"],"sourcesContent":["import { BaseSyntheticEvent } from 'react';\n\n/** Builds base syntentic event stub, with prop values as inspected in RN runtime. */\nexport function baseSyntheticEvent(): Partial<BaseSyntheticEvent<{}, unknown, unknown>> {\n return {\n currentTarget: {},\n target: {},\n preventDefault: () => {},\n isDefaultPrevented: () => false,\n stopPropagation: () => {},\n isPropagationStopped: () => false,\n persist: () => {},\n // @ts-expect-error: `isPersistent` is not a standard prop, but it's used in RN runtime. See: https://react.dev/reference/react-dom/components/common#react-event-object-methods\n isPersistent: () => false,\n timeStamp: 0,\n };\n}\n"],"mappings":";;;;;;AAEA;AACO,SAASA,kBAAkBA,CAAA,EAAsD;EACtF,OAAO;IACLC,aAAa,EAAE,CAAC,CAAC;IACjBC,MAAM,EAAE,CAAC,CAAC;IACVC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;IACxBC,kBAAkB,EAAEA,CAAA,KAAM,KAAK;IAC/BC,eAAe,EAAEA,CAAA,KAAM,CAAC,CAAC;IACzBC,oBAAoB,EAAEA,CAAA,KAAM,KAAK;IACjCC,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;IACjB;IACAC,YAAY,EAAEA,CAAA,KAAM,KAAK;IACzBC,SAAS,EAAE;EACb,CAAC;AACH","ignoreList":[]}
|
|
@@ -15,11 +15,22 @@ declare function touch(): {
|
|
|
15
15
|
timestamp: number;
|
|
16
16
|
touches: never[];
|
|
17
17
|
};
|
|
18
|
-
persist: () => void;
|
|
19
18
|
currentTarget: {
|
|
20
19
|
measure: () => void;
|
|
21
20
|
};
|
|
22
|
-
target
|
|
21
|
+
target?: unknown;
|
|
22
|
+
bubbles?: boolean | undefined;
|
|
23
|
+
cancelable?: boolean | undefined;
|
|
24
|
+
defaultPrevented?: boolean | undefined;
|
|
25
|
+
eventPhase?: number | undefined;
|
|
26
|
+
isTrusted?: boolean | undefined;
|
|
27
|
+
preventDefault?: (() => void) | undefined;
|
|
28
|
+
isDefaultPrevented?: (() => boolean) | undefined;
|
|
29
|
+
stopPropagation?: (() => void) | undefined;
|
|
30
|
+
isPropagationStopped?: (() => boolean) | undefined;
|
|
31
|
+
persist?: (() => void) | undefined;
|
|
32
|
+
timeStamp?: number | undefined;
|
|
33
|
+
type?: string | undefined;
|
|
23
34
|
};
|
|
24
35
|
export declare const CommonEventBuilder: {
|
|
25
36
|
touch: typeof touch;
|
|
@@ -38,11 +49,22 @@ export declare const CommonEventBuilder: {
|
|
|
38
49
|
timestamp: number;
|
|
39
50
|
touches: never[];
|
|
40
51
|
};
|
|
41
|
-
persist: () => void;
|
|
42
52
|
currentTarget: {
|
|
43
53
|
measure: () => void;
|
|
44
54
|
};
|
|
45
|
-
target
|
|
55
|
+
target?: unknown;
|
|
56
|
+
bubbles?: boolean | undefined;
|
|
57
|
+
cancelable?: boolean | undefined;
|
|
58
|
+
defaultPrevented?: boolean | undefined;
|
|
59
|
+
eventPhase?: number | undefined;
|
|
60
|
+
isTrusted?: boolean | undefined;
|
|
61
|
+
preventDefault?: (() => void) | undefined;
|
|
62
|
+
isDefaultPrevented?: (() => boolean) | undefined;
|
|
63
|
+
stopPropagation?: (() => void) | undefined;
|
|
64
|
+
isPropagationStopped?: (() => boolean) | undefined;
|
|
65
|
+
persist?: (() => void) | undefined;
|
|
66
|
+
timeStamp?: number | undefined;
|
|
67
|
+
type?: string | undefined;
|
|
46
68
|
};
|
|
47
69
|
responderRelease: () => {
|
|
48
70
|
dispatchConfig: {
|
|
@@ -59,11 +81,22 @@ export declare const CommonEventBuilder: {
|
|
|
59
81
|
timestamp: number;
|
|
60
82
|
touches: never[];
|
|
61
83
|
};
|
|
62
|
-
persist: () => void;
|
|
63
84
|
currentTarget: {
|
|
64
85
|
measure: () => void;
|
|
65
86
|
};
|
|
66
|
-
target
|
|
87
|
+
target?: unknown;
|
|
88
|
+
bubbles?: boolean | undefined;
|
|
89
|
+
cancelable?: boolean | undefined;
|
|
90
|
+
defaultPrevented?: boolean | undefined;
|
|
91
|
+
eventPhase?: number | undefined;
|
|
92
|
+
isTrusted?: boolean | undefined;
|
|
93
|
+
preventDefault?: (() => void) | undefined;
|
|
94
|
+
isDefaultPrevented?: (() => boolean) | undefined;
|
|
95
|
+
stopPropagation?: (() => void) | undefined;
|
|
96
|
+
isPropagationStopped?: (() => boolean) | undefined;
|
|
97
|
+
persist?: (() => void) | undefined;
|
|
98
|
+
timeStamp?: number | undefined;
|
|
99
|
+
type?: string | undefined;
|
|
67
100
|
};
|
|
68
101
|
/**
|
|
69
102
|
* Experimental values:
|
|
@@ -74,8 +107,20 @@ export declare const CommonEventBuilder: {
|
|
|
74
107
|
nativeEvent: {
|
|
75
108
|
target: number;
|
|
76
109
|
};
|
|
77
|
-
currentTarget
|
|
78
|
-
target
|
|
110
|
+
currentTarget?: unknown;
|
|
111
|
+
target?: unknown;
|
|
112
|
+
bubbles?: boolean | undefined;
|
|
113
|
+
cancelable?: boolean | undefined;
|
|
114
|
+
defaultPrevented?: boolean | undefined;
|
|
115
|
+
eventPhase?: number | undefined;
|
|
116
|
+
isTrusted?: boolean | undefined;
|
|
117
|
+
preventDefault?: (() => void) | undefined;
|
|
118
|
+
isDefaultPrevented?: (() => boolean) | undefined;
|
|
119
|
+
stopPropagation?: (() => void) | undefined;
|
|
120
|
+
isPropagationStopped?: (() => boolean) | undefined;
|
|
121
|
+
persist?: (() => void) | undefined;
|
|
122
|
+
timeStamp?: number | undefined;
|
|
123
|
+
type?: string | undefined;
|
|
79
124
|
};
|
|
80
125
|
/**
|
|
81
126
|
* Experimental values:
|
|
@@ -86,8 +131,20 @@ export declare const CommonEventBuilder: {
|
|
|
86
131
|
nativeEvent: {
|
|
87
132
|
target: number;
|
|
88
133
|
};
|
|
89
|
-
currentTarget
|
|
90
|
-
target
|
|
134
|
+
currentTarget?: unknown;
|
|
135
|
+
target?: unknown;
|
|
136
|
+
bubbles?: boolean | undefined;
|
|
137
|
+
cancelable?: boolean | undefined;
|
|
138
|
+
defaultPrevented?: boolean | undefined;
|
|
139
|
+
eventPhase?: number | undefined;
|
|
140
|
+
isTrusted?: boolean | undefined;
|
|
141
|
+
preventDefault?: (() => void) | undefined;
|
|
142
|
+
isDefaultPrevented?: (() => boolean) | undefined;
|
|
143
|
+
stopPropagation?: (() => void) | undefined;
|
|
144
|
+
isPropagationStopped?: (() => boolean) | undefined;
|
|
145
|
+
persist?: (() => void) | undefined;
|
|
146
|
+
timeStamp?: number | undefined;
|
|
147
|
+
type?: string | undefined;
|
|
91
148
|
};
|
|
92
149
|
};
|
|
93
150
|
export {};
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CommonEventBuilder = void 0;
|
|
7
|
+
var _base = require("./base");
|
|
7
8
|
/**
|
|
8
9
|
* Experimental values:
|
|
9
10
|
* - iOS: `{"changedTouches": [[Circular]], "identifier": 1, "locationX": 253, "locationY": 30.333328247070312, "pageX": 273, "pageY": 141.3333282470703, "target": 75, "timestamp": 875928682.0450834, "touches": [[Circular]]}`
|
|
@@ -11,6 +12,7 @@ exports.CommonEventBuilder = void 0;
|
|
|
11
12
|
*/
|
|
12
13
|
function touch() {
|
|
13
14
|
return {
|
|
15
|
+
...(0, _base.baseSyntheticEvent)(),
|
|
14
16
|
nativeEvent: {
|
|
15
17
|
changedTouches: [],
|
|
16
18
|
identifier: 0,
|
|
@@ -22,11 +24,9 @@ function touch() {
|
|
|
22
24
|
timestamp: Date.now(),
|
|
23
25
|
touches: []
|
|
24
26
|
},
|
|
25
|
-
persist: () => {},
|
|
26
27
|
currentTarget: {
|
|
27
28
|
measure: () => {}
|
|
28
|
-
}
|
|
29
|
-
target: {}
|
|
29
|
+
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
const CommonEventBuilder = exports.CommonEventBuilder = {
|
|
@@ -54,11 +54,10 @@ const CommonEventBuilder = exports.CommonEventBuilder = {
|
|
|
54
54
|
*/
|
|
55
55
|
focus: () => {
|
|
56
56
|
return {
|
|
57
|
+
...(0, _base.baseSyntheticEvent)(),
|
|
57
58
|
nativeEvent: {
|
|
58
59
|
target: 0
|
|
59
|
-
}
|
|
60
|
-
currentTarget: {},
|
|
61
|
-
target: {}
|
|
60
|
+
}
|
|
62
61
|
};
|
|
63
62
|
},
|
|
64
63
|
/**
|
|
@@ -68,11 +67,10 @@ const CommonEventBuilder = exports.CommonEventBuilder = {
|
|
|
68
67
|
*/
|
|
69
68
|
blur: () => {
|
|
70
69
|
return {
|
|
70
|
+
...(0, _base.baseSyntheticEvent)(),
|
|
71
71
|
nativeEvent: {
|
|
72
72
|
target: 0
|
|
73
|
-
}
|
|
74
|
-
currentTarget: {},
|
|
75
|
-
target: {}
|
|
73
|
+
}
|
|
76
74
|
};
|
|
77
75
|
}
|
|
78
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":["touch","nativeEvent","changedTouches","identifier","locationX","locationY","pageX","pageY","target","timestamp","Date","now","touches","
|
|
1
|
+
{"version":3,"file":"common.js","names":["_base","require","touch","baseSyntheticEvent","nativeEvent","changedTouches","identifier","locationX","locationY","pageX","pageY","target","timestamp","Date","now","touches","currentTarget","measure","CommonEventBuilder","exports","responderGrant","dispatchConfig","registrationName","responderRelease","focus","blur"],"sources":["../../../src/user-event/event-builder/common.ts"],"sourcesContent":["import { baseSyntheticEvent } from './base';\n\n/**\n * Experimental values:\n * - iOS: `{\"changedTouches\": [[Circular]], \"identifier\": 1, \"locationX\": 253, \"locationY\": 30.333328247070312, \"pageX\": 273, \"pageY\": 141.3333282470703, \"target\": 75, \"timestamp\": 875928682.0450834, \"touches\": [[Circular]]}`\n * - Android: `{\"changedTouches\": [[Circular]], \"identifier\": 0, \"locationX\": 160, \"locationY\": 40.3636360168457, \"pageX\": 180, \"pageY\": 140.36363220214844, \"target\": 53, \"targetSurface\": -1, \"timestamp\": 10290805, \"touches\": [[Circular]]}`\n */\nfunction touch() {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: {\n changedTouches: [],\n identifier: 0,\n locationX: 0,\n locationY: 0,\n pageX: 0,\n pageY: 0,\n target: 0,\n timestamp: Date.now(),\n touches: [],\n },\n currentTarget: { measure: () => {} },\n };\n}\n\nexport const CommonEventBuilder = {\n touch,\n\n responderGrant: () => {\n return {\n ...touch(),\n dispatchConfig: { registrationName: 'onResponderGrant' },\n };\n },\n\n responderRelease: () => {\n return {\n ...touch(),\n dispatchConfig: { registrationName: 'onResponderRelease' },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 0, \"target\": 75, \"text\": \"\"}`\n * - Android: `{\"target\": 53}`\n */\n focus: () => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: {\n target: 0,\n },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 0, \"target\": 75, \"text\": \"\"}`\n * - Android: `{\"target\": 53}`\n */\n blur: () => {\n return {\n ...baseSyntheticEvent(),\n nativeEvent: {\n target: 0,\n },\n };\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAAA,EAAG;EACf,OAAO;IACL,GAAG,IAAAC,wBAAkB,EAAC,CAAC;IACvBC,WAAW,EAAE;MACXC,cAAc,EAAE,EAAE;MAClBC,UAAU,EAAE,CAAC;MACbC,SAAS,EAAE,CAAC;MACZC,SAAS,EAAE,CAAC;MACZC,KAAK,EAAE,CAAC;MACRC,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,aAAa,EAAE;MAAEC,OAAO,EAAEA,CAAA,KAAM,CAAC;IAAE;EACrC,CAAC;AACH;AAEO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChChB,KAAK;EAELkB,cAAc,EAAEA,CAAA,KAAM;IACpB,OAAO;MACL,GAAGlB,KAAK,CAAC,CAAC;MACVmB,cAAc,EAAE;QAAEC,gBAAgB,EAAE;MAAmB;IACzD,CAAC;EACH,CAAC;EAEDC,gBAAgB,EAAEA,CAAA,KAAM;IACtB,OAAO;MACL,GAAGrB,KAAK,CAAC,CAAC;MACVmB,cAAc,EAAE;QAAEC,gBAAgB,EAAE;MAAqB;IAC3D,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEE,KAAK,EAAEA,CAAA,KAAM;IACX,OAAO;MACL,GAAG,IAAArB,wBAAkB,EAAC,CAAC;MACvBC,WAAW,EAAE;Q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