-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from ynonp/master
Add spec to Button component
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import expect from 'expect'; | ||
import style from '../../button/style'; | ||
import utils from '../../utils/testing'; | ||
import Button from '../index'; | ||
|
||
describe('Button', function () { | ||
let button; | ||
|
||
describe('#render', function () { | ||
|
||
it('uses flat and primary styles by default', function () { | ||
button = utils.shallowRenderComponent(Button); | ||
|
||
expect(button.props.className).toContain(style.flat); | ||
expect(button.props.className).toContain(style.primary); | ||
}); | ||
|
||
it('renders accent button with accent style', function () { | ||
button = utils.shallowRenderComponent(Button, { accent: true }); | ||
|
||
expect(button.props.className).toContain(style.flat); | ||
expect(button.props.className).toContain(style.accent); | ||
}); | ||
|
||
it('1 renders mini button with mini style', function () { | ||
button = utils.shallowRenderComponent(Button, { mini: true }); | ||
|
||
expect(button.props.className).toContain(style.flat); | ||
expect(button.props.className).toContain(style.primary); | ||
expect(button.props.className).toContain(style.mini); | ||
}); | ||
|
||
it('renders mini accented button with both styles', function () { | ||
button = utils.shallowRenderComponent(Button, { mini: true, accent: true }); | ||
|
||
expect(button.props.className).toContain(style.flat); | ||
expect(button.props.className).toContain(style.accent); | ||
expect(button.props.className).toContain(style.mini); | ||
}); | ||
|
||
}); | ||
}); |