forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-col.js
More file actions
66 lines (53 loc) · 1.65 KB
/
test-col.js
File metadata and controls
66 lines (53 loc) · 1.65 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
58
59
60
61
62
63
64
65
66
/**
* MUI React Col Component Tests
* @module test/react-tests/test-col
*/
import assert from 'assert';
import React from 'react';
import ReactUtils from 'react-dom/test-utils';
import Col from '../../src/react/col';
import { getShallowRendererOutput } from '../lib/react-helpers';
describe('react/grid', function() {
it('col renders properly', function() {
let result = getShallowRendererOutput(
<Col
xs={ 1 }
sm={ 2 }
md={ 3 }
lg={ 4 }
xs-offset={ 5 }
sm-offset={ 6 }
md-offset={ 7 }
lg-offset={ 8 }
>
My Content
</Col>
);
assert.equal(result.type, 'div');
let className = result.props.className;
assert.equal(/mui-col-xs-1/.test(className), true);
assert.equal(/mui-col-sm-2/.test(className), true);
assert.equal(/mui-col-md-3/.test(className), true);
assert.equal(/mui-col-lg-4/.test(className), true);
assert.equal(/mui-col-xs-offset-5/.test(className), true);
assert.equal(/mui-col-sm-offset-6/.test(className), true);
assert.equal(/mui-col-md-offset-7/.test(className), true);
assert.equal(/mui-col-lg-offset-8/.test(className), true);
});
it('renders properly with additional classNames', function() {
let result = getShallowRendererOutput(
<Col className="additional">
test
</Col>
);
assert.equal(result.props.className, ' additional');
});
it('renders properly with additional styles', function() {
let result = getShallowRendererOutput(
<Col style={{additonal: 'style'}}>
test
</Col>
);
assert.equal(result.props.style.additonal, 'style');
});
});