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() 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() 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() it('should render specific modal', () => { expect(el.find(SuccessfulSendPayment).length).toBe(1) }) })