1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/modals/cancel-transaction/cancel-transaction-gas-fee/cancel-transaction-gas-fee.component.test.js
2021-04-28 14:53:59 -05:00

26 lines
1.0 KiB
JavaScript

import React from 'react';
import { shallow } from 'enzyme';
import UserPreferencedCurrencyDisplay from '../../../user-preferenced-currency-display';
import CancelTransactionGasFee from './cancel-transaction-gas-fee.component';
describe('CancelTransactionGasFee Component', () => {
it('should render', () => {
const wrapper = shallow(<CancelTransactionGasFee value="0x3b9aca00" />);
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);
expect(ethDisplay.props().value).toStrictEqual('0x3b9aca00');
expect(ethDisplay.props().className).toStrictEqual(
'cancel-transaction-gas-fee__eth',
);
expect(fiatDisplay.props().value).toStrictEqual('0x3b9aca00');
expect(fiatDisplay.props().className).toStrictEqual(
'cancel-transaction-gas-fee__fiat',
);
});
});