forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-row.js
More file actions
57 lines (42 loc) · 1.34 KB
/
test-row.js
File metadata and controls
57 lines (42 loc) · 1.34 KB
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
52
53
54
55
56
57
/**
* MUI React Row Component Tests
* @module test/react-tests/test-row
*/
import assert from 'assert';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactUtils from 'react-addons-test-utils';
import Row from '../../src/react/row';
import { getShallowRendererOutput } from '../lib/react-helpers';
describe('react/grid', function() {
it('row renders properly', function() {
let result = getShallowRendererOutput(<Row></Row>);
assert.equal(result.type, 'div');
assert.equal(result.props.className, 'mui-row ');
});
it('renders properly with additional classNames', function() {
let result = getShallowRendererOutput(
<Row className="additional">
test
</Row>
);
assert.equal(result.props.className, 'mui-row additional');
});
it('renders properly with additional styles', function() {
let result = getShallowRendererOutput(
<Row style={{additonal: 'style'}}>
test
</Row>
);
assert.equal(result.props.style.additonal, 'style');
});
it('handles click events', function(done) {
function onClickFn() {
assert.equal(true, true);
done();
}
let instance = ReactUtils.renderIntoDocument(<Row onClick={onClickFn} />);
let wrapperEl = ReactDOM.findDOMNode(instance);
ReactUtils.Simulate.click(wrapperEl);
});
});