1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/swaps/import-token/import-token.test.js

31 lines
861 B
JavaScript
Raw Normal View History

2021-06-03 18:08:37 +02:00
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',
},
isOpen: true,
2021-06-03 18:08:37 +02:00
...customProps,
};
};
describe('ImportToken', () => {
it('renders the component with initial props', () => {
const props = createProps();
const { getByText, getByDisplayValue } = renderWithProvider(
<ImportToken {...props} />,
);
2021-06-03 18:08:37 +02:00
expect(getByText(props.tokenForImport.name)).toBeInTheDocument();
expect(getByDisplayValue(props.tokenForImport.address)).toBeInTheDocument();
2021-06-03 18:08:37 +02:00
});
});