Skip to content

Commit

Permalink
Merge pull request react-bootstrap#1075 from AlexKVal/row-spec
Browse files Browse the repository at this point in the history
Add missing tests for 'Row'
  • Loading branch information
jquense committed Jul 28, 2015
2 parents b790e0d + 9f88221 commit 7720d2c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/RowSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import Row from '../src/Row';

describe('Row', function () {
it('uses "div" by default', function () {
let instance = ReactTestUtils.renderIntoDocument(
<Row />
);

assert.equal(React.findDOMNode(instance).nodeName, 'DIV');
});

it('has "row" class', function () {
let instance = ReactTestUtils.renderIntoDocument(
<Row>Row content</Row>
);
assert.equal(React.findDOMNode(instance).className, 'row');
});

it('Should merge additional classes passed in', function () {
let instance = ReactTestUtils.renderIntoDocument(
<Row className="bob"/>
);
assert.ok(React.findDOMNode(instance).className.match(/\bbob\b/));
assert.ok(React.findDOMNode(instance).className.match(/\brow\b/));
});

it('allows custom elements instead of "div"', function () {
let instance = ReactTestUtils.renderIntoDocument(
<Row componentClass='section' />
);

assert.equal(React.findDOMNode(instance).nodeName, 'SECTION');
});
});

0 comments on commit 7720d2c

Please sign in to comment.