-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcss.js
More file actions
49 lines (40 loc) · 1.42 KB
/
css.js
File metadata and controls
49 lines (40 loc) · 1.42 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
const assert = require('assert');
const Keyframes = require('../dist/keyframes').default;
describe('CSS', () => {
describe('#playCSS()', () => {
it('should return css for the animation rule', () => {
const css = Keyframes.playCSS({
name: 'ball-spin',
duration: '1s',
iterationCount: 1
});
assert.equal(css, "ball-spin 1s ease 0s 1 normal forwards");
});
});
describe('#defineCSS()', () => {
it('should return css defined keyframes', () => {
let css = Keyframes.defineCSS({
name: 'ball-spin',
from: {
transform: 'rotate(90deg)',
},
to: {
transform: 'rotate(450deg)',
},
});
assert.equal(css, "@keyframes ball-spin {from {transform:rotate(90deg);}to {transform:rotate(450deg);}}");
css = Keyframes.defineCSS([{
name: 'ball-spin',
from: {
transform: 'rotate(90deg)',
},
}, {
name: 'ball-spin2',
from: {
transform: 'rotate(70deg)',
},
}]);
assert.equal(css, "@keyframes ball-spin {from {transform:rotate(90deg);}}@keyframes ball-spin2 {from {transform:rotate(70deg);}}");
});
});
})