From 8bc1b3d547fa5de1283e1acd16e2032a58a7dd2d Mon Sep 17 00:00:00 2001 From: Anukrati Agrawal Date: Thu, 10 Sep 2026 15:04:36 -0700 Subject: [PATCH] Restore navigation menu accessibility announcement Restore the AccessibilityInfo import removed with the hidden skip control cleanup and add coverage that invokes the navigation menu handler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 18f319cb-b4f4-4b6b-ae4d-b8f429333447 --- __tests__/ScreenWrapper.test.tsx | 33 ++++++++++++++++++++++++++++++++ src/components/ScreenWrapper.tsx | 1 + 2 files changed, 34 insertions(+) create mode 100644 __tests__/ScreenWrapper.test.tsx diff --git a/__tests__/ScreenWrapper.test.tsx b/__tests__/ScreenWrapper.test.tsx new file mode 100644 index 00000000..9afcc25f --- /dev/null +++ b/__tests__/ScreenWrapper.test.tsx @@ -0,0 +1,33 @@ +/** + * @format + */ + +import React from 'react'; +import {AccessibilityInfo, View} from 'react-native'; +import {act, create} from 'react-test-renderer'; +import {ScreenWrapper} from '../src/components/ScreenWrapper'; + +test('announces when the navigation menu is expanded', () => { + const announceSpy = jest + .spyOn(AccessibilityInfo, 'announceForAccessibility') + .mockImplementation(() => {}); + + let tree; + act(() => { + tree = create( + + + , + ); + }); + + const navigationMenu = tree.root.findByProps({ + accessibilityLabel: 'Navigation menu', + }); + + act(() => { + navigationMenu.props.onPress(); + }); + + expect(announceSpy).toHaveBeenCalledWith('Navigation menu expanded'); +}); diff --git a/src/components/ScreenWrapper.tsx b/src/components/ScreenWrapper.tsx index eded6f95..bc083fc5 100644 --- a/src/components/ScreenWrapper.tsx +++ b/src/components/ScreenWrapper.tsx @@ -6,6 +6,7 @@ import { TouchableHighlight, Text, PlatformColor, + AccessibilityInfo, Dimensions, Easing, useAnimatedValue,