|
@@ -44,8 +44,8 @@ describe('colors', () => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
describe('getColorFromHexRgbOrName', () => {
|
|
describe('getColorFromHexRgbOrName', () => {
|
|
|
- it('returns undefined for unknown color', () => {
|
|
|
|
|
- expect(() => getColorFromHexRgbOrName('aruba-sunshine')).toThrow();
|
|
|
|
|
|
|
+ it('returns black for unknown color', () => {
|
|
|
|
|
+ expect(getColorFromHexRgbOrName('aruba-sunshine')).toBe("#000000");
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('returns dark hex variant for known color if theme not specified', () => {
|
|
it('returns dark hex variant for known color if theme not specified', () => {
|
|
@@ -64,5 +64,9 @@ describe('colors', () => {
|
|
|
expect(getColorFromHexRgbOrName('rgb(0,0,0)')).toBe('rgb(0,0,0)');
|
|
expect(getColorFromHexRgbOrName('rgb(0,0,0)')).toBe('rgb(0,0,0)');
|
|
|
expect(getColorFromHexRgbOrName('rgba(0,0,0,1)')).toBe('rgba(0,0,0,1)');
|
|
expect(getColorFromHexRgbOrName('rgba(0,0,0,1)')).toBe('rgba(0,0,0,1)');
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ it('returns hex for named color that is not a part of named colors palette', () => {
|
|
|
|
|
+ expect(getColorFromHexRgbOrName('lime')).toBe('#00ff00');
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|