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.
33 lines
1.0 KiB
33 lines
1.0 KiB
6 years ago
|
import React from 'react'
|
||
|
import assert from 'assert'
|
||
|
import { shallow } from 'enzyme'
|
||
|
import UserPreferencedCurrencyInput from '../user-preferenced-currency-input.component'
|
||
|
import CurrencyInput from '../../currency-input'
|
||
|
|
||
|
describe('UserPreferencedCurrencyInput Component', () => {
|
||
|
describe('rendering', () => {
|
||
|
it('should render properly', () => {
|
||
|
const wrapper = shallow(
|
||
|
<UserPreferencedCurrencyInput />
|
||
|
)
|
||
|
|
||
|
assert.ok(wrapper)
|
||
|
assert.equal(wrapper.find(CurrencyInput).length, 1)
|
||
|
})
|
||
|
|
||
|
it('should render useFiat for CurrencyInput based on preferences.useETHAsPrimaryCurrency', () => {
|
||
|
const wrapper = shallow(
|
||
|
<UserPreferencedCurrencyInput
|
||
|
useETHAsPrimaryCurrency
|
||
|
/>
|
||
|
)
|
||
|
|
||
|
assert.ok(wrapper)
|
||
|
assert.equal(wrapper.find(CurrencyInput).length, 1)
|
||
|
assert.equal(wrapper.find(CurrencyInput).props().useFiat, false)
|
||
|
wrapper.setProps({ useETHAsPrimaryCurrency: false })
|
||
|
assert.equal(wrapper.find(CurrencyInput).props().useFiat, true)
|
||
|
})
|
||
|
})
|
||
|
})
|