1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
metamask-extension/ui/components/app/transaction-breakdown/transaction-breakdown.component.test.js

32 lines
1005 B
JavaScript
Raw Normal View History

import React from 'react';
import { shallow } from 'enzyme';
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction';
2021-06-08 17:25:48 +02:00
import { GAS_LIMITS } from '../../../../shared/constants/gas';
import TransactionBreakdown from './transaction-breakdown.component';
2018-08-31 21:36:07 +02:00
describe('TransactionBreakdown Component', () => {
it('should render properly', () => {
2018-08-31 21:36:07 +02:00
const transaction = {
history: [],
id: 1,
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',
},
};
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" />,
{ context: { t: (str1, str2) => (str2 ? str1 + str2 : str1) } },
);
2018-08-31 21:36:07 +02:00
expect(wrapper.hasClass('transaction-breakdown')).toStrictEqual(true);
expect(wrapper.hasClass('test-class')).toStrictEqual(true);
});
});