forked from rebassjs/rebass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButtonOutline.spec.js
43 lines (33 loc) · 1 KB
/
ButtonOutline.spec.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react'
import TestUtils from 'react-addons-test-utils'
import expect from 'expect'
import { ButtonOutline, Button } from '../src'
const renderer = TestUtils.createRenderer()
describe('ButtonOutline', () => {
let tree
beforeEach(() => {
renderer.render(<ButtonOutline />)
tree = renderer.getRenderOutput()
})
it('should render', () => {
expect(tree.type).toEqual(Button)
})
it('should have a className', () => {
expect(tree.props._className).toEqual('ButtonOutline')
})
it('should have a default color', () => {
expect(tree.props.color).toEqual('primary')
})
it('should have a default rounded prop', () => {
expect(tree.props.rounded).toEqual(true)
})
context('when custom styles are set', () => {
beforeEach(() => {
renderer.render(<ButtonOutline style={{ color: 'tomato' }} />)
tree = renderer.getRenderOutput()
})
it('should have a custom color', () => {
expect(tree.props.style.color).toEqual('tomato')
})
})
})