diff --git a/test/RowSpec.js b/test/RowSpec.js new file mode 100644 index 0000000000..7248f80d3a --- /dev/null +++ b/test/RowSpec.js @@ -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( + + ); + + assert.equal(React.findDOMNode(instance).nodeName, 'DIV'); + }); + + it('has "row" class', function () { + let instance = ReactTestUtils.renderIntoDocument( + Row content + ); + assert.equal(React.findDOMNode(instance).className, 'row'); + }); + + it('Should merge additional classes passed in', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + 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( + + ); + + assert.equal(React.findDOMNode(instance).nodeName, 'SECTION'); + }); +});