2021-02-04 19:15:23 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
2021-03-16 22:00:08 +01:00
|
|
|
import UserPreferencedCurrencyDisplay from '../../../user-preferenced-currency-display';
|
|
|
|
import CancelTransactionGasFee from './cancel-transaction-gas-fee.component';
|
2018-09-19 23:30:52 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('CancelTransactionGasFee Component', () => {
|
|
|
|
it('should render', () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
const wrapper = shallow(<CancelTransactionGasFee value="0x3b9aca00" />);
|
2018-09-19 23:30:52 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(wrapper.find('.cancel-transaction-gas-fee')).toHaveLength(1);
|
|
|
|
expect(wrapper.find(UserPreferencedCurrencyDisplay)).toHaveLength(2);
|
2021-02-04 19:15:23 +01:00
|
|
|
const ethDisplay = wrapper.find(UserPreferencedCurrencyDisplay).at(0);
|
|
|
|
const fiatDisplay = wrapper.find(UserPreferencedCurrencyDisplay).at(1);
|
2018-09-19 23:30:52 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(ethDisplay.props().value).toStrictEqual('0x3b9aca00');
|
|
|
|
expect(ethDisplay.props().className).toStrictEqual(
|
2020-11-03 00:41:28 +01:00
|
|
|
'cancel-transaction-gas-fee__eth',
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-09-19 23:30:52 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(fiatDisplay.props().value).toStrictEqual('0x3b9aca00');
|
|
|
|
expect(fiatDisplay.props().className).toStrictEqual(
|
2020-11-03 00:41:28 +01:00
|
|
|
'cancel-transaction-gas-fee__fiat',
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|