Commit 8fc503d
AccessibilityInfo: added missing tests for Promise based methods, align null checks and error message code style (#56150)
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
Pull Request resolved: #56150
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.
Reviewed By: cipolleschi
Differential Revision: D102190403
Pulled By: cortinico
fbshipit-source-id: f5fe5cacfe0136b25a93d05f3b136c2bc49bd0e21 parent 0518d72 commit 8fc503d
2 files changed
Lines changed: 625 additions & 20 deletions
File tree
- packages/react-native/Libraries/Components/AccessibilityInfo
- __tests__
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
| 240 | + | |
| 241 | + | |
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| |||
512 | 516 | | |
513 | 517 | | |
514 | 518 | | |
515 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
516 | 522 | | |
517 | 523 | | |
518 | 524 | | |
| |||
0 commit comments