forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
defaultTheme.test.js
57 lines (54 loc) · 1.41 KB
/
defaultTheme.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
import { expect } from 'chai';
import { getThemeWithVars } from './defaultTheme';
describe('defaultTheme', () => {
it('the output contains required fields', () => {
const result = getThemeWithVars();
Object.keys(result).forEach((field) => {
expect([
'breakpoints',
'components',
'colorSchemes',
'focus',
'fontSize',
'fontFamily',
'fontWeight',
'letterSpacing',
'lineHeight',
'palette',
'shadowRing',
'shadowChannel',
'getCssVar',
'spacing',
'radius',
'shadow',
'typography',
'variants',
'colorInversion',
'colorInversionConfig',
'vars',
'cssVarPrefix',
'getColorSchemeSelector',
'sxConfig',
]).to.includes(field);
});
});
it('the generated palette has correct colorChannel', () => {
const result = getThemeWithVars({
colorSchemes: {
light: {
palette: {
primary: {
mainChannel: '12 12 12',
},
},
},
},
});
expect(result.palette.primary.mainChannel).to.equal('12 12 12');
});
it('the generated palette always has mode and color scheme as `light`', () => {
const result = getThemeWithVars();
expect(result.palette.mode).to.equal('light');
expect(result.palette.colorScheme).to.equal('light');
});
});