1

I am writing test case for react native functional component application I am facing issue for redux and persist mocking

mock the redux and persist data in react native application

import React from 'react';
import Header from './Header';
import { Provider } from 'react-redux';
import { store } from '../../../store';
import { render } from '@testing-library/react-native';

const backButton = jest.fn;
const chatButton = jest.fn;
test('render correctly header', () => {
  const component = (
    <Provider store={store}>
      <Header
        title={''}
        onBackButton={backButton}
        onChatButton={chatButton()}
      />
    </Provider>
  );
  render(component);
});

I try to mock the backButton function and chatButton function render is not woking I am getting error

0 Answers0