2019-01-25 12:44:54 -08:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { render, cleanup } from 'react-testing-library';
|
|
|
|
import { ThemeProvider } from 'styled-components';
|
|
|
|
import 'jest-dom/extend-expect';
|
|
|
|
|
|
|
|
import { TransactionDailyComponent } from '../../app/components/transaction-daily';
|
2019-02-10 09:52:34 -08:00
|
|
|
import { appTheme } from '../../app/theme';
|
2019-01-25 12:44:54 -08:00
|
|
|
|
|
|
|
afterEach(cleanup);
|
|
|
|
|
|
|
|
describe('<TransactionDailyComponent />', () => {
|
|
|
|
describe('render()', () => {
|
|
|
|
test('should render user daily transactions', () => {
|
|
|
|
const { container } = render(
|
|
|
|
<ThemeProvider theme={appTheme}>
|
|
|
|
<TransactionDailyComponent
|
2019-02-20 11:36:39 -08:00
|
|
|
transactionsDate='2019-02-20T19:31:57.117Z'
|
2019-01-25 12:44:54 -08:00
|
|
|
zecPrice={1.345}
|
|
|
|
transactions={[
|
|
|
|
{
|
|
|
|
type: 'receive',
|
|
|
|
transactionId: 's0a8das098fgh2348a',
|
|
|
|
address: '123456789123456789123456789123456789',
|
|
|
|
amount: 1.7891,
|
|
|
|
zecPrice: 1.345,
|
2019-02-20 11:36:39 -08:00
|
|
|
date: '2019-02-20T19:31:57.117Z',
|
2019-02-16 19:34:12 -08:00
|
|
|
theme: appTheme,
|
2019-02-19 07:59:36 -08:00
|
|
|
fees: 0.001,
|
2019-01-25 12:44:54 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'send',
|
|
|
|
transactionId: '0asd908fgj90f01',
|
|
|
|
address: '123456789123456789123456789123456789',
|
|
|
|
amount: 0.8458,
|
|
|
|
zecPrice: 1.344,
|
2019-02-20 11:36:39 -08:00
|
|
|
date: '2019-02-20T19:31:57.117Z',
|
2019-02-16 19:34:12 -08:00
|
|
|
theme: appTheme,
|
2019-02-19 07:59:36 -08:00
|
|
|
fees: 0.001,
|
2019-01-25 12:44:54 -08:00
|
|
|
},
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
</ThemeProvider>,
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(container).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|