-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.js
47 lines (41 loc) · 876 Bytes
/
test.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
import createStyleSheet from './';
import { equal } from 'assert';
describe('createStyleSheet', function () {
it('should create style node', function () {
let style = createStyleSheet({});
equal(style.nodeName, 'STYLE');
equal(style.getAttribute('type'), 'text/css');
});
it('should add px to non-zero numbers', function () {
let style = createStyleSheet({
input: {
padding: 10,
margin: 0
}
});
equal(style.innerHTML,
`input {
padding: 10px;
margin: 0;
}`
);
});
it('should add hyphens to camelCase properties', function () {
let style = createStyleSheet({
'.foo .bar': {
fontSize: 12
},
'a:hover': {
textDecoration: 'underline'
}
});
equal(style.innerHTML,
`.foo .bar {
font-size: 12px;
}
a:hover {
text-decoration: underline;
}`
);
});
});