aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modal/modal-content/tests
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-09-20 05:30:52 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-09-20 05:31:10 +0800
commit2cfdc95eebc3e0a878017090f22e5136cff709a6 (patch)
tree34ba4eee9afad4c92d748f76f76b50a0ae96a113 /ui/app/components/modal/modal-content/tests
parent77e8eac4b380b35f4ab2e6abd82fe929ec7f7c1b (diff)
downloadtangerine-wallet-browser-2cfdc95eebc3e0a878017090f22e5136cff709a6.tar.gz
tangerine-wallet-browser-2cfdc95eebc3e0a878017090f22e5136cff709a6.tar.zst
tangerine-wallet-browser-2cfdc95eebc3e0a878017090f22e5136cff709a6.zip
Add unit tests
Diffstat (limited to 'ui/app/components/modal/modal-content/tests')
-rw-r--r--ui/app/components/modal/modal-content/tests/modal-content.component.test.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/ui/app/components/modal/modal-content/tests/modal-content.component.test.js b/ui/app/components/modal/modal-content/tests/modal-content.component.test.js
new file mode 100644
index 000000000..17af09f45
--- /dev/null
+++ b/ui/app/components/modal/modal-content/tests/modal-content.component.test.js
@@ -0,0 +1,44 @@
+import React from 'react'
+import assert from 'assert'
+import { shallow } from 'enzyme'
+import ModalContent from '../modal-content.component'
+
+describe('ModalContent Component', () => {
+ it('should render a title', () => {
+ const wrapper = shallow(
+ <ModalContent
+ title="Modal Title"
+ />
+ )
+
+ assert.equal(wrapper.find('.modal-content__title').length, 1)
+ assert.equal(wrapper.find('.modal-content__title').text(), 'Modal Title')
+ assert.equal(wrapper.find('.modal-content__description').length, 0)
+ })
+
+ it('should render a description', () => {
+ const wrapper = shallow(
+ <ModalContent
+ description="Modal Description"
+ />
+ )
+
+ assert.equal(wrapper.find('.modal-content__title').length, 0)
+ assert.equal(wrapper.find('.modal-content__description').length, 1)
+ assert.equal(wrapper.find('.modal-content__description').text(), 'Modal Description')
+ })
+
+ it('should render both a title and a description', () => {
+ const wrapper = shallow(
+ <ModalContent
+ title="Modal Title"
+ description="Modal Description"
+ />
+ )
+
+ assert.equal(wrapper.find('.modal-content__title').length, 1)
+ assert.equal(wrapper.find('.modal-content__title').text(), 'Modal Title')
+ assert.equal(wrapper.find('.modal-content__description').length, 1)
+ assert.equal(wrapper.find('.modal-content__description').text(), 'Modal Description')
+ })
+})