1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/components/app/user-preferenced-currency-input/user-preferenced-currency-input.component.test.js
Mark Stacey d91ce9c4b5 Revert "Merge pull request #16353 from MetaMask/Version-v10.22.0"
This reverts commit 308033edbf, reversing
changes made to b8d71d6d1d.
2022-11-15 11:30:02 -03:30

32 lines
1.1 KiB
JavaScript

import React from 'react';
import { shallow } from 'enzyme';
import CurrencyInput from '../currency-input';
import UserPreferencedCurrencyInput from './user-preferenced-currency-input.component';
describe('UserPreferencedCurrencyInput Component', () => {
describe('rendering', () => {
it('should render properly', () => {
const wrapper = shallow(<UserPreferencedCurrencyInput />);
expect(wrapper).toHaveLength(1);
expect(wrapper.find(CurrencyInput)).toHaveLength(1);
});
it('should render featureSecondary for CurrencyInput based on preferences.useNativeCurrencyAsPrimaryCurrency', () => {
const wrapper = shallow(
<UserPreferencedCurrencyInput useNativeCurrencyAsPrimaryCurrency />,
);
expect(wrapper).toHaveLength(1);
expect(wrapper.find(CurrencyInput)).toHaveLength(1);
expect(
wrapper.find(CurrencyInput).props().featureSecondary,
).toStrictEqual(false);
wrapper.setProps({ useNativeCurrencyAsPrimaryCurrency: false });
expect(
wrapper.find(CurrencyInput).props().featureSecondary,
).toStrictEqual(true);
});
});
});