Skip to content

Port TextInput-test.js to Fantom and remove the legacy Jest test (#56559)#56559

Closed
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D101977225
Closed

Port TextInput-test.js to Fantom and remove the legacy Jest test (#56559)#56559
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D101977225

Conversation

@rubennorte
Copy link
Copy Markdown
Contributor

@rubennorte rubennorte commented Apr 22, 2026

Summary:

Migrates the remaining meaningful coverage from TextInput-test.js (Jest with snapshots) over to TextInput-itest.js (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in TextInput-itest.js:

  • Add a focus() test verifying that focusing a TextInput unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
  • Add a top-level has the correct displayName test.
  • Add a new set of props describes that assert the props from the original Jest snapshot tests reach the mounting layer via getRenderedOutput({props: [...]}).toJSX():
    • id and nativeID: idnativeID mapping, nativeID pass-through, and id precedence over nativeID.
    • testID: pass-through.
    • aria-label and accessibilityLabel: aria-labelaccessibilityLabel mapping and accessibilityLabel pass-through.
    • aria-* and accessibilityState: aria-busy/checked/disabled/expanded/selected mapped into accessibilityState.
    • accessibilityRole: pass-through.
    • style: backgroundColor propagated as a native color value.

Tests intentionally NOT ported:

  • Inherited HostInstance method presence checks (focus, blur, setNativeProps, measure, measureInWindow, measureLayout): they are guaranteed by Flow typing on ReactNativeElement, exercised in ReactNativeElement-itest.js, and Flow's method-unbinding rule prevents the simple toBeInstanceOf(Function) check without $FlowFixMe (which is forbidden by project rules).
  • focus() should not do anything if the TextInput is not editable: TextInputState.focusTextInput reads textField.currentProps?.editable, but in the new architecture currentProps is not exposed on the public ReactNativeElement instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching currentProps. Documenting this as expected behavior in Fantom would mask a real bug.
  • should give precedence to textContentType when set: textContentType is iOS-only and Fantom defaults to Android (AndroidTextInput).

Files removed:

  • Libraries/Components/TextInput/__tests__/TextInput-test.js
  • Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 22, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 22, 2026

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101977225.

rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
@meta-codesync meta-codesync Bot changed the title Port TextInput-test.js to Fantom and remove the legacy Jest test Port TextInput-test.js to Fantom and remove the legacy Jest test (#56559) Apr 22, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:
Pull Request resolved: facebook#56559

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 22, 2026
…ebook#56559)

Summary:
Pull Request resolved: facebook#56559

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
@rubennorte rubennorte force-pushed the export-D101977225 branch 2 times, most recently from b1c3f5c to 9e38ea1 Compare April 23, 2026 10:14
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
rubennorte added a commit to rubennorte/react-native that referenced this pull request Apr 23, 2026
…ebook#56559)

Summary:

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
…ebook#56559)

Summary:
Pull Request resolved: facebook#56559

Migrates the remaining meaningful coverage from `TextInput-test.js` (Jest with snapshots) over to `TextInput-itest.js` (Fantom) so we can rely on a single test file that exercises the real renderer instead of a heavily-mocked one.

Changes in `TextInput-itest.js`:
- Add a `focus()` test verifying that focusing a `TextInput` unfocuses any previously focused one (mirrors Jest's "should unfocus when other TextInput is focused").
- Add a top-level `has the correct displayName` test.
- Add a new set of `props` describes that assert the props from the original Jest snapshot tests reach the mounting layer via `getRenderedOutput({props: [...]}).toJSX()`:
  - `id and nativeID`: `id` → `nativeID` mapping, `nativeID` pass-through, and `id` precedence over `nativeID`.
  - `testID`: pass-through.
  - `aria-label and accessibilityLabel`: `aria-label` → `accessibilityLabel` mapping and `accessibilityLabel` pass-through.
  - `aria-* and accessibilityState`: `aria-busy/checked/disabled/expanded/selected` mapped into `accessibilityState`.
  - `accessibilityRole`: pass-through.
  - `style`: `backgroundColor` propagated as a native color value.

Tests intentionally NOT ported:
- Inherited `HostInstance` method presence checks (`focus`, `blur`, `setNativeProps`, `measure`, `measureInWindow`, `measureLayout`): they are guaranteed by Flow typing on `ReactNativeElement`, exercised in `ReactNativeElement-itest.js`, and Flow's `method-unbinding` rule prevents the simple `toBeInstanceOf(Function)` check without `$FlowFixMe` (which is forbidden by project rules).
- `focus() should not do anything if the TextInput is not editable`: `TextInputState.focusTextInput` reads `textField.currentProps?.editable`, but in the new architecture `currentProps` is not exposed on the public `ReactNativeElement` instance, so the check is effectively bypassed. The Jest test only passed by monkey-patching `currentProps`. Documenting this as expected behavior in Fantom would mask a real bug.
- `should give precedence to textContentType when set`: `textContentType` is iOS-only and Fantom defaults to Android (`AndroidTextInput`).

Files removed:
- `Libraries/Components/TextInput/__tests__/TextInput-test.js`
- `Libraries/Components/TextInput/__tests__/__snapshots__/TextInput-test.js.snap`

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101977225
@meta-codesync meta-codesync Bot closed this in f69a566 Apr 23, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 23, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 23, 2026

This pull request has been merged in f69a566.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in f69a566

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants