Skip to content

Commit

Permalink
[fixed] Col Offset/Pull/Push of zero. Fixes react-bootstrap#406
Browse files Browse the repository at this point in the history
  • Loading branch information
aforty committed Mar 5, 2015
1 parent e1be8c1 commit 3b6ba7a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/ColSpec.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*global describe, it, assert */

var React = require('react');
var ReactTestUtils = require('react/lib/ReactTestUtils');
var Col = require('../lib/Col');

describe('Col', function () {
it('Should set Offset of zero', function () {
var instance = ReactTestUtils.renderIntoDocument(
<Col xsOffset={0} smOffset={0} mdOffset={0} lgOffset={0} />
);

var instanceClassName = instance.getDOMNode().className;
assert.ok(instanceClassName.match(/\bcol-xs-offset-0\b/));
assert.ok(instanceClassName.match(/\bcol-sm-offset-0\b/));
assert.ok(instanceClassName.match(/\bcol-md-offset-0\b/));
assert.ok(instanceClassName.match(/\bcol-lg-offset-0\b/));
});

it('Should set Pull of zero', function () {
var instance = ReactTestUtils.renderIntoDocument(
<Col xsPull={0} smPull={0} mdPull={0} lgPull={0} />
);

var instanceClassName = instance.getDOMNode().className;
assert.ok(instanceClassName.match(/\bcol-xs-pull-0\b/));
assert.ok(instanceClassName.match(/\bcol-sm-pull-0\b/));
assert.ok(instanceClassName.match(/\bcol-md-pull-0\b/));
assert.ok(instanceClassName.match(/\bcol-lg-pull-0\b/));
});

it('Should set Push of zero', function () {
var instance = ReactTestUtils.renderIntoDocument(
<Col xsPush={0} smPush={0} mdPush={0} lgPush={0} />
);

var instanceClassName = instance.getDOMNode().className;
assert.ok(instanceClassName.match(/\bcol-xs-push-0\b/));
assert.ok(instanceClassName.match(/\bcol-sm-push-0\b/));
assert.ok(instanceClassName.match(/\bcol-md-push-0\b/));
assert.ok(instanceClassName.match(/\bcol-lg-push-0\b/));
});
});

0 comments on commit 3b6ba7a

Please sign in to comment.