Skip to content

Commit

Permalink
Add missing mock for AccessibilityInfo (#23982)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Estevão Lucas authored and facebook-github-bot committed Mar 18, 2019
1 parent 5558333 commit 65a8a51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down

0 comments on commit 65a8a51

Please sign in to comment.