Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ function Modal({
accessibilityViewIsModal
accessibilityLiveRegion="polite"
style={StyleSheet.absoluteFill}
onAccessibilityEscape={hideModal}
onAccessibilityEscape={onDismissCallback}
testID={testID}
>
<AnimatedPressable
accessibilityLabel={overlayAccessibilityLabel}
accessibilityRole="button"
disabled={!dismissable}
onPress={dismissable ? hideModal : undefined}
onPress={dismissable ? onDismissCallback : undefined}
importantForAccessibility="no"
style={[
styles.backdrop,
Expand Down
23 changes: 0 additions & 23 deletions src/components/__tests__/Modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,6 @@ describe('Modal', () => {
opacity: 1,
});
});

it('should invoke the onDismiss function after the animation', () => {
const onDismiss = jest.fn();
const { getByTestId } = render(
<Modal testID="modal" visible onDismiss={onDismiss}>
{null}
</Modal>
);

expect(onDismiss).not.toHaveBeenCalled();

act(() => {
fireEvent.press(getByTestId('modal-backdrop'));
});

expect(onDismiss).not.toHaveBeenCalled();

act(() => {
jest.runAllTimers();
});

expect(onDismiss).toHaveBeenCalledTimes(1);
});
});

describe('if closed via Android back button', () => {
Expand Down