mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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: https://github.com/facebook/react-native/pull/23982 Differential Revision: D14502780 Pulled By: cpojer fbshipit-source-id: ec11bd547b6f90858e7f51ed8230c8d02dc4904c
This commit is contained in:
committed by
Facebook Github Bot
parent
5558333c60
commit
65a8a51556
@@ -67,6 +67,19 @@ jest
|
||||
.mock('ensureComponentIsNative', () => () => true);
|
||||
|
||||
const mockNativeModules = {
|
||||
AccessibilityInfo: {
|
||||
addEventListener: jest.fn(),
|
||||
announceForAccessibility: jest.fn(),
|
||||
fetch: jest.fn(),
|
||||
isBoldTextEnabled: jest.fn(),
|
||||
isGrayscaleEnabled: jest.fn(),
|
||||
isInvertColorsEnabled: jest.fn(),
|
||||
isReduceMotionEnabled: jest.fn(),
|
||||
isReduceTransparencyEnabled: jest.fn(),
|
||||
isScreenReaderEnabled: jest.fn(),
|
||||
removeEventListener: jest.fn(),
|
||||
setAccessibilityFocus: jest.fn(),
|
||||
},
|
||||
AlertManager: {
|
||||
alertWithArgs: jest.fn(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user