diff --git a/app/routes/app/components/components/ModalRoot/ModalRoot.js b/app/components/ModalRoot/ModalRoot.js similarity index 100% rename from app/routes/app/components/components/ModalRoot/ModalRoot.js rename to app/components/ModalRoot/ModalRoot.js diff --git a/app/routes/app/components/components/ModalRoot/ModalRoot.scss b/app/components/ModalRoot/ModalRoot.scss similarity index 92% rename from app/routes/app/components/components/ModalRoot/ModalRoot.scss rename to app/components/ModalRoot/ModalRoot.scss index b20daf3a..3622414c 100644 --- a/app/routes/app/components/components/ModalRoot/ModalRoot.scss +++ b/app/components/ModalRoot/ModalRoot.scss @@ -1,4 +1,4 @@ -@import '../../../../../variables.scss'; +@import '../../variables.scss'; .container { position: absolute; @@ -39,4 +39,4 @@ width: 32px; height: 32px; } -} \ No newline at end of file +} diff --git a/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.js b/app/components/ModalRoot/SuccessfulSendCoins.js similarity index 100% rename from app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.js rename to app/components/ModalRoot/SuccessfulSendCoins.js diff --git a/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.scss b/app/components/ModalRoot/SuccessfulSendCoins.scss similarity index 92% rename from app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.scss rename to app/components/ModalRoot/SuccessfulSendCoins.scss index b562cf30..ef7bd550 100644 --- a/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.scss +++ b/app/components/ModalRoot/SuccessfulSendCoins.scss @@ -1,4 +1,4 @@ -@import '../../../../../../variables.scss'; +@import '../../variables.scss'; .container { position: relative; @@ -34,4 +34,4 @@ width: 15%; margin: 0 auto; } -} \ No newline at end of file +} diff --git a/app/routes/app/components/components/ModalRoot/index.js b/app/components/ModalRoot/index.js similarity index 100% rename from app/routes/app/components/components/ModalRoot/index.js rename to app/components/ModalRoot/index.js diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js index 4b13637d..b1db6815 100644 --- a/app/routes/app/components/App.js +++ b/app/routes/app/components/App.js @@ -2,8 +2,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import LoadingBolt from 'components/LoadingBolt' import Form from 'components/Form' +import ModalRoot from 'components/ModalRoot' import Nav from 'components/Nav' -import ModalRoot from './components/ModalRoot' import styles from './App.scss' class App extends Component { diff --git a/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/index.js b/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/index.js deleted file mode 100644 index b6c90a73..00000000 --- a/app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import SuccessfulSendCoins from './SuccessfulSendCoins' - -export default SuccessfulSendCoins diff --git a/test/components/ModalRoot.spec.js b/test/components/ModalRoot.spec.js new file mode 100644 index 00000000..cbd99af7 --- /dev/null +++ b/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() + 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) + }) +});