From 5e41b503add189586fa00d3860929b39443ec8de Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 2 Oct 2024 23:11:27 -0700 Subject: [PATCH] fix jest --- jest/jestSetup.js | 5 +++++ src/components/Dialog/index.tsx | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jest/jestSetup.js b/jest/jestSetup.js index 4653490f3c..5564d81f15 100644 --- a/jest/jestSetup.js +++ b/jest/jestSetup.js @@ -96,6 +96,11 @@ jest.mock('expo-modules-core', () => ({ getIsReducedMotionEnabled: () => false, } } + if (moduleName === 'BottomSheet') { + return { + dismissAll: () => {}, + } + } }), requireNativeViewManager: jest.fn().mockImplementation(moduleName => { return () => null diff --git a/src/components/Dialog/index.tsx b/src/components/Dialog/index.tsx index 82cf894b93..372c92ed1f 100644 --- a/src/components/Dialog/index.tsx +++ b/src/components/Dialog/index.tsx @@ -1,6 +1,10 @@ import React, {useImperativeHandle} from 'react' -import {StyleProp, TextInput, View, ViewStyle} from 'react-native' -import {GestureHandlerRootView, ScrollView} from 'react-native-gesture-handler' +import {StyleProp, View, ViewStyle} from 'react-native' +import { + GestureHandlerRootView, + ScrollView, + TextInput as RNGHTextInput, +} from 'react-native-gesture-handler' import {KeyboardAwareScrollView} from 'react-native-keyboard-controller' import {useSafeAreaInsets} from 'react-native-safe-area-context' @@ -23,7 +27,7 @@ export {useDialogContext, useDialogControl} from '#/components/Dialog/context' export * from '#/components/Dialog/types' export * from '#/components/Dialog/utils' // @ts-ignore -export const Input = createInput(TextInput) +export const Input = createInput(RNGHTextInput) export function Outer({ children,