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.
45 lines
958 B
45 lines
958 B
6 years ago
|
import assert from 'assert'
|
||
|
import proxyquire from 'proxyquire'
|
||
|
import sinon from 'sinon'
|
||
|
|
||
|
// let mapStateToProps
|
||
|
let mapDispatchToProps
|
||
|
|
||
|
const actionSpies = {
|
||
|
hideModal: sinon.spy(),
|
||
|
}
|
||
|
|
||
|
proxyquire('../gas-modal-page-container.container.js', {
|
||
|
'react-redux': {
|
||
|
connect: (ms, md) => {
|
||
|
// mapStateToProps = ms
|
||
|
mapDispatchToProps = md
|
||
|
return () => ({})
|
||
|
},
|
||
|
},
|
||
|
'../../../actions': actionSpies,
|
||
|
})
|
||
|
|
||
|
describe('gas-modal-page-container container', () => {
|
||
|
|
||
|
describe('mapDispatchToProps()', () => {
|
||
|
let dispatchSpy
|
||
|
let mapDispatchToPropsObject
|
||
|
|
||
|
beforeEach(() => {
|
||
|
dispatchSpy = sinon.spy()
|
||
|
mapDispatchToPropsObject = mapDispatchToProps(dispatchSpy)
|
||
|
})
|
||
|
|
||
|
describe('hideModal()', () => {
|
||
|
it('should dispatch a hideModal action', () => {
|
||
|
mapDispatchToPropsObject.hideModal()
|
||
|
assert(dispatchSpy.calledOnce)
|
||
|
assert(actionSpies.hideModal.calledOnce)
|
||
|
})
|
||
|
})
|
||
|
|
||
|
})
|
||
|
|
||
|
})
|