-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRowSpec.js
32 lines (25 loc) · 1.03 KB
/
RowSpec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import Row from '../src/Row';
describe('Row', () => {
it('uses "div" by default', () => {
let instance = ReactTestUtils.renderIntoDocument(<Row />);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'DIV');
});
it('has "row" class', () => {
let instance = ReactTestUtils.renderIntoDocument(<Row>Row content</Row>);
assert.equal(ReactDOM.findDOMNode(instance).className, 'row');
});
it('Should merge additional classes passed in', () => {
let instance = ReactTestUtils.renderIntoDocument(<Row className="bob" />);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\bbob\b/));
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\brow\b/));
});
it('allows custom elements instead of "div"', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Row componentClass="section" />
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'SECTION');
});
});