@testing-library/react-native 12.1.3 → 12.2.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/.DS_Store +0 -0
- package/.eslintcache +1 -1
- package/build/fireEvent.js +3 -6
- package/build/fireEvent.js.map +1 -1
- package/build/helpers/deprecation.js +1 -1
- package/build/helpers/deprecation.js.map +1 -1
- package/build/helpers/host-component-names.d.ts +3 -0
- package/build/helpers/host-component-names.js +8 -0
- package/build/helpers/host-component-names.js.map +1 -1
- package/build/pure.d.ts +2 -0
- package/build/pure.js +7 -0
- package/build/pure.js.map +1 -1
- package/build/user-event/event-builder/common.d.ts +48 -6
- package/build/user-event/event-builder/common.js +37 -20
- package/build/user-event/event-builder/common.js.map +1 -1
- package/build/user-event/event-builder/index.d.ts +94 -0
- package/build/user-event/event-builder/index.js +3 -1
- package/build/user-event/event-builder/index.js.map +1 -1
- package/build/user-event/event-builder/text-input.d.ts +91 -0
- package/build/user-event/event-builder/text-input.js +117 -0
- package/build/user-event/event-builder/text-input.js.map +1 -0
- package/build/user-event/index.d.ts +4 -2
- package/build/user-event/index.js +7 -1
- package/build/user-event/index.js.map +1 -1
- package/build/user-event/press/index.d.ts +1 -1
- package/build/user-event/press/index.js +6 -0
- package/build/user-event/press/index.js.map +1 -1
- package/build/user-event/press/press.d.ts +3 -3
- package/build/user-event/press/press.js +55 -62
- package/build/user-event/press/press.js.map +1 -1
- package/build/user-event/setup/setup.d.ts +33 -3
- package/build/user-event/setup/setup.js +14 -1
- package/build/user-event/setup/setup.js.map +1 -1
- package/build/user-event/type/index.d.ts +1 -1
- package/build/user-event/type/index.js +6 -0
- package/build/user-event/type/index.js.map +1 -1
- package/build/user-event/type/parseKeys.d.ts +1 -0
- package/build/user-event/type/parseKeys.js +40 -0
- package/build/user-event/type/parseKeys.js.map +1 -0
- package/build/user-event/type/type.d.ts +5 -1
- package/build/user-event/type/type.js +66 -8
- package/build/user-event/type/type.js.map +1 -1
- package/build/user-event/utils/content-size.d.ts +15 -0
- package/build/user-event/utils/content-size.js +26 -0
- package/build/user-event/utils/content-size.js.map +1 -0
- package/build/user-event/utils/{events.d.ts → dispatch-event.d.ts} +2 -2
- package/build/user-event/utils/dispatch-event.js +36 -0
- package/build/user-event/utils/dispatch-event.js.map +1 -0
- package/build/user-event/utils/index.d.ts +4 -1
- package/build/user-event/utils/index.js +37 -4
- package/build/user-event/utils/index.js.map +1 -1
- package/build/user-event/utils/text-range.d.ts +5 -0
- package/build/user-event/utils/text-range.js +13 -0
- package/build/user-event/utils/text-range.js.map +1 -0
- package/build/user-event/utils/warn-about-real-timers.d.ts +1 -0
- package/build/user-event/utils/warn-about-real-timers.js +20 -0
- package/build/user-event/utils/warn-about-real-timers.js.map +1 -0
- package/coverage/clover.xml +1176 -0
- package/coverage/coverage-final.json +70 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +266 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/act.ts.html +343 -0
- package/coverage/lcov-report/src/cleanup.ts.html +130 -0
- package/coverage/lcov-report/src/config.ts.html +301 -0
- package/coverage/lcov-report/src/fireEvent.ts.html +559 -0
- package/coverage/lcov-report/src/flushMicroTasks.ts.html +124 -0
- package/coverage/lcov-report/src/helpers/accessiblity.ts.html +412 -0
- package/coverage/lcov-report/src/helpers/component-tree.ts.html +352 -0
- package/coverage/lcov-report/src/helpers/debugDeep.ts.html +166 -0
- package/coverage/lcov-report/src/helpers/debugShallow.ts.html +151 -0
- package/coverage/lcov-report/src/helpers/deprecation.ts.html +244 -0
- package/coverage/lcov-report/src/helpers/errors.ts.html +283 -0
- package/coverage/lcov-report/src/helpers/filterNodeByType.ts.html +106 -0
- package/coverage/lcov-report/src/helpers/findAll.ts.html +289 -0
- package/coverage/lcov-report/src/helpers/format-default.ts.html +301 -0
- package/coverage/lcov-report/src/helpers/format.ts.html +226 -0
- package/coverage/lcov-report/src/helpers/getTextContent.ts.html +145 -0
- package/coverage/lcov-report/src/helpers/host-component-names.tsx.html +286 -0
- package/coverage/lcov-report/src/helpers/index.html +326 -0
- package/coverage/lcov-report/src/helpers/matchers/accessibilityState.ts.html +229 -0
- package/coverage/lcov-report/src/helpers/matchers/accessibilityValue.ts.html +157 -0
- package/coverage/lcov-report/src/helpers/matchers/index.html +206 -0
- package/coverage/lcov-report/src/helpers/matchers/matchArrayProp.ts.html +148 -0
- package/coverage/lcov-report/src/helpers/matchers/matchLabelText.ts.html +238 -0
- package/coverage/lcov-report/src/helpers/matchers/matchObjectProp.ts.html +160 -0
- package/coverage/lcov-report/src/helpers/matchers/matchStringProp.ts.html +154 -0
- package/coverage/lcov-report/src/helpers/matchers/matchTextContent.ts.html +145 -0
- package/coverage/lcov-report/src/helpers/query-name.ts.html +97 -0
- package/coverage/lcov-report/src/helpers/stringValidation.ts.html +193 -0
- package/coverage/lcov-report/src/helpers/timers.ts.html +382 -0
- package/coverage/lcov-report/src/index.html +356 -0
- package/coverage/lcov-report/src/index.ts.html +184 -0
- package/coverage/lcov-report/src/matches.ts.html +232 -0
- package/coverage/lcov-report/src/pure.ts.html +157 -0
- package/coverage/lcov-report/src/queries/a11yState.ts.html +478 -0
- package/coverage/lcov-report/src/queries/a11yValue.ts.html +478 -0
- package/coverage/lcov-report/src/queries/displayValue.ts.html +319 -0
- package/coverage/lcov-report/src/queries/hintText.ts.html +421 -0
- package/coverage/lcov-report/src/queries/index.html +281 -0
- package/coverage/lcov-report/src/queries/labelText.ts.html +262 -0
- package/coverage/lcov-report/src/queries/makeQueries.ts.html +850 -0
- package/coverage/lcov-report/src/queries/placeholderText.ts.html +322 -0
- package/coverage/lcov-report/src/queries/role.ts.html +481 -0
- package/coverage/lcov-report/src/queries/testId.ts.html +298 -0
- package/coverage/lcov-report/src/queries/text.ts.html +283 -0
- package/coverage/lcov-report/src/queries/unsafeProps.ts.html +313 -0
- package/coverage/lcov-report/src/queries/unsafeType.ts.html +304 -0
- package/coverage/lcov-report/src/react-versions.ts.html +118 -0
- package/coverage/lcov-report/src/render-act.ts.html +142 -0
- package/coverage/lcov-report/src/render.tsx.html +592 -0
- package/coverage/lcov-report/src/renderHook.tsx.html +262 -0
- package/coverage/lcov-report/src/screen.ts.html +454 -0
- package/coverage/lcov-report/src/shallow.ts.html +139 -0
- package/coverage/lcov-report/src/test-utils/events.ts.html +145 -0
- package/coverage/lcov-report/src/test-utils/index.html +131 -0
- package/coverage/lcov-report/src/test-utils/index.ts.html +88 -0
- package/coverage/lcov-report/src/user-event/event-builder/common.ts.html +229 -0
- package/coverage/lcov-report/src/user-event/event-builder/index.html +146 -0
- package/coverage/lcov-report/src/user-event/event-builder/index.ts.html +106 -0
- package/coverage/lcov-report/src/user-event/event-builder/test-input.ts.html +343 -0
- package/coverage/lcov-report/src/user-event/event-builder/text-input.ts.html +343 -0
- package/coverage/lcov-report/src/user-event/index.html +116 -0
- package/coverage/lcov-report/src/user-event/index.ts.html +121 -0
- package/coverage/lcov-report/src/user-event/press/index.html +131 -0
- package/coverage/lcov-report/src/user-event/press/index.ts.html +88 -0
- package/coverage/lcov-report/src/user-event/press/press.ts.html +133 -0
- package/coverage/lcov-report/src/user-event/setup/index.html +131 -0
- package/coverage/lcov-report/src/user-event/setup/index.ts.html +91 -0
- package/coverage/lcov-report/src/user-event/setup/setup.ts.html +358 -0
- package/coverage/lcov-report/src/user-event/type/index.html +146 -0
- package/coverage/lcov-report/src/user-event/type/index.ts.html +88 -0
- package/coverage/lcov-report/src/user-event/type/parseKeys.ts.html +208 -0
- package/coverage/lcov-report/src/user-event/type/type.ts.html +484 -0
- package/coverage/lcov-report/src/user-event/utils/content-size.ts.html +160 -0
- package/coverage/lcov-report/src/user-event/utils/dispatch-event.ts.html +367 -0
- package/coverage/lcov-report/src/user-event/utils/events.ts.html +247 -0
- package/coverage/lcov-report/src/user-event/utils/index.html +176 -0
- package/coverage/lcov-report/src/user-event/utils/index.ts.html +97 -0
- package/coverage/lcov-report/src/user-event/utils/text-range.ts.html +118 -0
- package/coverage/lcov-report/src/user-event/utils/wait.ts.html +130 -0
- package/coverage/lcov-report/src/waitFor.ts.html +772 -0
- package/coverage/lcov-report/src/waitForElementToBeRemoved.ts.html +211 -0
- package/coverage/lcov-report/src/within.ts.html +175 -0
- package/coverage/lcov.info +2614 -0
- package/examples/.DS_Store +0 -0
- package/examples/basic/.expo/README.md +17 -0
- package/examples/basic/.expo/devices.json +3 -0
- package/examples/basic/.expo/packager-info.json +4 -0
- package/examples/basic/.expo/settings.json +8 -0
- package/examples/basic/package.json +7 -7
- package/examples/basic/yarn-error.log +8083 -0
- package/examples/basic/yarn.lock +8878 -0
- package/examples/react-navigation/README.md +2 -0
- package/examples/react-navigation/package.json +5 -5
- package/examples/react-navigation/yarn.lock +5610 -0
- package/examples/redux/README.md +5 -0
- package/examples/redux/package.json +7 -7
- package/examples/redux/yarn-error.log +8083 -0
- package/examples/redux/yarn.lock +8423 -0
- package/experiments-app/.expo/settings.json +2 -1
- package/experiments-app/src/screens/TextInputEvents.tsx +10 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/__tests__/.DS_Store +0 -0
- package/src/__tests__/act.test.tsx +4 -0
- package/src/fireEvent.ts +2 -6
- package/src/helpers/deprecation.ts +1 -1
- package/src/helpers/host-component-names.tsx +8 -0
- package/src/pure.ts +2 -0
- package/src/user-event/event-builder/common.ts +35 -19
- package/src/user-event/event-builder/index.ts +2 -0
- package/src/user-event/event-builder/text-input.ts +86 -0
- package/src/user-event/index.ts +6 -3
- package/src/user-event/press/__tests__/longPress.real-timers.test.tsx +4 -2
- package/src/user-event/press/__tests__/press.real-timers.test.tsx +4 -2
- package/src/user-event/press/__tests__/press.test.tsx +40 -5
- package/src/user-event/press/index.ts +1 -1
- package/src/user-event/press/press.ts +93 -58
- package/src/user-event/setup/setup.ts +39 -5
- package/src/user-event/type/__tests__/__snapshots__/type-managed.test.tsx.snap +339 -0
- package/src/user-event/type/__tests__/__snapshots__/type.test.tsx.snap +644 -2
- package/src/user-event/type/__tests__/parseKeys.test.ts +23 -0
- package/src/user-event/type/__tests__/type-managed.test.tsx +121 -0
- package/src/user-event/type/__tests__/type.test.tsx +300 -27
- package/src/user-event/type/index.ts +1 -1
- package/src/user-event/type/parseKeys.ts +41 -0
- package/src/user-event/type/type.ts +125 -10
- package/src/user-event/utils/__tests__/dispatch-event.test.tsx +41 -0
- package/src/user-event/utils/content-size.ts +25 -0
- package/src/user-event/utils/dispatch-event.ts +38 -0
- package/src/user-event/utils/index.ts +4 -1
- package/src/user-event/utils/text-range.ts +11 -0
- package/src/user-event/{press/utils/warnAboutRealTimers.ts → utils/warn-about-real-timers.ts} +8 -1
- package/website/.DS_Store +0 -0
- package/website/.docusaurus/DONT-EDIT-THIS-FOLDER +5 -0
- package/website/.docusaurus/client-modules.js +6 -0
- package/website/.docusaurus/codeTranslations.json +1 -0
- package/website/.docusaurus/docusaurus-plugin-content-blog/default/blog-post-list-prop-default.json +4 -0
- package/website/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json +4 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json +4 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-api-md-c82.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-eslint-p-llugin-testing-library-md-d24.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-faq-md-ad8.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-getting-started-md-8a6.json +23 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-how-should-i-query-md-f2d.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-migration-v-11-md-add.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-migration-v-12-md-14f.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-migration-v-2-md-698.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-migration-v-7-md-6bb.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-migration-v-9-md-f69.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-queries-md-7ad.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-react-navigation-md-1bd.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-redux-integration-md-77b.json +23 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-testing-environment-md-1c6.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-troubleshooting-md-01d.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-understanding-act-md-aa9.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-user-event-md-501.json +27 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/default/version-current-metadata-prop-751.json +268 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/react-native-testing-library-docs-route-96e.json +115 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-api-md-c82.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-eslint-p-llugin-testing-library-md-d24.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-faq-md-ad8.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-getting-started-md-8a6.json +15 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-how-should-i-query-md-f2d.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-migration-v-11-md-add.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-migration-v-2-md-698.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-migration-v-7-md-6bb.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-migration-v-9-md-f69.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-queries-md-7ad.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-react-navigation-md-1bd.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-redux-integration-md-77b.json +15 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-troubleshooting-md-01d.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-docs/site-docs-understanding-act-md-aa9.json +19 -0
- package/website/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json +4 -0
- package/website/.docusaurus/docusaurus-plugin-debug/default/docusaurus-debug-all-content-673.json +623 -0
- package/website/.docusaurus/docusaurus-plugin-debug/default/plugin-route-context-module-100.json +4 -0
- package/website/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json +4 -0
- package/website/.docusaurus/docusaurus.config.js +267 -0
- package/website/.docusaurus/docusaurus.config.mjs +365 -0
- package/website/.docusaurus/globalData.json +113 -0
- package/website/.docusaurus/i18n.json +17 -0
- package/website/.docusaurus/registry.js +35 -0
- package/website/.docusaurus/routes.js +162 -0
- package/website/.docusaurus/routesChunkNames.json +133 -0
- package/website/.docusaurus/site-metadata.json +36 -0
- package/website/docs/API.md +19 -25
- package/website/docs/UserEvent.md +86 -9
- package/website/sidebars.js +1 -1
- package/yarn-error.log +10613 -0
- package/build/user-event/press/utils/warnAboutRealTimers.d.ts +0 -1
- package/build/user-event/press/utils/warnAboutRealTimers.js +0 -14
- package/build/user-event/press/utils/warnAboutRealTimers.js.map +0 -1
- package/build/user-event/utils/events.js +0 -44
- package/build/user-event/utils/events.js.map +0 -1
- package/experiments-app/.expo/packager-info.json +0 -9
- package/src/user-event/utils/events.ts +0 -54
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.configureHostComponentNamesIfNeeded = configureHostComponentNamesIfNeeded;
|
|
7
7
|
exports.getHostComponentNames = getHostComponentNames;
|
|
8
|
+
exports.isHostText = isHostText;
|
|
9
|
+
exports.isHostTextInput = isHostTextInput;
|
|
8
10
|
var React = _interopRequireWildcard(require("react"));
|
|
9
11
|
var _reactNative = require("react-native");
|
|
10
12
|
var _config = require("../config");
|
|
@@ -59,4 +61,10 @@ function getByTestId(instance, testID) {
|
|
|
59
61
|
}
|
|
60
62
|
return nodes[0];
|
|
61
63
|
}
|
|
64
|
+
function isHostText(element) {
|
|
65
|
+
return element?.type === getHostComponentNames().text;
|
|
66
|
+
}
|
|
67
|
+
function isHostTextInput(element) {
|
|
68
|
+
return element?.type === getHostComponentNames().textInput;
|
|
69
|
+
}
|
|
62
70
|
//# sourceMappingURL=host-component-names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-component-names.js","names":["React","_interopRequireWildcard","require","_reactNative","_config","_renderAct","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","userConfigErrorMessage","getHostComponentNames","hostComponentNames","getConfig","detectHostComponentNames","configureInternal","configureHostComponentNamesIfNeeded","configHostComponentNames","renderer","renderWithAct","createElement","View","Text","testID","TextInput","Switch","text","getByTestId","root","type","textInput","switch","error","errorMessage","message","Error","instance","nodes","findAll","node","props","length"],"sources":["../../src/helpers/host-component-names.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport { Switch, Text, TextInput, View } from 'react-native';\nimport { configureInternal, getConfig, HostComponentNames } from '../config';\nimport { renderWithAct } from '../render-act';\n\nconst userConfigErrorMessage = `There seems to be an issue with your configuration that prevents React Native Testing Library from working correctly.\nPlease check if you are using compatible versions of React Native and React Native Testing Library.`;\n\nexport function getHostComponentNames(): HostComponentNames {\n let hostComponentNames = getConfig().hostComponentNames;\n if (!hostComponentNames) {\n hostComponentNames = detectHostComponentNames();\n configureInternal({ hostComponentNames });\n }\n\n return hostComponentNames;\n}\n\nexport function configureHostComponentNamesIfNeeded() {\n const configHostComponentNames = getConfig().hostComponentNames;\n if (configHostComponentNames) {\n return;\n }\n\n const hostComponentNames = detectHostComponentNames();\n configureInternal({ hostComponentNames });\n}\n\nfunction detectHostComponentNames(): HostComponentNames {\n try {\n const renderer = renderWithAct(\n <View>\n <Text testID=\"text\">Hello</Text>\n <TextInput testID=\"textInput\" />\n <Switch testID=\"switch\" />\n </View>\n );\n\n return {\n text: getByTestId(renderer.root, 'text').type as string,\n textInput: getByTestId(renderer.root, 'textInput').type as string,\n switch: getByTestId(renderer.root, 'switch').type as string,\n };\n } catch (error) {\n const errorMessage =\n error && typeof error === 'object' && 'message' in error\n ? error.message\n : null;\n\n throw new Error(\n `Trying to detect host component names triggered the following error:\\n\\n${errorMessage}\\n\\n${userConfigErrorMessage}`\n );\n }\n}\n\nfunction getByTestId(instance: ReactTestInstance, testID: string) {\n const nodes = instance.findAll(\n (node) => typeof node.type === 'string' && node.props.testID === testID\n );\n\n if (nodes.length === 0) {\n throw new Error(`Unable to find an element with testID: ${testID}`);\n }\n\n return nodes[0];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"host-component-names.js","names":["React","_interopRequireWildcard","require","_reactNative","_config","_renderAct","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","userConfigErrorMessage","getHostComponentNames","hostComponentNames","getConfig","detectHostComponentNames","configureInternal","configureHostComponentNamesIfNeeded","configHostComponentNames","renderer","renderWithAct","createElement","View","Text","testID","TextInput","Switch","text","getByTestId","root","type","textInput","switch","error","errorMessage","message","Error","instance","nodes","findAll","node","props","length","isHostText","element","isHostTextInput"],"sources":["../../src/helpers/host-component-names.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport { Switch, Text, TextInput, View } from 'react-native';\nimport { configureInternal, getConfig, HostComponentNames } from '../config';\nimport { renderWithAct } from '../render-act';\n\nconst userConfigErrorMessage = `There seems to be an issue with your configuration that prevents React Native Testing Library from working correctly.\nPlease check if you are using compatible versions of React Native and React Native Testing Library.`;\n\nexport function getHostComponentNames(): HostComponentNames {\n let hostComponentNames = getConfig().hostComponentNames;\n if (!hostComponentNames) {\n hostComponentNames = detectHostComponentNames();\n configureInternal({ hostComponentNames });\n }\n\n return hostComponentNames;\n}\n\nexport function configureHostComponentNamesIfNeeded() {\n const configHostComponentNames = getConfig().hostComponentNames;\n if (configHostComponentNames) {\n return;\n }\n\n const hostComponentNames = detectHostComponentNames();\n configureInternal({ hostComponentNames });\n}\n\nfunction detectHostComponentNames(): HostComponentNames {\n try {\n const renderer = renderWithAct(\n <View>\n <Text testID=\"text\">Hello</Text>\n <TextInput testID=\"textInput\" />\n <Switch testID=\"switch\" />\n </View>\n );\n\n return {\n text: getByTestId(renderer.root, 'text').type as string,\n textInput: getByTestId(renderer.root, 'textInput').type as string,\n switch: getByTestId(renderer.root, 'switch').type as string,\n };\n } catch (error) {\n const errorMessage =\n error && typeof error === 'object' && 'message' in error\n ? error.message\n : null;\n\n throw new Error(\n `Trying to detect host component names triggered the following error:\\n\\n${errorMessage}\\n\\n${userConfigErrorMessage}`\n );\n }\n}\n\nfunction getByTestId(instance: ReactTestInstance, testID: string) {\n const nodes = instance.findAll(\n (node) => typeof node.type === 'string' && node.props.testID === testID\n );\n\n if (nodes.length === 0) {\n throw new Error(`Unable to find an element with testID: ${testID}`);\n }\n\n return nodes[0];\n}\n\nexport function isHostText(element?: ReactTestInstance) {\n return element?.type === getHostComponentNames().text;\n}\n\nexport function isHostTextInput(element?: ReactTestInstance) {\n return element?.type === getHostComponentNames().textInput;\n}\n"],"mappings":"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"}
|
package/build/pure.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { isHiddenFromAccessibility, isInaccessible, } from './helpers/accessibli
|
|
|
10
10
|
export { getDefaultNormalizer } from './matches';
|
|
11
11
|
export { renderHook } from './renderHook';
|
|
12
12
|
export { screen } from './screen';
|
|
13
|
+
export { userEvent } from './user-event';
|
|
13
14
|
export type { RenderOptions, RenderResult, RenderResult as RenderAPI, DebugFunction, } from './render';
|
|
14
15
|
export type { RenderHookOptions, RenderHookResult } from './renderHook';
|
|
15
16
|
export type { Config } from './config';
|
|
17
|
+
export type { UserEventConfig } from './user-event';
|
package/build/pure.js
CHANGED
|
@@ -75,6 +75,12 @@ Object.defineProperty(exports, "screen", {
|
|
|
75
75
|
return _screen.screen;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
Object.defineProperty(exports, "userEvent", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _userEvent.userEvent;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
78
84
|
Object.defineProperty(exports, "waitFor", {
|
|
79
85
|
enumerable: true,
|
|
80
86
|
get: function () {
|
|
@@ -105,5 +111,6 @@ var _accessiblity = require("./helpers/accessiblity");
|
|
|
105
111
|
var _matches = require("./matches");
|
|
106
112
|
var _renderHook = require("./renderHook");
|
|
107
113
|
var _screen = require("./screen");
|
|
114
|
+
var _userEvent = require("./user-event");
|
|
108
115
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
109
116
|
//# sourceMappingURL=pure.js.map
|
package/build/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","names":["_act","_interopRequireDefault","require","_cleanup","_fireEvent","_render","_waitFor","_waitForElementToBeRemoved","_within","_config","_accessiblity","_matches","_renderHook","_screen","obj","__esModule","default"],"sources":["../src/pure.ts"],"sourcesContent":["export { default as act } from './act';\nexport { default as cleanup } from './cleanup';\nexport { default as fireEvent } from './fireEvent';\nexport { default as render } from './render';\nexport { default as waitFor } from './waitFor';\nexport { default as waitForElementToBeRemoved } from './waitForElementToBeRemoved';\nexport { within, getQueriesForElement } from './within';\n\nexport { configure, resetToDefaults } from './config';\nexport {\n isHiddenFromAccessibility,\n isInaccessible,\n} from './helpers/accessiblity';\nexport { getDefaultNormalizer } from './matches';\nexport { renderHook } from './renderHook';\nexport { screen } from './screen';\n\nexport type {\n RenderOptions,\n RenderResult,\n RenderResult as RenderAPI,\n DebugFunction,\n} from './render';\nexport type { RenderHookOptions, RenderHookResult } from './renderHook';\nexport type { Config } from './config';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pure.js","names":["_act","_interopRequireDefault","require","_cleanup","_fireEvent","_render","_waitFor","_waitForElementToBeRemoved","_within","_config","_accessiblity","_matches","_renderHook","_screen","_userEvent","obj","__esModule","default"],"sources":["../src/pure.ts"],"sourcesContent":["export { default as act } from './act';\nexport { default as cleanup } from './cleanup';\nexport { default as fireEvent } from './fireEvent';\nexport { default as render } from './render';\nexport { default as waitFor } from './waitFor';\nexport { default as waitForElementToBeRemoved } from './waitForElementToBeRemoved';\nexport { within, getQueriesForElement } from './within';\n\nexport { configure, resetToDefaults } from './config';\nexport {\n isHiddenFromAccessibility,\n isInaccessible,\n} from './helpers/accessiblity';\nexport { getDefaultNormalizer } from './matches';\nexport { renderHook } from './renderHook';\nexport { screen } from './screen';\nexport { userEvent } from './user-event';\n\nexport type {\n RenderOptions,\n RenderResult,\n RenderResult as RenderAPI,\n DebugFunction,\n} from './render';\nexport type { RenderHookOptions, RenderHookResult } from './renderHook';\nexport type { Config } from './config';\nexport type { UserEventConfig } from './user-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,0BAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAIA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AAAyC,SAAAD,uBAAAc,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
|
|
@@ -1,11 +1,52 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
+
/**
|
|
3
|
+
* Experimental values:
|
|
4
|
+
* - iOS: `{"changedTouches": [[Circular]], "identifier": 1, "locationX": 253, "locationY": 30.333328247070312, "pageX": 273, "pageY": 141.3333282470703, "target": 75, "timestamp": 875928682.0450834, "touches": [[Circular]]}`
|
|
5
|
+
* - Android: `{"changedTouches": [[Circular]], "identifier": 0, "locationX": 160, "locationY": 40.3636360168457, "pageX": 180, "pageY": 140.36363220214844, "target": 53, "targetSurface": -1, "timestamp": 10290805, "touches": [[Circular]]}`
|
|
6
|
+
*/
|
|
7
|
+
declare function touch(): {
|
|
8
|
+
persist: jest.Mock<any, any, any>;
|
|
9
|
+
currentTarget: {
|
|
10
|
+
measure: jest.Mock<any, any, any>;
|
|
11
|
+
};
|
|
12
|
+
nativeEvent: {
|
|
13
|
+
changedTouches: never[];
|
|
14
|
+
identifier: number;
|
|
15
|
+
locationX: number;
|
|
16
|
+
locationY: number;
|
|
17
|
+
pageX: number;
|
|
18
|
+
pageY: number;
|
|
19
|
+
target: number;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
touches: never[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
2
24
|
export declare const CommonEventBuilder: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
25
|
+
touch: typeof touch;
|
|
26
|
+
responderGrant: () => {
|
|
27
|
+
dispatchConfig: {
|
|
28
|
+
registrationName: string;
|
|
29
|
+
};
|
|
30
|
+
persist: jest.Mock<any, any, any>;
|
|
31
|
+
currentTarget: {
|
|
32
|
+
measure: jest.Mock<any, any, any>;
|
|
33
|
+
};
|
|
34
|
+
nativeEvent: {
|
|
35
|
+
changedTouches: never[];
|
|
36
|
+
identifier: number;
|
|
37
|
+
locationX: number;
|
|
38
|
+
locationY: number;
|
|
39
|
+
pageX: number;
|
|
40
|
+
pageY: number;
|
|
41
|
+
target: number;
|
|
42
|
+
timestamp: number;
|
|
43
|
+
touches: never[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
responderRelease: () => {
|
|
47
|
+
dispatchConfig: {
|
|
48
|
+
registrationName: string;
|
|
49
|
+
};
|
|
9
50
|
persist: jest.Mock<any, any, any>;
|
|
10
51
|
currentTarget: {
|
|
11
52
|
measure: jest.Mock<any, any, any>;
|
|
@@ -43,3 +84,4 @@ export declare const CommonEventBuilder: {
|
|
|
43
84
|
};
|
|
44
85
|
};
|
|
45
86
|
};
|
|
87
|
+
export {};
|
|
@@ -4,28 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CommonEventBuilder = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Experimental values:
|
|
9
|
+
* - iOS: `{"changedTouches": [[Circular]], "identifier": 1, "locationX": 253, "locationY": 30.333328247070312, "pageX": 273, "pageY": 141.3333282470703, "target": 75, "timestamp": 875928682.0450834, "touches": [[Circular]]}`
|
|
10
|
+
* - Android: `{"changedTouches": [[Circular]], "identifier": 0, "locationX": 160, "locationY": 40.3636360168457, "pageX": 180, "pageY": 140.36363220214844, "target": 53, "targetSurface": -1, "timestamp": 10290805, "touches": [[Circular]]}`
|
|
11
|
+
*/
|
|
12
|
+
function touch() {
|
|
13
|
+
return {
|
|
14
|
+
persist: jest.fn(),
|
|
15
|
+
currentTarget: {
|
|
16
|
+
measure: jest.fn()
|
|
17
|
+
},
|
|
18
|
+
nativeEvent: {
|
|
19
|
+
changedTouches: [],
|
|
20
|
+
identifier: 0,
|
|
21
|
+
locationX: 0,
|
|
22
|
+
locationY: 0,
|
|
23
|
+
pageX: 0,
|
|
24
|
+
pageY: 0,
|
|
25
|
+
target: 0,
|
|
26
|
+
timestamp: Date.now(),
|
|
27
|
+
touches: []
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
7
31
|
const CommonEventBuilder = {
|
|
8
|
-
|
|
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
|
-
* - Android: `{"changedTouches": [[Circular]], "identifier": 0, "locationX": 160, "locationY": 40.3636360168457, "pageX": 180, "pageY": 140.36363220214844, "target": 53, "targetSurface": -1, "timestamp": 10290805, "touches": [[Circular]]}`
|
|
12
|
-
*/
|
|
13
|
-
touch: () => {
|
|
32
|
+
touch,
|
|
33
|
+
responderGrant: () => {
|
|
14
34
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
target: 0,
|
|
27
|
-
timestamp: Date.now(),
|
|
28
|
-
touches: []
|
|
35
|
+
...touch(),
|
|
36
|
+
dispatchConfig: {
|
|
37
|
+
registrationName: 'onResponderGrant'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
responderRelease: () => {
|
|
42
|
+
return {
|
|
43
|
+
...touch(),
|
|
44
|
+
dispatchConfig: {
|
|
45
|
+
registrationName: 'onResponderRelease'
|
|
29
46
|
}
|
|
30
47
|
};
|
|
31
48
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":["
|
|
1
|
+
{"version":3,"file":"common.js","names":["touch","persist","jest","fn","currentTarget","measure","nativeEvent","changedTouches","identifier","locationX","locationY","pageX","pageY","target","timestamp","Date","now","touches","CommonEventBuilder","responderGrant","dispatchConfig","registrationName","responderRelease","focus","blur","exports"],"sources":["../../../src/user-event/event-builder/common.ts"],"sourcesContent":["/**\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 persist: jest.fn(),\n currentTarget: { measure: jest.fn() },\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 };\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 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 nativeEvent: {\n target: 0,\n },\n };\n },\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAKA,CAAA,EAAG;EACf,OAAO;IACLC,OAAO,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;IAClBC,aAAa,EAAE;MAAEC,OAAO,EAAEH,IAAI,CAACC,EAAE,CAAC;IAAE,CAAC;IACrCG,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;EACF,CAAC;AACH;AAEO,MAAMC,kBAAkB,GAAG;EAChClB,KAAK;EAELmB,cAAc,EAAEA,CAAA,KAAM;IACpB,OAAO;MACL,GAAGnB,KAAK,CAAC,CAAC;MACVoB,cAAc,EAAE;QAAEC,gBAAgB,EAAE;MAAmB;IACzD,CAAC;EACH,CAAC;EAEDC,gBAAgB,EAAEA,CAAA,KAAM;IACtB,OAAO;MACL,GAAGtB,KAAK,CAAC,CAAC;MACVoB,cAAc,EAAE;QAAEC,gBAAgB,EAAE;MAAqB;IAC3D,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEE,KAAK,EAAEA,CAAA,KAAM;IACX,OAAO;MACLjB,WAAW,EAAE;QACXO,MAAM,EAAE;MACV;IACF,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEW,IAAI,EAAEA,CAAA,KAAM;IACV,OAAO;MACLlB,WAAW,EAAE;QACXO,MAAM,EAAE;MACV;IACF,CAAC;EACH;AACF,CAAC;AAACY,OAAA,CAAAP,kBAAA,GAAAA,kBAAA"}
|
|
@@ -18,6 +18,46 @@ export declare const EventBuilder: {
|
|
|
18
18
|
touches: never[];
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
responderGrant: () => {
|
|
22
|
+
dispatchConfig: {
|
|
23
|
+
registrationName: string;
|
|
24
|
+
};
|
|
25
|
+
persist: jest.Mock<any, any, any>;
|
|
26
|
+
currentTarget: {
|
|
27
|
+
measure: jest.Mock<any, any, any>;
|
|
28
|
+
};
|
|
29
|
+
nativeEvent: {
|
|
30
|
+
changedTouches: never[];
|
|
31
|
+
identifier: number;
|
|
32
|
+
locationX: number;
|
|
33
|
+
locationY: number;
|
|
34
|
+
pageX: number;
|
|
35
|
+
pageY: number;
|
|
36
|
+
target: number;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
touches: never[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
responderRelease: () => {
|
|
42
|
+
dispatchConfig: {
|
|
43
|
+
registrationName: string;
|
|
44
|
+
};
|
|
45
|
+
persist: jest.Mock<any, any, any>;
|
|
46
|
+
currentTarget: {
|
|
47
|
+
measure: jest.Mock<any, any, any>;
|
|
48
|
+
};
|
|
49
|
+
nativeEvent: {
|
|
50
|
+
changedTouches: never[];
|
|
51
|
+
identifier: number;
|
|
52
|
+
locationX: number;
|
|
53
|
+
locationY: number;
|
|
54
|
+
pageX: number;
|
|
55
|
+
pageY: number;
|
|
56
|
+
target: number;
|
|
57
|
+
timestamp: number;
|
|
58
|
+
touches: never[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
21
61
|
focus: () => {
|
|
22
62
|
nativeEvent: {
|
|
23
63
|
target: number;
|
|
@@ -29,4 +69,58 @@ export declare const EventBuilder: {
|
|
|
29
69
|
};
|
|
30
70
|
};
|
|
31
71
|
};
|
|
72
|
+
TextInput: {
|
|
73
|
+
change: (text: string) => {
|
|
74
|
+
nativeEvent: {
|
|
75
|
+
text: string;
|
|
76
|
+
target: number;
|
|
77
|
+
eventCount: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
keyPress: (key: string) => {
|
|
81
|
+
nativeEvent: {
|
|
82
|
+
key: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
submitEditing: (text: string) => {
|
|
86
|
+
nativeEvent: {
|
|
87
|
+
text: string;
|
|
88
|
+
target: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
endEditing: (text: string) => {
|
|
92
|
+
nativeEvent: {
|
|
93
|
+
text: string;
|
|
94
|
+
target: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
selectionChange: ({ start, end }: import("../utils").TextRange) => {
|
|
98
|
+
nativeEvent: {
|
|
99
|
+
selection: {
|
|
100
|
+
start: number;
|
|
101
|
+
end: number;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
textInput: (text: string, previousText: string) => {
|
|
106
|
+
nativeEvent: {
|
|
107
|
+
text: string;
|
|
108
|
+
previousText: string;
|
|
109
|
+
range: {
|
|
110
|
+
start: number;
|
|
111
|
+
end: number;
|
|
112
|
+
};
|
|
113
|
+
target: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
contentSizeChange: ({ width, height }: import("../utils").ContentSize) => {
|
|
117
|
+
nativeEvent: {
|
|
118
|
+
contentSize: {
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
};
|
|
122
|
+
target: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
32
126
|
};
|
|
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.EventBuilder = void 0;
|
|
7
7
|
var _common = require("./common");
|
|
8
|
+
var _textInput = require("./text-input");
|
|
8
9
|
const EventBuilder = {
|
|
9
|
-
Common: _common.CommonEventBuilder
|
|
10
|
+
Common: _common.CommonEventBuilder,
|
|
11
|
+
TextInput: _textInput.TextInputEventBuilder
|
|
10
12
|
};
|
|
11
13
|
exports.EventBuilder = EventBuilder;
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_common","require","EventBuilder","Common","CommonEventBuilder","exports"],"sources":["../../../src/user-event/event-builder/index.ts"],"sourcesContent":["import { CommonEventBuilder } from './common';\n\nexport const EventBuilder = {\n Common: CommonEventBuilder,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_common","require","_textInput","EventBuilder","Common","CommonEventBuilder","TextInput","TextInputEventBuilder","exports"],"sources":["../../../src/user-event/event-builder/index.ts"],"sourcesContent":["import { CommonEventBuilder } from './common';\nimport { TextInputEventBuilder } from './text-input';\n\nexport const EventBuilder = {\n Common: CommonEventBuilder,\n TextInput: TextInputEventBuilder,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,YAAY,GAAG;EAC1BC,MAAM,EAAEC,0BAAkB;EAC1BC,SAAS,EAAEC;AACb,CAAC;AAACC,OAAA,CAAAL,YAAA,GAAAA,YAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ContentSize } from '../utils/content-size';
|
|
2
|
+
import { TextRange } from '../utils/text-range';
|
|
3
|
+
export declare const TextInputEventBuilder: {
|
|
4
|
+
/**
|
|
5
|
+
* Experimental values:
|
|
6
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
7
|
+
* - Android: `{"eventCount": 6, "target": 53, "text": "Tes"}`
|
|
8
|
+
*/
|
|
9
|
+
change: (text: string) => {
|
|
10
|
+
nativeEvent: {
|
|
11
|
+
text: string;
|
|
12
|
+
target: number;
|
|
13
|
+
eventCount: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Experimental values:
|
|
18
|
+
* - iOS: `{"eventCount": 3, "key": "a", "target": 75}`
|
|
19
|
+
* - Android: `{"key": "a"}`
|
|
20
|
+
*/
|
|
21
|
+
keyPress: (key: string) => {
|
|
22
|
+
nativeEvent: {
|
|
23
|
+
key: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Experimental values:
|
|
28
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
29
|
+
* - Android: `{"target": 53, "text": "Test"}`
|
|
30
|
+
*/
|
|
31
|
+
submitEditing: (text: string) => {
|
|
32
|
+
nativeEvent: {
|
|
33
|
+
text: string;
|
|
34
|
+
target: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Experimental values:
|
|
39
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
40
|
+
* - Android: `{"target": 53, "text": "Test"}`
|
|
41
|
+
*/
|
|
42
|
+
endEditing: (text: string) => {
|
|
43
|
+
nativeEvent: {
|
|
44
|
+
text: string;
|
|
45
|
+
target: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Experimental values:
|
|
50
|
+
* - iOS: `{"selection": {"end": 4, "start": 4}, "target": 75}`
|
|
51
|
+
* - Android: `{"selection": {"end": 4, "start": 4}}`
|
|
52
|
+
*/
|
|
53
|
+
selectionChange: ({ start, end }: TextRange) => {
|
|
54
|
+
nativeEvent: {
|
|
55
|
+
selection: {
|
|
56
|
+
start: number;
|
|
57
|
+
end: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Experimental values:
|
|
63
|
+
* - iOS: `{"eventCount": 2, "previousText": "Te", "range": {"end": 2, "start": 2}, "target": 75, "text": "s"}`
|
|
64
|
+
* - Android: `{"previousText": "Te", "range": {"end": 2, "start": 0}, "target": 53, "text": "Tes"}`
|
|
65
|
+
*/
|
|
66
|
+
textInput: (text: string, previousText: string) => {
|
|
67
|
+
nativeEvent: {
|
|
68
|
+
text: string;
|
|
69
|
+
previousText: string;
|
|
70
|
+
range: {
|
|
71
|
+
start: number;
|
|
72
|
+
end: number;
|
|
73
|
+
};
|
|
74
|
+
target: number;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Experimental values:
|
|
79
|
+
* - iOS: `{"contentSize": {"height": 21.666666666666668, "width": 11.666666666666666}, "target": 75}`
|
|
80
|
+
* - Android: `{"contentSize": {"height": 61.45454406738281, "width": 352.7272644042969}, "target": 53}`
|
|
81
|
+
*/
|
|
82
|
+
contentSizeChange: ({ width, height }: ContentSize) => {
|
|
83
|
+
nativeEvent: {
|
|
84
|
+
contentSize: {
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
87
|
+
};
|
|
88
|
+
target: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TextInputEventBuilder = void 0;
|
|
7
|
+
const TextInputEventBuilder = {
|
|
8
|
+
/**
|
|
9
|
+
* Experimental values:
|
|
10
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
11
|
+
* - Android: `{"eventCount": 6, "target": 53, "text": "Tes"}`
|
|
12
|
+
*/
|
|
13
|
+
change: text => {
|
|
14
|
+
return {
|
|
15
|
+
nativeEvent: {
|
|
16
|
+
text,
|
|
17
|
+
target: 0,
|
|
18
|
+
eventCount: 0
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Experimental values:
|
|
24
|
+
* - iOS: `{"eventCount": 3, "key": "a", "target": 75}`
|
|
25
|
+
* - Android: `{"key": "a"}`
|
|
26
|
+
*/
|
|
27
|
+
keyPress: key => {
|
|
28
|
+
return {
|
|
29
|
+
nativeEvent: {
|
|
30
|
+
key
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Experimental values:
|
|
36
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
37
|
+
* - Android: `{"target": 53, "text": "Test"}`
|
|
38
|
+
*/
|
|
39
|
+
submitEditing: text => {
|
|
40
|
+
return {
|
|
41
|
+
nativeEvent: {
|
|
42
|
+
text,
|
|
43
|
+
target: 0
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Experimental values:
|
|
49
|
+
* - iOS: `{"eventCount": 4, "target": 75, "text": "Test"}`
|
|
50
|
+
* - Android: `{"target": 53, "text": "Test"}`
|
|
51
|
+
*/
|
|
52
|
+
endEditing: text => {
|
|
53
|
+
return {
|
|
54
|
+
nativeEvent: {
|
|
55
|
+
text,
|
|
56
|
+
target: 0
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Experimental values:
|
|
62
|
+
* - iOS: `{"selection": {"end": 4, "start": 4}, "target": 75}`
|
|
63
|
+
* - Android: `{"selection": {"end": 4, "start": 4}}`
|
|
64
|
+
*/
|
|
65
|
+
selectionChange: ({
|
|
66
|
+
start,
|
|
67
|
+
end
|
|
68
|
+
}) => {
|
|
69
|
+
return {
|
|
70
|
+
nativeEvent: {
|
|
71
|
+
selection: {
|
|
72
|
+
start,
|
|
73
|
+
end
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Experimental values:
|
|
80
|
+
* - iOS: `{"eventCount": 2, "previousText": "Te", "range": {"end": 2, "start": 2}, "target": 75, "text": "s"}`
|
|
81
|
+
* - Android: `{"previousText": "Te", "range": {"end": 2, "start": 0}, "target": 53, "text": "Tes"}`
|
|
82
|
+
*/
|
|
83
|
+
textInput: (text, previousText) => {
|
|
84
|
+
return {
|
|
85
|
+
nativeEvent: {
|
|
86
|
+
text,
|
|
87
|
+
previousText,
|
|
88
|
+
range: {
|
|
89
|
+
start: text.length,
|
|
90
|
+
end: text.length
|
|
91
|
+
},
|
|
92
|
+
target: 0
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Experimental values:
|
|
98
|
+
* - iOS: `{"contentSize": {"height": 21.666666666666668, "width": 11.666666666666666}, "target": 75}`
|
|
99
|
+
* - Android: `{"contentSize": {"height": 61.45454406738281, "width": 352.7272644042969}, "target": 53}`
|
|
100
|
+
*/
|
|
101
|
+
contentSizeChange: ({
|
|
102
|
+
width,
|
|
103
|
+
height
|
|
104
|
+
}) => {
|
|
105
|
+
return {
|
|
106
|
+
nativeEvent: {
|
|
107
|
+
contentSize: {
|
|
108
|
+
width,
|
|
109
|
+
height
|
|
110
|
+
},
|
|
111
|
+
target: 0
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.TextInputEventBuilder = TextInputEventBuilder;
|
|
117
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input.js","names":["TextInputEventBuilder","change","text","nativeEvent","target","eventCount","keyPress","key","submitEditing","endEditing","selectionChange","start","end","selection","textInput","previousText","range","length","contentSizeChange","width","height","contentSize","exports"],"sources":["../../../src/user-event/event-builder/text-input.ts"],"sourcesContent":["import { ContentSize } from '../utils/content-size';\nimport { TextRange } from '../utils/text-range';\n\nexport const TextInputEventBuilder = {\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"eventCount\": 6, \"target\": 53, \"text\": \"Tes\"}`\n */\n change: (text: string) => {\n return {\n nativeEvent: { text, target: 0, eventCount: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 3, \"key\": \"a\", \"target\": 75}`\n * - Android: `{\"key\": \"a\"}`\n */\n keyPress: (key: string) => {\n return {\n nativeEvent: { key },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n submitEditing: (text: string) => {\n return {\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 4, \"target\": 75, \"text\": \"Test\"}`\n * - Android: `{\"target\": 53, \"text\": \"Test\"}`\n */\n endEditing: (text: string) => {\n return {\n nativeEvent: { text, target: 0 },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"selection\": {\"end\": 4, \"start\": 4}, \"target\": 75}`\n * - Android: `{\"selection\": {\"end\": 4, \"start\": 4}}`\n */\n selectionChange: ({ start, end }: TextRange) => {\n return {\n nativeEvent: { selection: { start, end } },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"eventCount\": 2, \"previousText\": \"Te\", \"range\": {\"end\": 2, \"start\": 2}, \"target\": 75, \"text\": \"s\"}`\n * - Android: `{\"previousText\": \"Te\", \"range\": {\"end\": 2, \"start\": 0}, \"target\": 53, \"text\": \"Tes\"}`\n */\n textInput: (text: string, previousText: string) => {\n return {\n nativeEvent: {\n text,\n previousText,\n range: { start: text.length, end: text.length },\n target: 0,\n },\n };\n },\n\n /**\n * Experimental values:\n * - iOS: `{\"contentSize\": {\"height\": 21.666666666666668, \"width\": 11.666666666666666}, \"target\": 75}`\n * - Android: `{\"contentSize\": {\"height\": 61.45454406738281, \"width\": 352.7272644042969}, \"target\": 53}`\n */\n contentSizeChange: ({ width, height }: ContentSize) => {\n return {\n nativeEvent: { contentSize: { width, height }, target: 0 },\n };\n },\n};\n"],"mappings":";;;;;;AAGO,MAAMA,qBAAqB,GAAG;EACnC;AACF;AACA;AACA;AACA;EACEC,MAAM,EAAGC,IAAY,IAAK;IACxB,OAAO;MACLC,WAAW,EAAE;QAAED,IAAI;QAAEE,MAAM,EAAE,CAAC;QAAEC,UAAU,EAAE;MAAE;IAChD,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,QAAQ,EAAGC,GAAW,IAAK;IACzB,OAAO;MACLJ,WAAW,EAAE;QAAEI;MAAI;IACrB,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,aAAa,EAAGN,IAAY,IAAK;IAC/B,OAAO;MACLC,WAAW,EAAE;QAAED,IAAI;QAAEE,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEK,UAAU,EAAGP,IAAY,IAAK;IAC5B,OAAO;MACLC,WAAW,EAAE;QAAED,IAAI;QAAEE,MAAM,EAAE;MAAE;IACjC,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEM,eAAe,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAe,CAAC,KAAK;IAC9C,OAAO;MACLT,WAAW,EAAE;QAAEU,SAAS,EAAE;UAAEF,KAAK;UAAEC;QAAI;MAAE;IAC3C,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEE,SAAS,EAAEA,CAACZ,IAAY,EAAEa,YAAoB,KAAK;IACjD,OAAO;MACLZ,WAAW,EAAE;QACXD,IAAI;QACJa,YAAY;QACZC,KAAK,EAAE;UAAEL,KAAK,EAAET,IAAI,CAACe,MAAM;UAAEL,GAAG,EAAEV,IAAI,CAACe;QAAO,CAAC;QAC/Cb,MAAM,EAAE;MACV;IACF,CAAC;EACH,CAAC;EAED;AACF;AACA;AACA;AACA;EACEc,iBAAiB,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAoB,CAAC,KAAK;IACrD,OAAO;MACLjB,WAAW,EAAE;QAAEkB,WAAW,EAAE;UAAEF,KAAK;UAAEC;QAAO,CAAC;QAAEhB,MAAM,EAAE;MAAE;IAC3D,CAAC;EACH;AACF,CAAC;AAACkB,OAAA,CAAAtB,qBAAA,GAAAA,qBAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactTestInstance } from 'react-test-renderer';
|
|
2
2
|
import { setup } from './setup';
|
|
3
|
-
import { PressOptions } from './press
|
|
3
|
+
import { PressOptions } from './press';
|
|
4
|
+
import { TypeOptions } from './type';
|
|
5
|
+
export { UserEventConfig } from './setup';
|
|
4
6
|
export declare const userEvent: {
|
|
5
7
|
setup: typeof setup;
|
|
6
8
|
press: (element: ReactTestInstance) => Promise<void>;
|
|
7
9
|
longPress: (element: ReactTestInstance, options?: PressOptions) => Promise<void>;
|
|
8
|
-
type: (element: ReactTestInstance, text: string) => Promise<void>;
|
|
10
|
+
type: (element: ReactTestInstance, text: string, options?: TypeOptions) => Promise<void>;
|
|
9
11
|
};
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "UserEventConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _setup.UserEventConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
exports.userEvent = void 0;
|
|
7
13
|
var _setup = require("./setup");
|
|
8
14
|
const userEvent = {
|
|
@@ -10,7 +16,7 @@ const userEvent = {
|
|
|
10
16
|
// Direct access for User Event v13 compatibility
|
|
11
17
|
press: element => (0, _setup.setup)().press(element),
|
|
12
18
|
longPress: (element, options) => (0, _setup.setup)().longPress(element, options),
|
|
13
|
-
type: (element, text) => (0, _setup.setup)().type(element, text)
|
|
19
|
+
type: (element, text, options) => (0, _setup.setup)().type(element, text, options)
|
|
14
20
|
};
|
|
15
21
|
exports.userEvent = userEvent;
|
|
16
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_setup","require","userEvent","setup","press","element","longPress","options","type","text","exports"],"sources":["../../src/user-event/index.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { setup } from './setup';\nimport { PressOptions } from './press
|
|
1
|
+
{"version":3,"file":"index.js","names":["_setup","require","userEvent","setup","press","element","longPress","options","type","text","exports"],"sources":["../../src/user-event/index.ts"],"sourcesContent":["import { ReactTestInstance } from 'react-test-renderer';\nimport { setup } from './setup';\nimport { PressOptions } from './press';\nimport { TypeOptions } from './type';\n\nexport { UserEventConfig } from './setup';\n\nexport const userEvent = {\n setup,\n\n // Direct access for User Event v13 compatibility\n press: (element: ReactTestInstance) => setup().press(element),\n longPress: (element: ReactTestInstance, options?: PressOptions) =>\n setup().longPress(element, options),\n type: (element: ReactTestInstance, text: string, options?: TypeOptions) =>\n setup().type(element, text, options),\n};\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAALA,YAAK;EAEL;EACAC,KAAK,EAAGC,OAA0B,IAAK,IAAAF,YAAK,EAAC,CAAC,CAACC,KAAK,CAACC,OAAO,CAAC;EAC7DC,SAAS,EAAEA,CAACD,OAA0B,EAAEE,OAAsB,KAC5D,IAAAJ,YAAK,EAAC,CAAC,CAACG,SAAS,CAACD,OAAO,EAAEE,OAAO,CAAC;EACrCC,IAAI,EAAEA,CAACH,OAA0B,EAAEI,IAAY,EAAEF,OAAqB,KACpE,IAAAJ,YAAK,EAAC,CAAC,CAACK,IAAI,CAACH,OAAO,EAAEI,IAAI,EAAEF,OAAO;AACvC,CAAC;AAACG,OAAA,CAAAR,SAAA,GAAAA,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { press, longPress } from './press';
|
|
1
|
+
export { PressOptions, press, longPress } from './press';
|