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.
48 lines
1.3 KiB
48 lines
1.3 KiB
import React from 'react'
|
|
import { shallow } from 'enzyme'
|
|
import ModalRoot from '../../app/components/ModalRoot'
|
|
import SuccessfulSendCoins from '../../app/components/ModalRoot/SuccessfulSendCoins'
|
|
import SuccessfulSendPayment from '../../app/components/ModalRoot/SuccessfulSendPayment'
|
|
|
|
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)
|
|
})
|
|
})
|
|
|
|
describe('SuccessfulSendPayment modal', () => {
|
|
const props = {
|
|
...defaultProps,
|
|
modalType: 'SUCCESSFUL_SEND_PAYMENT',
|
|
modalProps: {}
|
|
}
|
|
const el = shallow(<ModalRoot {...props} />)
|
|
it('should render specific modal', () => {
|
|
expect(el.find(SuccessfulSendPayment).length).toBe(1)
|
|
})
|
|
})
|
|
|