2022-03-30 22:21:27 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
import {
|
|
|
|
renderWithProvider,
|
|
|
|
screen,
|
|
|
|
fireEvent,
|
|
|
|
} from '../../../../../test/jest';
|
|
|
|
import configureStore from '../../../../store/store';
|
|
|
|
|
|
|
|
import DetectedTokenAggregators from './detected-token-aggregators';
|
|
|
|
|
|
|
|
describe('DetectedTokenAggregators', () => {
|
|
|
|
const args = {
|
2022-06-28 15:11:19 +02:00
|
|
|
aggregatorsList: [
|
2022-03-30 22:21:27 +02:00
|
|
|
'Aave',
|
|
|
|
'Bancor',
|
|
|
|
'CMC',
|
|
|
|
'Crypto.com',
|
|
|
|
'CoinGecko',
|
|
|
|
'1inch',
|
|
|
|
'Paraswap',
|
|
|
|
'PMM',
|
|
|
|
'Synthetix',
|
|
|
|
'Zapper',
|
|
|
|
'Zerion',
|
|
|
|
'0x',
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
it('should render the detected token aggregators', async () => {
|
|
|
|
const store = configureStore({});
|
|
|
|
renderWithProvider(<DetectedTokenAggregators {...args} />, store);
|
|
|
|
|
|
|
|
expect(screen.getByText('From token lists:')).toBeInTheDocument();
|
|
|
|
expect(screen.getByText('Aave, Bancor')).toBeInTheDocument();
|
|
|
|
expect(screen.getByText('+ 10 more')).toBeInTheDocument();
|
|
|
|
fireEvent.click(screen.getByText('+ 10 more'));
|
|
|
|
expect(
|
|
|
|
screen.getByText(
|
|
|
|
'Aave, Bancor, CMC, Crypto.com, CoinGecko, 1inch, Paraswap, PMM, Synthetix, Zapper, Zerion, 0x.',
|
|
|
|
),
|
|
|
|
).toBeInTheDocument();
|
|
|
|
});
|
|
|
|
});
|