UNPKG

745 BJSXView Raw
1const React = require('react');
2const { expect } = require('chai');
3const { shallow } = require('enzyme');
4const { Symbol } = require('bson');
5const { Value } = require('../');
6
7describe('<Value /> (rendering symbol)', () => {
8 const value = new Symbol('testing');
9 const component = shallow(<Value type="Symbol" 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-symbol')).to.equal(true);
17 });
18
19 it('sets the title', () => {
20 expect(component.props().title).to.equal('testing');
21 });
22
23 it('sets the value', () => {
24 expect(component.text()).to.equal('testing');
25 });
26});
27
\No newline at end of file