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.
32 lines
897 B
32 lines
897 B
4 years ago
|
import React from 'react';
|
||
|
|
||
4 years ago
|
import { renderWithProvider } from '../../../../test/jest';
|
||
4 years ago
|
import SlippageButtons from '.';
|
||
|
|
||
|
const createProps = (customProps = {}) => {
|
||
|
return {
|
||
|
onSelect: jest.fn(),
|
||
|
maxAllowedSlippage: 15,
|
||
|
currentSlippage: 3,
|
||
|
...customProps,
|
||
|
};
|
||
|
};
|
||
|
|
||
|
describe('SlippageButtons', () => {
|
||
|
it('renders the component with initial props', () => {
|
||
|
const { getByText } = renderWithProvider(
|
||
|
<SlippageButtons {...createProps()} />,
|
||
|
);
|
||
|
expect(getByText('2%')).toBeInTheDocument();
|
||
|
expect(getByText('3%')).toBeInTheDocument();
|
||
|
expect(getByText('custom')).toBeInTheDocument();
|
||
|
expect(getByText('Advanced Options')).toBeInTheDocument();
|
||
|
expect(
|
||
|
document.querySelector('.slippage-buttons__header'),
|
||
|
).toMatchSnapshot();
|
||
|
expect(
|
||
|
document.querySelector('.slippage-buttons__button-group'),
|
||
|
).toMatchSnapshot();
|
||
|
});
|
||
|
});
|