UNPKG

653 BJSXView Raw
1const React = require('react');
2const { expect } = require('chai');
3const { shallow } = require('enzyme');
4const { Value } = require('../');
5
6describe('<Value />', () => {
7 const component = shallow(<Value type="String" value="testing" />);
8
9 it('sets the base class', () => {
10 expect(component.hasClass('element-value')).to.equal(true);
11 });
12
13 it('sets the type class', () => {
14 expect(component.hasClass('element-value-is-string')).to.equal(true);
15 });
16
17 it('sets the title', () => {
18 expect(component.props().title).to.equal('testing');
19 });
20
21 it('sets the value', () => {
22 expect(component.text()).to.equal('testing');
23 });
24});
25
\No newline at end of file