UNPKG

hbm-react-components

Version:
25 lines (20 loc) 752 B
/* 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) }) })