Restore paperComponentName: 'RCTSwitch' to fix @testing-library/react-native queries - #58323
Closed
christophpurrer wants to merge 1 commit into
Closed
Restore paperComponentName: 'RCTSwitch' to fix @testing-library/react-native queries#58323christophpurrer wants to merge 1 commit into
paperComponentName: 'RCTSwitch' to fix @testing-library/react-native queries#58323christophpurrer wants to merge 1 commit into
Conversation
…act-native` queries
Summary:
Restore `paperComponentName: 'RCTSwitch'` in `SwitchNativeComponent.js` and regenerate affected snapshots to fix test breakages introduced by D117877024.
`testing-library/react-native` 13.3.3 hardcodes `HOST_SWITCH_NAMES = ['RCTSwitch']`, so renaming the component to `Switch` broke `getByRole('switch')` queries and `toBeChecked()` assertions. This was the only xplat/js-wide breakage from that diff—only bare `<Switch>` renders without explicit `accessible` props failed, and only in `TWInternBoolSettingComponent-test.js`.
Add an inline comment documenting the `testing-library/react-native` constraint to prevent future regressions. The four other component renames in D117877024 have no RNTL special-casing and remain as landed.
Changelog: [iOS][Fixed] Restore `paperComponentName: 'RCTSwitch'` to fix `testing-library/react-native` queries
Differential Revision: D118743290
|
@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D118743290. |
|
This pull request has been merged in 38fd9d5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Restore
paperComponentName: 'RCTSwitch'inSwitchNativeComponent.jsand regenerate affected snapshots to fix test breakages introduced by D117877024.testing-library/react-native13.3.3 hardcodesHOST_SWITCH_NAMES = ['RCTSwitch'], so renaming the component toSwitchbrokegetByRole('switch')queries andtoBeChecked()assertions. This was the only xplat/js-wide breakage from that diff—only bare<Switch>renders without explicitaccessibleprops failed, and only inTWInternBoolSettingComponent-test.js.Add an inline comment documenting the
testing-library/react-nativeconstraint to prevent future regressions. The four other component renames in D117877024 have no RNTL special-casing and remain as landed.Changelog: [iOS][Fixed] Restore
paperComponentName: 'RCTSwitch'to fixtesting-library/react-nativequeriesDifferential Revision: D118743290