-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJumbotronSpec.js
36 lines (31 loc) · 1.02 KB
/
JumbotronSpec.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
34
35
36
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import Jumbotron from '../src/Jumbotron';
describe('<Jumbotron>', () => {
it('Should output a div with content', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Jumbotron>
<strong>Content</strong>
</Jumbotron>
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'DIV');
assert.ok(
ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'strong')
);
});
it('Should have a jumbotron class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Jumbotron>Content</Jumbotron>
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bjumbotron\b/));
});
it('Should override node class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Jumbotron componentClass="section">
<strong>Content</strong>
</Jumbotron>
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'SECTION');
});
});