All files / button/__tests__ Button-test.js

100% Statements 16/16
100% Branches 0/0
71.43% Functions 5/7
100% Lines 15/15
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    1x 1x 1x 1x   1x 1x 1x 1x 1x     1x 1x 1x     1x 1x 1x      
/* global describe, it */
 
import assert from 'assert'
import React from 'react'
import {shallow} from 'enzyme'
import Button from '../'
 
describe('Button', () => {
  it('should bubble up click events', (done) => {
    const click = () => done()
    const wrapper = shallow(<Button onClick={click} />)
    wrapper.find('.Button').simulate('click')
  })
 
  it('should have `Button--raised` class when raised property is true', () => {
    const wrapper = shallow(<Button onclick={() => {}} raised />)
    assert.ok(wrapper.find('.Button').hasClass('Button--raised'))
  })
 
  it('should be disabled when told so', () => {
    const wrapper = shallow(<Button onClick={() => {}} disabled />)
    assert.ok(wrapper.find('.Button').props().disabled)
  })
})