2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
2021-04-28 21:53:59 +02:00
|
|
|
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction';
|
2021-06-08 17:25:48 +02:00
|
|
|
import { GAS_LIMITS } from '../../../../shared/constants/gas';
|
2021-03-16 22:00:08 +01:00
|
|
|
import TransactionBreakdown from './transaction-breakdown.component';
|
2018-08-31 21:36:07 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('TransactionBreakdown Component', () => {
|
|
|
|
it('should render properly', () => {
|
2018-08-31 21:36:07 +02:00
|
|
|
const transaction = {
|
|
|
|
history: [],
|
|
|
|
id: 1,
|
2020-11-07 08:38:12 +01:00
|
|
|
status: TRANSACTION_STATUSES.CONFIRMED,
|
2018-08-31 21:36:07 +02:00
|
|
|
txParams: {
|
|
|
|
from: '0x1',
|
2021-06-08 17:25:48 +02:00
|
|
|
gas: GAS_LIMITS.SIMPLE,
|
2018-08-31 21:36:07 +02:00
|
|
|
gasPrice: '0x3b9aca00',
|
|
|
|
nonce: '0xa4',
|
|
|
|
to: '0x2',
|
|
|
|
value: '0x2386f26fc10000',
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-08-31 21:36:07 +02:00
|
|
|
|
|
|
|
const wrapper = shallow(
|
2020-11-03 00:41:28 +01:00
|
|
|
<TransactionBreakdown transaction={transaction} className="test-class" />,
|
2020-07-14 17:20:41 +02:00
|
|
|
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } },
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-08-31 21:36:07 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(wrapper.hasClass('transaction-breakdown')).toStrictEqual(true);
|
|
|
|
expect(wrapper.hasClass('test-class')).toStrictEqual(true);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|