You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tag:
Branch:
Tree:
e906bd8d0e
develop
feature/default_network_editable
v10.22.3
${ noResults }
40 lines
1.2 KiB
40 lines
1.2 KiB
import React from 'react';
|
|||
|
|||
|
import { renderWithProvider } from '../../../../test/jest';
|
||
import MainQuoteSummary from '.';
|
|||
|
|||
const createProps = (customProps = {}) => {
|
|||
return {
|
|||
sourceValue: '2000000000000000000',
|
|||
sourceDecimals: 18,
|
|||
sourceSymbol: 'ETH',
|
|||
destinationValue: '200000000000000000',
|
|||
destinationDecimals: 18,
|
|||
destinationSymbol: 'BAT',
|
|||
...customProps,
|
|||
};
|
|||
};
|
|||
|
|||
describe('MainQuoteSummary', () => {
|
|||
it('renders the component with initial props', () => {
|
|||
const props = createProps();
|
|||
const { getAllByText } = renderWithProvider(
|
|||
<MainQuoteSummary {...props} />,
|
|||
);
|
|||
expect(getAllByText(props.sourceSymbol)).toHaveLength(2);
|
|||
expect(getAllByText(props.destinationSymbol)).toHaveLength(2);
|
|||
expect(
|
|||
document.querySelector('.main-quote-summary__source-row'),
|
|||
).toMatchSnapshot();
|
|||
expect(
|
|||
document.querySelector('.main-quote-summary__destination-row'),
|
|||
).toMatchSnapshot();
|
|||
expect(
|
|||
document.querySelector('.main-quote-summary__quote-large'),
|
|||
).toMatchSnapshot();
|
|||
expect(
|
|||
document.querySelector('.main-quote-summary__exchange-rate-container'),
|
|||
).toMatchSnapshot();
|
|||
});
|
|||
});
|