Skip to content

Commit 7720d2c

Browse files
committed
Merge pull request react-bootstrap#1075 from AlexKVal/row-spec
Add missing tests for 'Row'
2 parents b790e0d + 9f88221 commit 7720d2c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/RowSpec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import ReactTestUtils from 'react/lib/ReactTestUtils';
3+
import Row from '../src/Row';
4+
5+
describe('Row', function () {
6+
it('uses "div" by default', function () {
7+
let instance = ReactTestUtils.renderIntoDocument(
8+
<Row />
9+
);
10+
11+
assert.equal(React.findDOMNode(instance).nodeName, 'DIV');
12+
});
13+
14+
it('has "row" class', function () {
15+
let instance = ReactTestUtils.renderIntoDocument(
16+
<Row>Row content</Row>
17+
);
18+
assert.equal(React.findDOMNode(instance).className, 'row');
19+
});
20+
21+
it('Should merge additional classes passed in', function () {
22+
let instance = ReactTestUtils.renderIntoDocument(
23+
<Row className="bob"/>
24+
);
25+
assert.ok(React.findDOMNode(instance).className.match(/\bbob\b/));
26+
assert.ok(React.findDOMNode(instance).className.match(/\brow\b/));
27+
});
28+
29+
it('allows custom elements instead of "div"', function () {
30+
let instance = ReactTestUtils.renderIntoDocument(
31+
<Row componentClass='section' />
32+
);
33+
34+
assert.equal(React.findDOMNode(instance).nodeName, 'SECTION');
35+
});
36+
});

0 commit comments

Comments
 (0)