1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 12:47:14 +01:00
metamask-extension/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js

26 lines
1.0 KiB
JavaScript
Raw Normal View History

import React from 'react';
import { shallow } from 'enzyme';
import UserPreferencedCurrencyDisplay from '../../../user-preferenced-currency-display';
import CancelTransactionGasFee from './cancel-transaction-gas-fee.component';
2018-09-19 23:30:52 +02:00
describe('CancelTransactionGasFee Component', () => {
it('should render', () => {
const wrapper = shallow(<CancelTransactionGasFee value="0x3b9aca00" />);
2018-09-19 23:30:52 +02:00
expect(wrapper.find('.cancel-transaction-gas-fee')).toHaveLength(1);
expect(wrapper.find(UserPreferencedCurrencyDisplay)).toHaveLength(2);
const ethDisplay = wrapper.find(UserPreferencedCurrencyDisplay).at(0);
const fiatDisplay = wrapper.find(UserPreferencedCurrencyDisplay).at(1);
2018-09-19 23:30:52 +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',
);
2018-09-19 23:30:52 +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',
);
});
});