diff --git a/test/GridSpec.js b/test/GridSpec.js new file mode 100644 index 0000000000..294800f3af --- /dev/null +++ b/test/GridSpec.js @@ -0,0 +1,43 @@ +import React from 'react'; +import ReactTestUtils from 'react/lib/ReactTestUtils'; +import Grid from '../src/Grid'; + +describe('Grid', function () { + it('uses "div" by default', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + + assert.equal(React.findDOMNode(instance).nodeName, 'DIV'); + }); + + it('has "container" class by default', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + assert.equal(React.findDOMNode(instance).className, 'container'); + }); + + it('turns grid into "full-width" layout via "fluid" property set', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + assert.equal(React.findDOMNode(instance).className, 'container-fluid'); + }); + + it('should merge additional classes passed in', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + assert.ok(React.findDOMNode(instance).className.match(/\bwhatever\b/)); + assert.ok(React.findDOMNode(instance).className.match(/\bcontainer-fluid\b/)); + }); + + it('allows custom elements instead of "div"', function () { + let instance = ReactTestUtils.renderIntoDocument( + + ); + + assert.equal(React.findDOMNode(instance).nodeName, 'SECTION'); + }); +});