forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRowSpec.js
More file actions
38 lines (31 loc) · 1.07 KB
/
RowSpec.js
File metadata and controls
38 lines (31 loc) · 1.07 KB
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
37
38
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import ReactDOM from 'react-dom';
import Row from '../src/Row';
describe('Row', () => {
it('uses "div" by default', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Row />
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'DIV');
});
it('has "row" class', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Row>Row content</Row>
);
assert.equal(ReactDOM.findDOMNode(instance).className, 'row');
});
it('Should merge additional classes passed in', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Row className="bob"/>
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bbob\b/));
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\brow\b/));
});
it('allows custom elements instead of "div"', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Row componentClass="section" />
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'SECTION');
});
});