Skip to content

Commit 27a7eaa

Browse files
feat(test): Add test fot Color Helpers (#518)
1 parent 2613494 commit 27a7eaa

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { getFontColorByBackground } from 'utils';
2+
3+
describe('Color Helpers', () => {
4+
it('should return a black font color for the light yellow background', () => {
5+
const lightYellowColor = 'e5f496';
6+
expect(getFontColorByBackground(lightYellowColor)).toBe('#000000');
7+
});
8+
9+
it('should return a black font color for the light blue background', () => {
10+
const lightBlueColor = 'a9b3ff';
11+
expect(getFontColorByBackground(lightBlueColor)).toBe('#000000');
12+
});
13+
14+
it('should return a black font color for the light red background', () => {
15+
const lightRedColor = 'f4ad96';
16+
expect(getFontColorByBackground(lightRedColor)).toBe('#000000');
17+
});
18+
19+
it('should return a white font color for the dark green background', () => {
20+
const darkGreenColor = '288702';
21+
expect(getFontColorByBackground(darkGreenColor)).toBe('#ffffff');
22+
});
23+
24+
it('should return a white font color for the dark blue background', () => {
25+
const darkBlueColor = '0800fd';
26+
expect(getFontColorByBackground(darkBlueColor)).toBe('#ffffff');
27+
});
28+
29+
it('should return a white font color for the dark red background', () => {
30+
const darkRedColor = 'fd0000';
31+
expect(getFontColorByBackground(darkRedColor)).toBe('#ffffff');
32+
});
33+
});

0 commit comments

Comments
 (0)