Skip to content

Commit 65a8a51

Browse files
Estevão Lucasfacebook-github-bot
authored andcommitted
Add missing mock for AccessibilityInfo (#23982)
Summary: I've realized after #23839 got merged, that `AccessibilityInfo` doesn't have a jest mock the same way as the other frameworks do. This PR adds the testing mock for `AccessibilityInfo`. Pull Request resolved: #23982 Differential Revision: D14502780 Pulled By: cpojer fbshipit-source-id: ec11bd547b6f90858e7f51ed8230c8d02dc4904c
1 parent 5558333 commit 65a8a51

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

jest/setup.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ jest
6767
.mock('ensureComponentIsNative', () => () => true);
6868

6969
const mockNativeModules = {
70+
AccessibilityInfo: {
71+
addEventListener: jest.fn(),
72+
announceForAccessibility: jest.fn(),
73+
fetch: jest.fn(),
74+
isBoldTextEnabled: jest.fn(),
75+
isGrayscaleEnabled: jest.fn(),
76+
isInvertColorsEnabled: jest.fn(),
77+
isReduceMotionEnabled: jest.fn(),
78+
isReduceTransparencyEnabled: jest.fn(),
79+
isScreenReaderEnabled: jest.fn(),
80+
removeEventListener: jest.fn(),
81+
setAccessibilityFocus: jest.fn(),
82+
},
7083
AlertManager: {
7184
alertWithArgs: jest.fn(),
7285
},

0 commit comments

Comments
 (0)