forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableSpec.js
51 lines (44 loc) · 1.65 KB
/
TableSpec.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import ReactDOM from 'react-dom';
import Table from '../src/Table';
describe('Table', () => {
it('Should be a table', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table />
);
assert.equal(ReactDOM.findDOMNode(instance).nodeName, 'TABLE');
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable\b/));
});
it('Should have correct class when striped', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table striped />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-striped\b/));
});
it('Should have correct class when hover', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table hover />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-hover\b/));
});
it('Should have correct class when bordered', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table bordered />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-bordered\b/));
});
it('Should have correct class when condensed', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table condensed />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-condensed\b/));
});
it('Should have responsive wrapper', () => {
let instance = ReactTestUtils.renderIntoDocument(
<Table responsive />
);
assert.ok(ReactDOM.findDOMNode(instance).className.match(/\btable-responsive\b/));
assert.ok(ReactDOM.findDOMNode(instance).firstChild.className.match(/\btable\b/));
});
});