2018-05-05 17:11:53 +02:00
|
|
|
import assert from 'assert'
|
|
|
|
import proxyquire from 'proxyquire'
|
|
|
|
|
|
|
|
let mapStateToProps
|
|
|
|
|
|
|
|
proxyquire('../account-list-item.container.js', {
|
|
|
|
'react-redux': {
|
|
|
|
connect: (ms, md) => {
|
|
|
|
mapStateToProps = ms
|
|
|
|
return () => ({})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'../send.selectors.js': {
|
|
|
|
getConversionRate: (s) => `mockConversionRate:${s}`,
|
2018-06-23 00:05:50 +02:00
|
|
|
getCurrentCurrency: (s) => `mockCurrentCurrency:${s}`,
|
2018-05-05 17:11:53 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('account-list-item container', () => {
|
|
|
|
|
|
|
|
describe('mapStateToProps()', () => {
|
|
|
|
|
|
|
|
it('should map the correct properties to props', () => {
|
|
|
|
assert.deepEqual(mapStateToProps('mockState'), {
|
|
|
|
conversionRate: 'mockConversionRate:mockState',
|
|
|
|
currentCurrency: 'mockCurrentCurrency:mockState',
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|