2018-10-17 01:03:29 +02:00
|
|
|
import assert from 'assert'
|
|
|
|
import proxyquire from 'proxyquire'
|
|
|
|
|
|
|
|
let mapStateToProps
|
|
|
|
|
|
|
|
proxyquire('../user-preferenced-currency-input.container.js', {
|
|
|
|
'react-redux': {
|
|
|
|
connect: ms => {
|
|
|
|
mapStateToProps = ms
|
|
|
|
return () => ({})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('UserPreferencedCurrencyInput container', () => {
|
|
|
|
describe('mapStateToProps()', () => {
|
|
|
|
it('should return the correct props', () => {
|
|
|
|
const mockState = {
|
|
|
|
metamask: {
|
|
|
|
preferences: {
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
2018-10-17 01:03:29 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.deepEqual(mapStateToProps(mockState), {
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
2018-10-17 01:03:29 +02:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|