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.
44 lines
958 B
44 lines
958 B
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)
|
|
})
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|