A Metamask fork with Infura removed and default networks editable
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.
 
 
 
 
 
ciphermask/ui/pages/swaps/main-quote-summary/main-quote-summary.test.js

39 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();
});
});