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.
40 lines
1.0 KiB
40 lines
1.0 KiB
import React from 'react';
|
|
import configureMockStore from 'redux-mock-store';
|
|
|
|
import {
|
|
renderWithProvider,
|
|
createSwapsMockStore,
|
|
} from '../../../../test/jest';
|
|
import LoadingSwapsQuotes from '.';
|
|
|
|
const createProps = (customProps = {}) => {
|
|
return {
|
|
loadingComplete: true,
|
|
onDone: jest.fn(),
|
|
aggregatorMetadata: {
|
|
agg1: {
|
|
color: '#283B4C',
|
|
title: 'agg1',
|
|
icon: 'data:image/png;base64,iVBORw0KGgoAAA',
|
|
},
|
|
agg2: {
|
|
color: '#283B4C',
|
|
title: 'agg2',
|
|
icon: 'data:image/png;base64,iVBORw0KGgoAAA',
|
|
},
|
|
},
|
|
...customProps,
|
|
};
|
|
};
|
|
|
|
describe('LoadingSwapsQuotes', () => {
|
|
it('renders the component with initial props', () => {
|
|
const store = configureMockStore()(createSwapsMockStore());
|
|
const { getByText } = renderWithProvider(
|
|
<LoadingSwapsQuotes {...createProps()} />,
|
|
store,
|
|
);
|
|
expect(getByText('Fetching quote 1 of 2')).toBeInTheDocument();
|
|
expect(getByText('Back')).toBeInTheDocument();
|
|
});
|
|
});
|
|
|