import React from 'react'; import mockState from '../../../../test/data/mock-state.json'; import { renderWithProvider } from '../../../../test/jest'; import configureStore from '../../../store/store'; import ConfirmHexData from './confirm-hexdata'; jest.mock('../../../../shared/lib/fetch-with-cache'); describe('ConfirmHexData', () => { 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 return null if transaction has no to address', () => { const { container } = renderWithProvider( , store, ); expect(container.firstChild).toStrictEqual(null); }); it('should render dataHexComponent if passed', () => { const { getByText } = renderWithProvider( Data Hex Component} />, store, ); expect(getByText('Data Hex Component')).toBeInTheDocument(); }); });