|
| 1 | +/*global describe, it, assert */ |
| 2 | + |
| 3 | +var React = require('react'); |
| 4 | +var ReactTestUtils = require('react/lib/ReactTestUtils'); |
| 5 | +var Col = require('../lib/Col'); |
| 6 | + |
| 7 | +describe('Col', function () { |
| 8 | + it('Should set Offset of zero', function () { |
| 9 | + var instance = ReactTestUtils.renderIntoDocument( |
| 10 | + <Col xsOffset={0} smOffset={0} mdOffset={0} lgOffset={0} /> |
| 11 | + ); |
| 12 | + |
| 13 | + var instanceClassName = instance.getDOMNode().className; |
| 14 | + assert.ok(instanceClassName.match(/\bcol-xs-offset-0\b/)); |
| 15 | + assert.ok(instanceClassName.match(/\bcol-sm-offset-0\b/)); |
| 16 | + assert.ok(instanceClassName.match(/\bcol-md-offset-0\b/)); |
| 17 | + assert.ok(instanceClassName.match(/\bcol-lg-offset-0\b/)); |
| 18 | + }); |
| 19 | + |
| 20 | + it('Should set Pull of zero', function () { |
| 21 | + var instance = ReactTestUtils.renderIntoDocument( |
| 22 | + <Col xsPull={0} smPull={0} mdPull={0} lgPull={0} /> |
| 23 | + ); |
| 24 | + |
| 25 | + var instanceClassName = instance.getDOMNode().className; |
| 26 | + assert.ok(instanceClassName.match(/\bcol-xs-pull-0\b/)); |
| 27 | + assert.ok(instanceClassName.match(/\bcol-sm-pull-0\b/)); |
| 28 | + assert.ok(instanceClassName.match(/\bcol-md-pull-0\b/)); |
| 29 | + assert.ok(instanceClassName.match(/\bcol-lg-pull-0\b/)); |
| 30 | + }); |
| 31 | + |
| 32 | + it('Should set Push of zero', function () { |
| 33 | + var instance = ReactTestUtils.renderIntoDocument( |
| 34 | + <Col xsPush={0} smPush={0} mdPush={0} lgPush={0} /> |
| 35 | + ); |
| 36 | + |
| 37 | + var instanceClassName = instance.getDOMNode().className; |
| 38 | + assert.ok(instanceClassName.match(/\bcol-xs-push-0\b/)); |
| 39 | + assert.ok(instanceClassName.match(/\bcol-sm-push-0\b/)); |
| 40 | + assert.ok(instanceClassName.match(/\bcol-md-push-0\b/)); |
| 41 | + assert.ok(instanceClassName.match(/\bcol-lg-push-0\b/)); |
| 42 | + }); |
| 43 | +}); |
0 commit comments