mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add tests for Card component
This commit is contained in:
parent
702b756882
commit
18c94c4ac9
@ -1,7 +1,7 @@
|
|||||||
.card {
|
.card {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.08);
|
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.08);
|
||||||
padding: 16px 8px;
|
padding: 8px;
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
border-bottom: 1px solid #d8d8d8;
|
border-bottom: 1px solid #d8d8d8;
|
||||||
|
25
ui/app/components/card/tests/card.component.test.js
Normal file
25
ui/app/components/card/tests/card.component.test.js
Normal file
@ -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')
|
||||||
|
})
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user