-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathutils.test.tsx
More file actions
125 lines (115 loc) · 3.15 KB
/
Copy pathutils.test.tsx
File metadata and controls
125 lines (115 loc) · 3.15 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import { getTheme } from '../../../core/theming';
import { tokens } from '../../../theme/tokens';
import {
getAndroidSelectionControlColor,
getSelectionControlIOSColor,
} from '../../Checkbox/utils';
const { stateOpacity } = tokens.md.ref;
describe('getAndroidSelectionControlColor - checkbox color', () => {
it('should return correct disabled color, for theme version 3', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(),
disabled: true,
checked: false,
})
).toMatchObject({
selectionControlColor: getTheme().colors.onSurface,
selectionControlOpacity: stateOpacity.disabled,
});
});
it('should return custom color, checked', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(),
checked: true,
customColor: 'purple',
})
).toMatchObject({
selectionControlColor: 'purple',
});
});
it('should return theme color, for theme version 3, checked', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(),
checked: true,
})
).toMatchObject({
selectionControlColor: getTheme().colors.primary,
});
});
it('should return custom color, unchecked', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(),
checked: false,
customUncheckedColor: 'purple',
})
).toMatchObject({
selectionControlColor: 'purple',
});
});
it('should return theme color, for theme version 3, unchecked', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(),
checked: false,
})
).toMatchObject({
selectionControlColor: getTheme().colors.onSurfaceVariant,
});
});
it('should return theme color, unchecked, dark mode', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(true),
checked: false,
})
).toMatchObject({
selectionControlColor: getTheme(true).colors.onSurfaceVariant,
});
});
it('should return theme color, unchecked, light mode', () => {
expect(
getAndroidSelectionControlColor({
theme: getTheme(false),
checked: false,
})
).toMatchObject({
selectionControlColor: getTheme(false).colors.onSurfaceVariant,
});
});
});
describe('getSelectionControlIOSColor - checked color', () => {
it('should return correct disabled color, for theme version 3', () => {
expect(
getSelectionControlIOSColor({
theme: getTheme(),
disabled: true,
})
).toMatchObject({
checkedColor: getTheme().colors.primary,
checkedColorOpacity: stateOpacity.disabled,
});
});
it('should return custom color, checked', () => {
expect(
getSelectionControlIOSColor({
theme: getTheme(),
customColor: 'purple',
})
).toMatchObject({
checkedColor: 'purple',
});
});
it('should return theme color, for theme version 3, checked', () => {
expect(
getSelectionControlIOSColor({
theme: getTheme(),
})
).toMatchObject({
checkedColor: getTheme().colors.primary,
});
});
});