diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-09-01 03:30:16 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-09-13 10:48:51 +0800 |
commit | 18c94c4ac9a2e6981bb9dedc49b7351582153707 (patch) | |
tree | 88611840280ef4e79b292524428ff6f0f1f475e1 /ui | |
parent | 702b7568820d7a695f191df6bf44c76b37fdc7d8 (diff) | |
download | tangerine-wallet-browser-18c94c4ac9a2e6981bb9dedc49b7351582153707.tar.gz tangerine-wallet-browser-18c94c4ac9a2e6981bb9dedc49b7351582153707.tar.zst tangerine-wallet-browser-18c94c4ac9a2e6981bb9dedc49b7351582153707.zip |
Add tests for Card component
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/card/index.scss | 2 | ||||
-rw-r--r-- | ui/app/components/card/tests/card.component.test.js | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/ui/app/components/card/index.scss b/ui/app/components/card/index.scss index 68d972709..bde54a15e 100644 --- a/ui/app/components/card/index.scss +++ b/ui/app/components/card/index.scss @@ -1,7 +1,7 @@ .card { border-radius: 4px; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.08); - padding: 16px 8px; + padding: 8px; &__title { border-bottom: 1px solid #d8d8d8; diff --git a/ui/app/components/card/tests/card.component.test.js b/ui/app/components/card/tests/card.component.test.js new file mode 100644 index 000000000..cea05033f --- /dev/null +++ b/ui/app/components/card/tests/card.component.test.js @@ -0,0 +1,25 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import Card from '../card.component' + +describe('Card Component', () => { + it('should render a card with a title and child element', () => { + const wrapper = shallow( + <Card + title="Test" + className="card-test-class" + > + <div className="child-test-class">Child</div> + </Card> + ) + + assert.ok(wrapper.hasClass('card-test-class')) + const title = wrapper.find('.card__title') + assert.ok(title) + assert.equal(title.text(), 'Test') + const child = wrapper.find('.child-test-class') + assert.ok(child) + assert.equal(child.text(), 'Child') + }) +}) |