@testing-library/react-native 13.0.1 → 13.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/event-handler.d.ts +7 -0
- package/build/event-handler.js +30 -0
- package/build/event-handler.js.map +1 -0
- package/build/fire-event.js +4 -14
- package/build/fire-event.js.map +1 -1
- package/build/helpers/accessibility.js.map +1 -1
- package/build/helpers/component-tree.js.map +1 -1
- package/build/helpers/debug.js.map +1 -1
- package/build/helpers/ensure-peer-deps.d.ts +3 -0
- package/build/helpers/ensure-peer-deps.js +32 -0
- package/build/helpers/ensure-peer-deps.js.map +1 -0
- package/build/helpers/find-all.js.map +1 -1
- package/build/helpers/format-element.js.map +1 -1
- package/build/helpers/host-component-names.js.map +1 -1
- package/build/helpers/map-props.js.map +1 -1
- package/build/helpers/matchers/match-accessibility-state.js.map +1 -1
- package/build/helpers/matchers/match-accessibility-value.js.map +1 -1
- package/build/helpers/matchers/match-label-text.js.map +1 -1
- package/build/helpers/matchers/match-text-content.js.map +1 -1
- package/build/helpers/pointer-events.js.map +1 -1
- package/build/helpers/text-input.js.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build/matchers/to-be-busy.js.map +1 -1
- package/build/matchers/to-be-checked.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.map +1 -1
- package/build/matchers/to-be-on-the-screen.js.map +1 -1
- package/build/matchers/to-be-partially-checked.js.map +1 -1
- package/build/matchers/to-be-selected.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/build/native-state.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/placeholder-text.js.map +1 -1
- 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/render-act.js.map +1 -1
- package/build/render-hook.js.map +1 -1
- package/build/render.js.map +1 -1
- package/build/screen.js.map +1 -1
- package/build/tsconfig.release.tsbuildinfo +1 -1
- package/build/user-event/clear.js.map +1 -1
- package/build/user-event/index.js.map +1 -1
- package/build/user-event/paste.js.map +1 -1
- package/build/user-event/press/press.js +41 -41
- package/build/user-event/press/press.js.map +1 -1
- package/build/user-event/scroll/scroll-to.js.map +1 -1
- package/build/user-event/setup/setup.js.map +1 -1
- package/build/user-event/type/type.js.map +1 -1
- package/build/user-event/utils/dispatch-event.js +2 -12
- package/build/user-event/utils/dispatch-event.js.map +1 -1
- package/build/within.js.map +1 -1
- package/package.json +9 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","names":["_timers","require","_wrapAsync","_clear","_paste","_press","_scroll","_type","_utils","universalJestAdvanceTimersBy","ms","jestFakeTimersAreEnabled","jest","advanceTimersByTime","Promise","resolve","defaultOptions","delay","advanceTimers","setup","options","config","createConfig","instance","createInstance","api","press","wrapAndBindImpl","longPress","type","clear","paste","scrollTo","Object","assign","impl","method","args","wrapAsync","apply","then","result","wait","defineProperty","get","name"],"sources":["../../../src/user-event/setup/setup.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { jestFakeTimersAreEnabled } from '../../helpers/timers';\nimport { wrapAsync } from '../../helpers/wrap-async';\nimport { clear } from '../clear';\nimport { paste } from '../paste';\nimport type { PressOptions } from '../press';\nimport { longPress, press } from '../press';\nimport type { ScrollToOptions } from '../scroll';\nimport { scrollTo } from '../scroll';\nimport type { TypeOptions } from '../type';\nimport { type } from '../type';\nimport { wait } from '../utils';\n\nexport interface UserEventSetupOptions {\n /**\n * Between some subsequent inputs like typing a series of characters\n * the code execution is delayed per `setTimeout` for (at least) `delay` seconds.\n * This moves the next changes at least to next macro task\n * and allows other (asynchronous) code to run between events.\n *\n * `null` prevents `setTimeout` from being called.\n *\n * @default 0\n */\n delay?: number;\n\n /**\n * Function to be called to advance fake timers. Setting it is necessary for\n * fake timers to work.\n *\n * @example jest.advanceTimersByTime\n */\n advanceTimers?: (delay: number) => Promise<void> | void;\n}\n\n/**\n * This functions allow wait to work correctly under both real and fake Jest timers.\n */\nfunction universalJestAdvanceTimersBy(ms: number) {\n if (jestFakeTimersAreEnabled()) {\n return jest.advanceTimersByTime(ms);\n } else {\n return Promise.resolve();\n }\n}\n\nconst defaultOptions: Required<UserEventSetupOptions> = {\n delay: 0,\n advanceTimers: universalJestAdvanceTimersBy,\n};\n\n/**\n * Creates a new instance of user event instance with the given options.\n *\n * @param options\n * @returns UserEvent instance\n */\nexport function setup(options?: UserEventSetupOptions) {\n const config = createConfig(options);\n const instance = createInstance(config);\n return instance;\n}\n\n/**\n * Options affecting all user event interactions.\n *\n * @param delay between some subsequent inputs like typing a series of characters\n * @param advanceTimers function to be called to advance fake timers\n */\nexport interface UserEventConfig {\n delay: number;\n advanceTimers: (delay: number) => Promise<void> | void;\n}\n\nfunction createConfig(options?: UserEventSetupOptions): UserEventConfig {\n return {\n ...defaultOptions,\n ...options,\n };\n}\n\n/**\n * UserEvent instance used to invoke user interaction functions.\n */\nexport interface UserEventInstance {\n config: UserEventConfig;\n\n press: (element: ReactTestInstance) => Promise<void>;\n longPress: (element: ReactTestInstance, options?: PressOptions) => Promise<void>;\n\n /**\n * Simulate user pressing on a given `TextInput` element and typing given text.\n *\n * This method will trigger the events for each character of the text:\n * `keyPress`, `change`, `changeText`, `endEditing`, etc.\n *\n * It will also trigger events connected with entering and leaving the text\n * input.\n *\n * The exact events sent depend on the props of the TextInput (`editable`,\n * `multiline`, etc) and passed options.\n *\n * @param element TextInput element to type on\n * @param text Text to type\n * @param options Options affecting typing behavior:\n * - `skipPress` - if true, `pressIn` and `pressOut` events will not be\n * triggered.\n * - `submitEditing` - if true, `submitEditing` event will be triggered after\n * typing the text.\n */\n type: (element: ReactTestInstance, text: string, options?: TypeOptions) => Promise<void>;\n\n /**\n * Simulate user clearing the text of a given `TextInput` element.\n *\n * This method will simulate:\n * 1. entering TextInput\n * 2. selecting all text\n * 3. pressing backspace to delete all text\n * 4. leaving TextInput\n *\n * @param element TextInput element to clear\n */\n clear: (element: ReactTestInstance) => Promise<void>;\n\n /**\n * Simulate user pasting the text to a given `TextInput` element.\n *\n * This method will simulate:\n * 1. entering TextInput\n * 2. selecting all text\n * 3. paste the text\n * 4. leaving TextInput\n *\n * @param element TextInput element to paste to\n */\n paste: (element: ReactTestInstance, text: string) => Promise<void>;\n\n /**\n * Simlate user scorlling a ScrollView element.\n *\n * @param element ScrollView element\n * @returns\n */\n scrollTo: (element: ReactTestInstance, options: ScrollToOptions) => Promise<void>;\n}\n\nfunction createInstance(config: UserEventConfig): UserEventInstance {\n const instance = {\n config,\n } as UserEventInstance;\n\n // Bind interactions to given User Event instance.\n const api = {\n press: wrapAndBindImpl(instance, press),\n longPress: wrapAndBindImpl(instance, longPress),\n type: wrapAndBindImpl(instance, type),\n clear: wrapAndBindImpl(instance, clear),\n paste: wrapAndBindImpl(instance, paste),\n scrollTo: wrapAndBindImpl(instance, scrollTo),\n };\n\n Object.assign(instance, api);\n return instance;\n}\n\n/**\n * Wraps user interaction with `wrapAsync` (temporarily disable `act` environment while\n * calling & resolving the async callback, then flush the microtask queue)\n *\n * This implementation is sourced from `testing-library/user-event`\n * @see https://github.com/testing-library/user-event/blob/7a305dee9ab833d6f338d567fc2e862b4838b76a/src/setup/setup.ts#L121\n */\nfunction wrapAndBindImpl<\n Args extends never[],\n Impl extends (this: UserEventInstance, ...args: Args) => Promise<unknown>,\n>(instance: UserEventInstance, impl: Impl) {\n function method(...args: Args) {\n return wrapAsync(() =>\n // eslint-disable-next-line promise/prefer-await-to-then\n impl.apply(instance, args).then(async (result) => {\n await wait(instance.config);\n return result;\n }),\n );\n }\n\n // Copy implementation name to the returned function\n Object.defineProperty(method, 'name', { get: () => impl.name });\n\n return method as Impl;\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"setup.js","names":["_timers","require","_wrapAsync","_clear","_paste","_press","_scroll","_type","_utils","universalJestAdvanceTimersBy","ms","jestFakeTimersAreEnabled","jest","advanceTimersByTime","Promise","resolve","defaultOptions","delay","advanceTimers","setup","options","config","createConfig","instance","createInstance","api","press","wrapAndBindImpl","longPress","type","clear","paste","scrollTo","Object","assign","impl","method","args","wrapAsync","apply","then","result","wait","defineProperty","get","name"],"sources":["../../../src/user-event/setup/setup.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { jestFakeTimersAreEnabled } from '../../helpers/timers';\nimport { wrapAsync } from '../../helpers/wrap-async';\nimport { clear } from '../clear';\nimport { paste } from '../paste';\nimport type { PressOptions } from '../press';\nimport { longPress, press } from '../press';\nimport type { ScrollToOptions } from '../scroll';\nimport { scrollTo } from '../scroll';\nimport type { TypeOptions } from '../type';\nimport { type } from '../type';\nimport { wait } from '../utils';\n\nexport interface UserEventSetupOptions {\n /**\n * Between some subsequent inputs like typing a series of characters\n * the code execution is delayed per `setTimeout` for (at least) `delay` seconds.\n * This moves the next changes at least to next macro task\n * and allows other (asynchronous) code to run between events.\n *\n * `null` prevents `setTimeout` from being called.\n *\n * @default 0\n */\n delay?: number;\n\n /**\n * Function to be called to advance fake timers. Setting it is necessary for\n * fake timers to work.\n *\n * @example jest.advanceTimersByTime\n */\n advanceTimers?: (delay: number) => Promise<void> | void;\n}\n\n/**\n * This functions allow wait to work correctly under both real and fake Jest timers.\n */\nfunction universalJestAdvanceTimersBy(ms: number) {\n if (jestFakeTimersAreEnabled()) {\n return jest.advanceTimersByTime(ms);\n } else {\n return Promise.resolve();\n }\n}\n\nconst defaultOptions: Required<UserEventSetupOptions> = {\n delay: 0,\n advanceTimers: universalJestAdvanceTimersBy,\n};\n\n/**\n * Creates a new instance of user event instance with the given options.\n *\n * @param options\n * @returns UserEvent instance\n */\nexport function setup(options?: UserEventSetupOptions) {\n const config = createConfig(options);\n const instance = createInstance(config);\n return instance;\n}\n\n/**\n * Options affecting all user event interactions.\n *\n * @param delay between some subsequent inputs like typing a series of characters\n * @param advanceTimers function to be called to advance fake timers\n */\nexport interface UserEventConfig {\n delay: number;\n advanceTimers: (delay: number) => Promise<void> | void;\n}\n\nfunction createConfig(options?: UserEventSetupOptions): UserEventConfig {\n return {\n ...defaultOptions,\n ...options,\n };\n}\n\n/**\n * UserEvent instance used to invoke user interaction functions.\n */\nexport interface UserEventInstance {\n config: UserEventConfig;\n\n press: (element: ReactTestInstance) => Promise<void>;\n longPress: (element: ReactTestInstance, options?: PressOptions) => Promise<void>;\n\n /**\n * Simulate user pressing on a given `TextInput` element and typing given text.\n *\n * This method will trigger the events for each character of the text:\n * `keyPress`, `change`, `changeText`, `endEditing`, etc.\n *\n * It will also trigger events connected with entering and leaving the text\n * input.\n *\n * The exact events sent depend on the props of the TextInput (`editable`,\n * `multiline`, etc) and passed options.\n *\n * @param element TextInput element to type on\n * @param text Text to type\n * @param options Options affecting typing behavior:\n * - `skipPress` - if true, `pressIn` and `pressOut` events will not be\n * triggered.\n * - `submitEditing` - if true, `submitEditing` event will be triggered after\n * typing the text.\n */\n type: (element: ReactTestInstance, text: string, options?: TypeOptions) => Promise<void>;\n\n /**\n * Simulate user clearing the text of a given `TextInput` element.\n *\n * This method will simulate:\n * 1. entering TextInput\n * 2. selecting all text\n * 3. pressing backspace to delete all text\n * 4. leaving TextInput\n *\n * @param element TextInput element to clear\n */\n clear: (element: ReactTestInstance) => Promise<void>;\n\n /**\n * Simulate user pasting the text to a given `TextInput` element.\n *\n * This method will simulate:\n * 1. entering TextInput\n * 2. selecting all text\n * 3. paste the text\n * 4. leaving TextInput\n *\n * @param element TextInput element to paste to\n */\n paste: (element: ReactTestInstance, text: string) => Promise<void>;\n\n /**\n * Simlate user scorlling a ScrollView element.\n *\n * @param element ScrollView element\n * @returns\n */\n scrollTo: (element: ReactTestInstance, options: ScrollToOptions) => Promise<void>;\n}\n\nfunction createInstance(config: UserEventConfig): UserEventInstance {\n const instance = {\n config,\n } as UserEventInstance;\n\n // Bind interactions to given User Event instance.\n const api = {\n press: wrapAndBindImpl(instance, press),\n longPress: wrapAndBindImpl(instance, longPress),\n type: wrapAndBindImpl(instance, type),\n clear: wrapAndBindImpl(instance, clear),\n paste: wrapAndBindImpl(instance, paste),\n scrollTo: wrapAndBindImpl(instance, scrollTo),\n };\n\n Object.assign(instance, api);\n return instance;\n}\n\n/**\n * Wraps user interaction with `wrapAsync` (temporarily disable `act` environment while\n * calling & resolving the async callback, then flush the microtask queue)\n *\n * This implementation is sourced from `testing-library/user-event`\n * @see https://github.com/testing-library/user-event/blob/7a305dee9ab833d6f338d567fc2e862b4838b76a/src/setup/setup.ts#L121\n */\nfunction wrapAndBindImpl<\n Args extends never[],\n Impl extends (this: UserEventInstance, ...args: Args) => Promise<unknown>,\n>(instance: UserEventInstance, impl: Impl) {\n function method(...args: Args) {\n return wrapAsync(() =>\n // eslint-disable-next-line promise/prefer-await-to-then\n impl.apply(instance, args).then(async (result) => {\n await wait(instance.config);\n return result;\n }),\n );\n }\n\n // Copy implementation name to the returned function\n Object.defineProperty(method, 'name', { get: () => impl.name });\n\n return method as Impl;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OA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EAC9C,CAAC;EAEDC,MAAM,CAACC,MAAM,CAACX,QAAQ,EAAEE,GAAG,CAAC;EAC5B,OAAOF,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,eAAeA,CAGtBJ,QAA2B,EAAEY,IAAU,EAAE;EACzC,SAASC,MAAMA,CAAC,GAAGC,IAAU,EAAE;IAC7B,OAAO,IAAAC,oBAAS,EAAC;IACf;IACAH,IAAI,CAACI,KAAK,CAAChB,QAAQ,EAAEc,IAAI,CAAC,CAACG,IAAI,CAAC,MAAOC,MAAM,IAAK;MAChD,MAAM,IAAAC,WAAI,EAACnB,QAAQ,CAACF,MAAM,CAAC;MAC3B,OAAOoB,MAAM;IACf,CAAC,CACH,CAAC;EACH;;EAEA;EACAR,MAAM,CAACU,cAAc,CAACP,MAAM,EAAE,MAAM,EAAE;IAAEQ,GAAG,EAAEA,CAAA,KAAMT,IAAI,CAACU;EAAK,CAAC,CAAC;EAE/D,OAAOT,MAAM;AACf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","names":["_errors","require","_hostComponentNames","_pointerEvents","_textInput","_nativeState","_eventBuilder","_utils","_parseKeys","type","element","text","options","isHostTextInput","ErrorWithStack","isEditableTextInput","isPointerEventEnabled","keys","parseKeys","skipPress","dispatchEvent","EventBuilder","Common","touch","focus","wait","config","currentText","getTextInputValue","key","previousText","proposedText","applyKey","isAccepted","isTextChangeAccepted","emitTypingEvents","finalText","submitEditing","TextInput","skipBlur","endEditing","blur","isMultiline","props","multiline","keyPress","nativeState","valueForElement","set","change","selectionRange","start","length","end","selectionChange","contentSize","getTextContentSize","contentSizeChange","slice","maxLength","undefined"],"sources":["../../../src/user-event/type/type.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { ErrorWithStack } from '../../helpers/errors';\nimport { isHostTextInput } from '../../helpers/host-component-names';\nimport { isPointerEventEnabled } from '../../helpers/pointer-events';\nimport { getTextInputValue, isEditableTextInput } from '../../helpers/text-input';\nimport { nativeState } from '../../native-state';\nimport { EventBuilder } from '../event-builder';\nimport type { UserEventConfig, UserEventInstance } from '../setup';\nimport { dispatchEvent, getTextContentSize, wait } from '../utils';\nimport { parseKeys } from './parse-keys';\n\nexport interface TypeOptions {\n skipPress?: boolean;\n submitEditing?: boolean;\n skipBlur?: boolean;\n}\n\nexport async function type(\n this: UserEventInstance,\n element: ReactTestInstance,\n text: string,\n options?: TypeOptions,\n): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `type() works only with host \"TextInput\" elements. Passed element has type \"${element.type}\".`,\n type,\n );\n }\n\n // Skip events if the element is disabled\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n const keys = parseKeys(text);\n\n if (!options?.skipPress) {\n dispatchEvent(element, 'pressIn', EventBuilder.Common.touch());\n }\n\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n if (!options?.skipPress) {\n await wait(this.config);\n dispatchEvent(element, 'pressOut', EventBuilder.Common.touch());\n }\n\n let currentText = getTextInputValue(element);\n for (const key of keys) {\n const previousText = getTextInputValue(element);\n const proposedText = applyKey(previousText, key);\n const isAccepted = isTextChangeAccepted(element, proposedText);\n currentText = isAccepted ? proposedText : previousText;\n\n await emitTypingEvents(element, {\n config: this.config,\n key,\n text: currentText,\n isAccepted,\n });\n }\n\n const finalText = getTextInputValue(element);\n await wait(this.config);\n\n if (options?.submitEditing) {\n dispatchEvent(element, 'submitEditing', EventBuilder.TextInput.submitEditing(finalText));\n }\n\n if (!options?.skipBlur) {\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n }\n}\n\ntype EmitTypingEventsContext = {\n config: UserEventConfig;\n key: string;\n text: string;\n isAccepted?: boolean;\n};\n\nexport async function emitTypingEvents(\n element: ReactTestInstance,\n { config, key, text, isAccepted }: EmitTypingEventsContext,\n) {\n const isMultiline = element.props.multiline === true;\n\n await wait(config);\n dispatchEvent(element, 'keyPress', EventBuilder.TextInput.keyPress(key));\n\n // Platform difference (based on experiments):\n // - iOS and RN Web: TextInput emits only `keyPress` event when max length has been reached\n // - Android: TextInputs does not emit any events\n if (isAccepted === false) {\n return;\n }\n\n nativeState.valueForElement.set(element, text);\n dispatchEvent(element, 'change', EventBuilder.TextInput.change(text));\n dispatchEvent(element, 'changeText', text);\n\n const selectionRange = {\n start: text.length,\n end: text.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // According to the docs only multiline TextInput emits contentSizeChange event\n // @see: https://reactnative.dev/docs/textinput#oncontentsizechange\n if (isMultiline) {\n const contentSize = getTextContentSize(text);\n dispatchEvent(\n element,\n 'contentSizeChange',\n EventBuilder.TextInput.contentSizeChange(contentSize),\n );\n }\n}\n\nfunction applyKey(text: string, key: string) {\n if (key === 'Enter') {\n return `${text}\\n`;\n }\n\n if (key === 'Backspace') {\n return text.slice(0, -1);\n }\n\n return text + key;\n}\n\nfunction isTextChangeAccepted(element: ReactTestInstance, text: string) {\n const maxLength = element.props.maxLength;\n return maxLength === undefined || text.length <= maxLength;\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"type.js","names":["_errors","require","_hostComponentNames","_pointerEvents","_textInput","_nativeState","_eventBuilder","_utils","_parseKeys","type","element","text","options","isHostTextInput","ErrorWithStack","isEditableTextInput","isPointerEventEnabled","keys","parseKeys","skipPress","dispatchEvent","EventBuilder","Common","touch","focus","wait","config","currentText","getTextInputValue","key","previousText","proposedText","applyKey","isAccepted","isTextChangeAccepted","emitTypingEvents","finalText","submitEditing","TextInput","skipBlur","endEditing","blur","isMultiline","props","multiline","keyPress","nativeState","valueForElement","set","change","selectionRange","start","length","end","selectionChange","contentSize","getTextContentSize","contentSizeChange","slice","maxLength","undefined"],"sources":["../../../src/user-event/type/type.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { ErrorWithStack } from '../../helpers/errors';\nimport { isHostTextInput } from '../../helpers/host-component-names';\nimport { isPointerEventEnabled } from '../../helpers/pointer-events';\nimport { getTextInputValue, isEditableTextInput } from '../../helpers/text-input';\nimport { nativeState } from '../../native-state';\nimport { EventBuilder } from '../event-builder';\nimport type { UserEventConfig, UserEventInstance } from '../setup';\nimport { dispatchEvent, getTextContentSize, wait } from '../utils';\nimport { parseKeys } from './parse-keys';\n\nexport interface TypeOptions {\n skipPress?: boolean;\n submitEditing?: boolean;\n skipBlur?: boolean;\n}\n\nexport async function type(\n this: UserEventInstance,\n element: ReactTestInstance,\n text: string,\n options?: TypeOptions,\n): Promise<void> {\n if (!isHostTextInput(element)) {\n throw new ErrorWithStack(\n `type() works only with host \"TextInput\" elements. Passed element has type \"${element.type}\".`,\n type,\n );\n }\n\n // Skip events if the element is disabled\n if (!isEditableTextInput(element) || !isPointerEventEnabled(element)) {\n return;\n }\n\n const keys = parseKeys(text);\n\n if (!options?.skipPress) {\n dispatchEvent(element, 'pressIn', EventBuilder.Common.touch());\n }\n\n dispatchEvent(element, 'focus', EventBuilder.Common.focus());\n\n if (!options?.skipPress) {\n await wait(this.config);\n dispatchEvent(element, 'pressOut', EventBuilder.Common.touch());\n }\n\n let currentText = getTextInputValue(element);\n for (const key of keys) {\n const previousText = getTextInputValue(element);\n const proposedText = applyKey(previousText, key);\n const isAccepted = isTextChangeAccepted(element, proposedText);\n currentText = isAccepted ? proposedText : previousText;\n\n await emitTypingEvents(element, {\n config: this.config,\n key,\n text: currentText,\n isAccepted,\n });\n }\n\n const finalText = getTextInputValue(element);\n await wait(this.config);\n\n if (options?.submitEditing) {\n dispatchEvent(element, 'submitEditing', EventBuilder.TextInput.submitEditing(finalText));\n }\n\n if (!options?.skipBlur) {\n dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));\n dispatchEvent(element, 'blur', EventBuilder.Common.blur());\n }\n}\n\ntype EmitTypingEventsContext = {\n config: UserEventConfig;\n key: string;\n text: string;\n isAccepted?: boolean;\n};\n\nexport async function emitTypingEvents(\n element: ReactTestInstance,\n { config, key, text, isAccepted }: EmitTypingEventsContext,\n) {\n const isMultiline = element.props.multiline === true;\n\n await wait(config);\n dispatchEvent(element, 'keyPress', EventBuilder.TextInput.keyPress(key));\n\n // Platform difference (based on experiments):\n // - iOS and RN Web: TextInput emits only `keyPress` event when max length has been reached\n // - Android: TextInputs does not emit any events\n if (isAccepted === false) {\n return;\n }\n\n nativeState.valueForElement.set(element, text);\n dispatchEvent(element, 'change', EventBuilder.TextInput.change(text));\n dispatchEvent(element, 'changeText', text);\n\n const selectionRange = {\n start: text.length,\n end: text.length,\n };\n dispatchEvent(element, 'selectionChange', EventBuilder.TextInput.selectionChange(selectionRange));\n\n // According to the docs only multiline TextInput emits contentSizeChange event\n // @see: https://reactnative.dev/docs/textinput#oncontentsizechange\n if (isMultiline) {\n const contentSize = getTextContentSize(text);\n dispatchEvent(\n element,\n 'contentSizeChange',\n EventBuilder.TextInput.contentSizeChange(contentSize),\n );\n }\n}\n\nfunction applyKey(text: string, key: string) {\n if (key === 'Enter') {\n return `${text}\\n`;\n }\n\n if (key === 'Backspace') {\n return text.slice(0, -1);\n }\n\n return text + key;\n}\n\nfunction isTextChangeAccepted(element: ReactTestInstance, text: string) {\n const maxLength = element.props.maxLength;\n return maxLength === undefined || text.length <= maxLength;\n}\n"],"mappings":";;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAQO,eAAeQ,IAAIA,CAExBC,OAA0B,EAC1BC,IAAY,EACZC,OAAqB,EACN;EACf,IAAI,CAAC,IAA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I,CAAC;EAE1C,MAAMuC,cAAc,GAAG;IACrBC,KAAK,EAAExC,IAAI,CAACyC,MAAM;IAClBC,GAAG,EAAE1C,IAAI,CAACyC;EACZ,CAAC;EACD,IAAAhC,oBAAa,EAACV,OAAO,EAAE,iBAAiB,EAAEW,0BAAY,CAACiB,SAAS,CAACgB,eAAe,CAACJ,cAAc,CAAC,CAAC;;EAEjG;EACA;EACA,IAAIR,WAAW,EAAE;IACf,MAAMa,WAAW,GAAG,IAAAC,yBAAkB,EAAC7C,IAAI,CAAC;IAC5C,IAAAS,oBAAa,EACXV,OAAO,EACP,mBAAmB,EACnBW,0BAAY,CAACiB,SAAS,CAACmB,iBAAiB,CAACF,WAAW,CACtD,CAAC;EACH;AACF;AAEA,SAASvB,QAAQA,CAACrB,IAAY,EAAEkB,GAAW,EAAE;EAC3C,IAAIA,GAAG,KAAK,OAAO,EAAE;IACnB,OAAO,GAAGlB,IAAI,IAAI;EACpB;EAEA,IAAIkB,GAAG,KAAK,WAAW,EAAE;IACvB,OAAOlB,IAAI,CAAC+C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAC1B;EAEA,OAAO/C,IAAI,GAAGkB,GAAG;AACnB;AAEA,SAASK,oBAAoBA,CAACxB,OAA0B,EAAEC,IAAY,EAAE;EACtE,MAAMgD,SAAS,GAAGjD,OAAO,CAACiC,KAAK,CAACgB,SAAS;EACzC,OAAOA,SAAS,KAAKC,SAAS,IAAIjD,IAAI,CAACyC,MAAM,IAAIO,SAAS;AAC5D","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dispatchEvent = dispatchEvent;
|
|
7
7
|
var _act = _interopRequireDefault(require("../../act"));
|
|
8
|
+
var _eventHandler = require("../../event-handler");
|
|
8
9
|
var _componentTree = require("../../helpers/component-tree");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
/**
|
|
@@ -18,7 +19,7 @@ function dispatchEvent(element, eventName, ...event) {
|
|
|
18
19
|
if (!(0, _componentTree.isElementMounted)(element)) {
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
|
-
const handler = getEventHandler(element, eventName);
|
|
22
|
+
const handler = (0, _eventHandler.getEventHandler)(element, eventName);
|
|
22
23
|
if (!handler) {
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
@@ -28,15 +29,4 @@ function dispatchEvent(element, eventName, ...event) {
|
|
|
28
29
|
handler(...event);
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
function getEventHandler(element, eventName) {
|
|
32
|
-
const handleName = getEventHandlerName(eventName);
|
|
33
|
-
const handle = element.props[handleName];
|
|
34
|
-
if (typeof handle !== 'function') {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
return handle;
|
|
38
|
-
}
|
|
39
|
-
function getEventHandlerName(eventName) {
|
|
40
|
-
return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;
|
|
41
|
-
}
|
|
42
32
|
//# sourceMappingURL=dispatch-event.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-event.js","names":["_act","_interopRequireDefault","require","_componentTree","e","__esModule","default","dispatchEvent","element","eventName","event","isElementMounted","handler","getEventHandler","act"
|
|
1
|
+
{"version":3,"file":"dispatch-event.js","names":["_act","_interopRequireDefault","require","_eventHandler","_componentTree","e","__esModule","default","dispatchEvent","element","eventName","event","isElementMounted","handler","getEventHandler","act"],"sources":["../../../src/user-event/utils/dispatch-event.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport act from '../../act';\nimport { getEventHandler } from '../../event-handler';\nimport { isElementMounted } from '../../helpers/component-tree';\n\n/**\n * Basic dispatch event function used by User Event module.\n *\n * @param element element trigger event on\n * @param eventName name of the event\n * @param event event payload(s)\n */\nexport function dispatchEvent(element: ReactTestInstance, eventName: string, ...event: unknown[]) {\n if (!isElementMounted(element)) {\n return;\n }\n\n const handler = getEventHandler(element, eventName);\n if (!handler) {\n return;\n }\n\n // This will be called synchronously.\n void act(() => {\n handler(...event);\n });\n}\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAAgE,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,aAAaA,CAACC,OAA0B,EAAEC,SAAiB,EAAE,GAAGC,KAAgB,EAAE;EAChG,IAAI,CAAC,IAAAC,+BAAgB,EAACH,OAAO,CAAC,EAAE;IAC9B;EACF;EAEA,MAAMI,OAAO,GAAG,IAAAC,6BAAe,EAACL,OAAO,EAAEC,SAAS,CAAC;EACnD,IAAI,CAACG,OAAO,EAAE;IACZ;EACF;;EAEA;EACA,KAAK,IAAAE,YAAG,EAAC,MAAM;IACbF,OAAO,CAAC,GAAGF,KAAK,CAAC;EACnB,CAAC,CAAC;AACJ","ignoreList":[]}
|
package/build/within.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within.js","names":["_displayValue","require","_hintText","_labelText","_placeholderText","_role","_testId","_text","_unsafeProps","_unsafeType","within","instance","bindByTextQueries","bindByTestIdQueries","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByLabelTextQueries","bindByHintTextQueries","bindByRoleQueries","bindUnsafeByTypeQueries","bindUnsafeByPropsQueries","getQueriesForElement","exports"],"sources":["../src/within.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\nimport { bindByDisplayValueQueries } from './queries/display-value';\nimport { bindByHintTextQueries } from './queries/hint-text';\nimport { bindByLabelTextQueries } from './queries/label-text';\nimport { bindByPlaceholderTextQueries } from './queries/placeholder-text';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByTestIdQueries } from './queries/test-id';\nimport { bindByTextQueries } from './queries/text';\nimport { bindUnsafeByPropsQueries } from './queries/unsafe-props';\nimport { bindUnsafeByTypeQueries } from './queries/unsafe-type';\n\nexport function within(instance: ReactTestInstance) {\n return {\n ...bindByTextQueries(instance),\n ...bindByTestIdQueries(instance),\n ...bindByDisplayValueQueries(instance),\n ...bindByPlaceholderTextQueries(instance),\n ...bindByLabelTextQueries(instance),\n ...bindByHintTextQueries(instance),\n ...bindByRoleQueries(instance),\n ...bindUnsafeByTypeQueries(instance),\n ...bindUnsafeByPropsQueries(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"within.js","names":["_displayValue","require","_hintText","_labelText","_placeholderText","_role","_testId","_text","_unsafeProps","_unsafeType","within","instance","bindByTextQueries","bindByTestIdQueries","bindByDisplayValueQueries","bindByPlaceholderTextQueries","bindByLabelTextQueries","bindByHintTextQueries","bindByRoleQueries","bindUnsafeByTypeQueries","bindUnsafeByPropsQueries","getQueriesForElement","exports"],"sources":["../src/within.ts"],"sourcesContent":["import type { ReactTestInstance } from 'react-test-renderer';\n\nimport { bindByDisplayValueQueries } from './queries/display-value';\nimport { bindByHintTextQueries } from './queries/hint-text';\nimport { bindByLabelTextQueries } from './queries/label-text';\nimport { bindByPlaceholderTextQueries } from './queries/placeholder-text';\nimport { bindByRoleQueries } from './queries/role';\nimport { bindByTestIdQueries } from './queries/test-id';\nimport { bindByTextQueries } from './queries/text';\nimport { bindUnsafeByPropsQueries } from './queries/unsafe-props';\nimport { bindUnsafeByTypeQueries } from './queries/unsafe-type';\n\nexport function within(instance: ReactTestInstance) {\n return {\n ...bindByTextQueries(instance),\n ...bindByTestIdQueries(instance),\n ...bindByDisplayValueQueries(instance),\n ...bindByPlaceholderTextQueries(instance),\n ...bindByLabelTextQueries(instance),\n ...bindByHintTextQueries(instance),\n ...bindByRoleQueries(instance),\n ...bindUnsafeByTypeQueries(instance),\n ...bindUnsafeByPropsQueries(instance),\n };\n}\n\nexport const getQueriesForElement = within;\n"],"mappings":";;;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAEO,SAASS,MAAMA,CAACC,QAA2B,EAAE;EAClD,OAAO;IACL,GAAG,IAAAC,uBAAiB,EAACD,QAAQ,CAAC;IAC9B,GAAG,IAAAE,2BAAmB,EAACF,QAAQ,CAAC;IAChC,GAAG,IAAAG,uCAAyB,EAACH,QAAQ,CAAC;IACtC,GAAG,IAAAI,6CAA4B,EAACJ,QAAQ,CAAC;IACzC,GAAG,IAAAK,iCAAsB,EAACL,QAAQ,CAAC;IACnC,GAAG,IAAAM,+BAAqB,EAACN,QAAQ,CAAC;IAClC,GAAG,IAAAO,uBAAiB,EAACP,QAAQ,CAAC;IAC9B,GAAG,IAAAQ,mCAAuB,EAACR,QAAQ,CAAC;IACpC,GAAG,IAAAS,qCAAwB,EAACT,QAAQ;EACtC,CAAC;AACH;AAEO,MAAMU,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAGX,MAAM","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/react-native",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.1",
|
|
4
4
|
"description": "Simple and complete React Native testing utilities that encourage good testing practices.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -72,12 +72,13 @@
|
|
|
72
72
|
"@babel/preset-react": "^7.25.9",
|
|
73
73
|
"@babel/preset-typescript": "^7.26.0",
|
|
74
74
|
"@callstack/eslint-config": "^15.0.0",
|
|
75
|
-
"@react-native/babel-preset": "0.
|
|
75
|
+
"@react-native/babel-preset": "0.78.0",
|
|
76
76
|
"@release-it/conventional-changelog": "^10.0.0",
|
|
77
77
|
"@relmify/jest-serializer-strip-ansi": "^1.0.2",
|
|
78
78
|
"@types/jest": "^29.5.14",
|
|
79
|
-
"@types/
|
|
80
|
-
"@types/react
|
|
79
|
+
"@types/node": "^22.13.8",
|
|
80
|
+
"@types/react": "^19.0.0",
|
|
81
|
+
"@types/react-test-renderer": "^19.0.0",
|
|
81
82
|
"babel-jest": "^29.7.0",
|
|
82
83
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
83
84
|
"del-cli": "^6.0.0",
|
|
@@ -86,9 +87,10 @@
|
|
|
86
87
|
"flow-bin": "~0.170.0",
|
|
87
88
|
"jest": "^29.7.0",
|
|
88
89
|
"prettier": "^2.8.8",
|
|
89
|
-
"react": "
|
|
90
|
-
"react-native": "0.
|
|
91
|
-
"react-
|
|
90
|
+
"react": "19.0.0",
|
|
91
|
+
"react-native": "0.78.0",
|
|
92
|
+
"react-native-gesture-handler": "^2.23.1",
|
|
93
|
+
"react-test-renderer": "19.0.0",
|
|
92
94
|
"release-it": "^18.0.0",
|
|
93
95
|
"typescript": "^5.6.3",
|
|
94
96
|
"typescript-eslint": "^8.19.1"
|