浏览代码

Added one more test case for color resolving helper

Dominik Prokop 6 年之前
父节点
当前提交
a5d158c014
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      packages/grafana-ui/src/utils/namedColorsPalette.test.ts

+ 4 - 0
packages/grafana-ui/src/utils/namedColorsPalette.test.ts

@@ -44,6 +44,10 @@ describe('colors', () => {
   });
 
   describe('getColorFromHexRgbOrName', () => {
+    it('returns black for unknown color', () => {
+      expect(getColorFromHexRgbOrName('aruba-sunshine')).toBe("#000000");
+    });
+
     it('returns dark hex variant for known color if theme not specified', () => {
       expect(getColorFromHexRgbOrName(SemiDarkBlue.name)).toBe(SemiDarkBlue.variants.dark);
     });