Add announceForAccessibilityWithOptions method mock. (#47063)

Summary:
Currently, tests on components that use the `AccessibilityInfo.announceForAccessibilityWithOptions` method fail because a mock for this method is not present in the `jest` setup file. This PR adds the mock for the before mentioned method in the appropriate `setup.js` file
## Changelog:
[General][Added] - Added the missing `announceForAccessibilityWithOptions` function mock in the `packages/react-native/jest/setup.js` file.

Pull Request resolved: https://github.com/facebook/react-native/pull/47063

Test Plan:
Here are the commands I executed after making the modification:
- `yarn prettier`
- `yarn lint`
- `yarn test`
### Test output
![rn-tests-output](https://github.com/user-attachments/assets/81e9772e-37ce-43ad-9869-5f7f64c292f0)

Reviewed By: tdn120

Differential Revision: D64495941

Pulled By: lunaleaps

fbshipit-source-id: 6ab835e2934b87ec3ac64cf0aebd8dcb58cd0da1
This commit is contained in:
Cristian Matteu authored and Facebook GitHub Bot committed 2024-10-17 09:20:32 -07:00
1 parent 52ea8b07e2
commit 4ae999b90b
1 file changed
+1
+1
View File
@@ -146,6 +146,7 @@ jest
remove: jest.fn(),
})),
announceForAccessibility: jest.fn(),
announceForAccessibilityWithOptions: jest.fn(),
isAccessibilityServiceEnabled: jest.fn(() => Promise.resolve(false)),
isBoldTextEnabled: jest.fn(() => Promise.resolve(false)),
isGrayscaleEnabled: jest.fn(() => Promise.resolve(false)),