Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Follow up from #48271 and #48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that. ## Changelog: [ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop Pull Request resolved: #48313 Test Plan: Alternatively do: ``` $ adb shell uiautomator dump UI hierchary dumped to: /sdcard/window_dump.xml $ adb pull /sdcard/window_dump.xml /sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s) ``` and check in XML: ` resource-id="playground-modal" class="android.view.ViewGroup" ` ------- Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal. <details> <summary>Example of the code implementation in the RNTester Playground:</summary> ```tsx function Playground() { const [modalVisible, setModalVisible] = React.useState(false); return ( <> <Modal visible={modalVisible} testID="playground-modal"> <Text testID="inner-text-test-id">Hello World!</Text> </Modal> <Button title="Open Modal" onPress={() => { setModalVisible(true); }} /> </> ); } ``` </details> <details> <summary>Output in Appium Inspector:</summary> <img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" /> </details> Reviewed By: javache Differential Revision: D67369350 Pulled By: alanleedev fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
- Loading branch information