Skip to content

AccessibilityInfo: added missing tests for Promise based methods, align null checks and error message code style #56150

Open
chicio wants to merge 9 commits intofacebook:mainfrom
chicio:accessibility_missing_tests
Open

AccessibilityInfo: added missing tests for Promise based methods, align null checks and error message code style #56150
chicio wants to merge 9 commits intofacebook:mainfrom
chicio:accessibility_missing_tests

Conversation

@chicio
Copy link
Contributor

@chicio chicio commented Mar 19, 2026

Summary:

This PR continue the work I'm doing to improve the AccessibilityInfo module (#56066 and connected PRs).

In this new PR I added the missing tests for all the Promise based methods in the AccessibilityInfo, to prevent regressions similar to those fixed in the previous PRs.

This PR also includes a couple of small code style consistency improvement:

  • aligned the null check in getRecommendedTimeoutMillis to the other ones already present in the file
  • aligned the error messages returned from isGrayscaleEnabled, isInvertColorsEnabled and isReduceMotionEnabled to the other ones
  • added the docs links where was missing (related to the PR I opened on the react-native doc repo)

Changelog:

[GENERAL] [ADDED] - AccessibilityInfo: added missing tests for Promise based methods, align null checks and error message code style

Test Plan:

I run the tests that I added to verify their correctness. Some of them were failing because of the change of the error messages, and I made them green by changing the message in the production code. For this others, I verified their correctness by breaking the production code to see if they were failing.

@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 Mar 19, 2026
@facebook-github-tools facebook-github-tools bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 19, 2026
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. 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.

1 participant