Browse Source

test(ModalRoot): add baseline tests

renovate/lint-staged-8.x
Jonathan Zobro 7 years ago
parent
commit
d3ecbe728b
  1. 35
      test/components/ModalRoot.spec.js

35
test/components/ModalRoot.spec.js

@ -0,0 +1,35 @@
import React from 'react'
import { shallow } from 'enzyme'
import ModalRoot from '../../app/components/ModalRoot'
import SuccessfulSendCoins from '../../app/components/ModalRoot/SuccessfulSendCoins'
const defaultProps = {
hideModal: () => {},
modalProps: {},
currentTicker: {},
currency: ''
}
describe('no modal', () => {
const props = { ...defaultProps }
const el = shallow(<ModalRoot {...props} />)
it('should return null', () => {
expect(el.html()).toBeNull()
})
})
describe('SuccessfulSendCoins modal', () => {
const props = {
...defaultProps,
modalType: 'SUCCESSFUL_SEND_COINS',
modalProps: {
amount: 10000000,
addr: 'mkrfWvHSbUjgyne4EWnydWekywWBjrucKs',
txid: 'fd7dfc8b809a128323b1b679fe31e27ed7b34baae0a79cd4a290fb4dab892d26'
}
}
const el = shallow(<ModalRoot {...props} />)
it('should render specific modal', () => {
expect(el.find(SuccessfulSendCoins).length).toBe(1)
})
});
Loading…
Cancel
Save