This repository was archived by the owner on Sep 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefaultColors.test.js
More file actions
57 lines (55 loc) · 1.49 KB
/
Copy pathdefaultColors.test.js
File metadata and controls
57 lines (55 loc) · 1.49 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
import test from 'ava';
import { defaultColors } from './defaultColors.js';
const tests = [
{
testName: 'Dark background color defined in theme',
theme: {
colors: {
background: '#333333'
}
},
expectedResult: {
tickText: {
secondary: '#9d9d9d',
primary: '#d9d9d9'
},
series: '#f1f1f1',
value: '#d9d9d9',
axis: '#f1f1f1',
gridline: '#707070',
fallbackBaseColor: '#f1f1f1'
}
},
{
testName: 'Custom chart element basecolor,background & blend ratios defined in theme',
theme: {
colors: {
background: '#FCB716',
chartContentBaseColor: '#ffffff',
bgBlendRatios: {
gridline: 0.5,
tickText: {
primary: 0,
secondary: 0
}
}
}
},
expectedResult: {
tickText: {
secondary: '#ffffff',
primary: '#ffffff'
},
series: '#ffffff',
value: '#fef2e4',
axis: '#ffffff',
gridline: '#fedeb5',
fallbackBaseColor: '#ffffff'
}
}
];
tests.forEach(function (testData) {
test(testData.testName, t => {
t.deepEqual(defaultColors(testData.theme), testData.expectedResult);
});
});