blob: 8939e3d91dce3ab719f811e1d12a5518987a7e28 (
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
|
import { shallow } from 'enzyme';
import expect from 'expect';
import React from 'react';
import FlatButton from 'src/common/flat_button/flat_button';
describe('FlatButton', () => {
let flatButton;
beforeEach(() => {
flatButton = shallow(<FlatButton name='logout' buttonText='Logout' fontIconClass='fa fa-sign-out' />);
});
it('renders a FlatButton of type submit with name logout', () => {
expect(flatButton.find('FlatButton').props().name).toEqual('logout');
});
it('renders a FlatButton of type submit with text logout', () => {
expect(flatButton.find('FlatButton').props().label).toEqual('Logout');
});
it('renders a FlatButton with given fontIcon class', () => {
expect(flatButton.find('FlatButton').props().icon.props.className).toEqual('fa fa-sign-out');
});
});
|