blob: ea05ee6e931db70a3a2f47784739821ff28232ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import React from 'react'
import renderer from 'react-test-renderer'
import Button from '../../../components/common/Button'
describe('Button Component', () => {
it('should render correctly', () => {
let button = renderer.create(
<Button className="classname" onClick={() => "onclick"} title="title" icon="icon">
<a>foo</a>
</Button>
),
tree = button.toJSON()
expect(tree).toMatchSnapshot()
})
it('should be able to be disabled', () => {
let button = renderer.create(
<Button className="classname" onClick={() => "onclick"} disabled="true" children="children">
<a>foo</a>
</Button>
),
tree = button.toJSON()
expect(tree).toMatchSnapshot()
})
})
|