mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-18 07:23:21 +01:00
28 lines
803 B
JavaScript
28 lines
803 B
JavaScript
|
import React from 'react';
|
||
|
|
||
|
import { renderWithProvider } from '../../../../test/jest';
|
||
|
import ImportToken from '.';
|
||
|
|
||
|
const createProps = (customProps = {}) => {
|
||
|
return {
|
||
|
onImportTokenCloseClick: jest.fn(),
|
||
|
onImportTokenClick: jest.fn(),
|
||
|
setIsImportTokenModalOpen: jest.fn(),
|
||
|
tokenForImport: {
|
||
|
symbol: 'POS',
|
||
|
name: 'PoSToken',
|
||
|
address: '0xee609fe292128cad03b786dbb9bc2634ccdbe7fc',
|
||
|
},
|
||
|
...customProps,
|
||
|
};
|
||
|
};
|
||
|
|
||
|
describe('ImportToken', () => {
|
||
|
it('renders the component with initial props', () => {
|
||
|
const props = createProps();
|
||
|
const { getByText } = renderWithProvider(<ImportToken {...props} />);
|
||
|
expect(getByText(props.tokenForImport.name)).toBeInTheDocument();
|
||
|
expect(getByText(props.tokenForImport.address)).toBeInTheDocument();
|
||
|
});
|
||
|
});
|