forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlyphiconSpec.js
33 lines (27 loc) · 1.1 KB
/
GlyphiconSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import ReactDOM from 'react-dom';
import Glyphicon from '../src/Glyphicon';
describe('Glyphicon', () => {
it('Should have correct class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Glyphicon glyph='star' />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bglyphicon\b/));
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bglyphicon-star\b/));
});
it('renders without the .form-control-feedback class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Glyphicon glyph='star' />
);
assert.notOk(ReactDOM.findDOMNode(instance).className.match(/\bform-control-feedback\b/));
});
context('when setting the formControlFeedback prop', () => {
it('should have the .form-control-feedback class set', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Glyphicon formControlFeedback glyph='star' />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bform-control-feedback\b/));
});
});
});