Open vijaygojiya opened 2 years ago
test cases are failing
Resolved by mock the component
jest.mock('../src/components/popupValidation/', () => () => { const MockPopUpNotification = 'PopupNotification' as unknown as React.FC; return
; });
@vijaygojiya I need help brother. I also have a reusuable component and tried to copy paste your code but it does not work. Could you please check it again and share the correct mock?
import React from 'react'; import { FlatList, Image, View } from 'react-native'; import Toast from 'react-native-toast-message';
import MAIN_IMAGES from '../../modules/main/assets/images'; import { passwordErrors } from '../../modules/main/src/mainConstant'; import ItemValidationError from '../itemValidationError'; import ParagraphText from '../paragraphText'; import styles from './styles';
const PopupNotification = () => { const renderError = (props) => { return <ItemValidationError {...props} />; }; const toastConfig = { success: ({ text1 }) => (
};
return <Toast config={toastConfig} ref={(ref) => Toast.setRef(ref)} />; };
export default PopupNotification; `