A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
ciphermask/ui/components/app/user-preferenced-currency-i.../user-preferenced-currency-i...

31 lines
1.1 KiB

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);
});
});
});