import React from 'react';
import mockState from '../../../../test/data/mock-state.json';
import { renderWithProvider } from '../../../../test/jest';
import configureStore from '../../../store/store';
import ConfirmData from './confirm-data';
jest.mock('../../../../shared/lib/fetch-with-cache');
describe('ConfirmData', () => {
const store = configureStore(mockState);
it('should render function type', async () => {
const { findByText } = renderWithProvider(
,
store,
);
expect(await findByText('Transfer')).toBeInTheDocument();
});
it('should return null if transaction has no data', () => {
const { container } = renderWithProvider(
,
store,
);
expect(container.firstChild).toStrictEqual(null);
});
it('should render dataComponent if passed', () => {
const { getByText } = renderWithProvider(
Data Component}
/>,
store,
);
expect(getByText('Data Component')).toBeInTheDocument();
});
});