UNPKG

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