This repository was archived by the owner on Dec 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcross-fade.test.js
85 lines (79 loc) · 2.59 KB
/
cross-fade.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const expectAll = require('../utils/expect-all');
describe('CSS Type: <cross-fade>', () => {
// Test valid values
expectAll([
['cross-fade(33.33% url(red.png), url(yellow.png), url(blue.png) 33.33%)', {
function: 'cross-fade',
type: 'cross-fade',
value: {
finalImage: null,
parameters: [
{
amount: {type: 'percentage', value: 33.33},
url: {type: 'url', format: 'plain', value: 'red.png'}
},
{
amount: null,
url: {type: 'url', format: 'plain', value: 'yellow.png'}
},
{
amount: {type: 'percentage', value: 33.33},
url: {type: 'url', format: 'plain', value: 'blue.png'}
}
]
}
}],
['cross-fade(url("/b.png"), url("/a.png"))', {
function: 'cross-fade',
type: 'cross-fade',
value: {
parameters: [
{
amount: null,
url: {
type: 'url',
format: 'quotated',
value: {
type: 'string',
value: '/b.png'
}
}
}
],
finalImage: {
type: 'url',
format: 'quotated',
value: {
type: 'string',
value: '/a.png'
}
}
}
}],
['cross-fade(33.33% url(red.png), url(yellow.png), #f01f)', {
function: 'cross-fade',
type: 'cross-fade',
value: {
parameters: [
{
amount: {type: 'percentage', value: 33.33},
url: {type: 'url', format: 'plain', value: 'red.png'}
},
{
amount: null,
url: {type: 'url', format: 'plain', value: 'yellow.png'}
}
],
finalImage: {
type: 'color',
format: 'hexa',
value: 'f01f'
}
}
}]
]);
// Test invalid values
expectAll([
'cross-fade()'
]);
});