Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Modal: Setting resource-id from testID prop #48313

Conversation

mateoguzmana
Copy link
Contributor

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

Test Plan:

Using Appium, check that the testID prop passed from JS is mapped as resource-id in the rendered view group of the Modal.

Example of the code implementation in the RNTester Playground:
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);
        }}
      />
    </>
  );
}
Output in Appium Inspector: image

@mateoguzmana mateoguzmana marked this pull request as ready for review December 17, 2024 19:11
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 17, 2024
@facebook-github-bot
Copy link
Contributor

@alanleedev has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 19, 2024
@facebook-github-bot
Copy link
Contributor

@alanleedev merged this pull request in 52b6592.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @mateoguzmana in 52b6592

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

@alanleedev
Copy link
Contributor

@mateoguzmana Thanks for submitting the fix.

@mateoguzmana
Copy link
Contributor Author

@mateoguzmana Thanks for submitting the fix.

@alanleedev Thank you for taking the time to review and adjust this PR!

@mateoguzmana mateoguzmana deleted the feat/android-modal-test-id-not-working branch December 20, 2024 08:40
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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants