]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.spec.ts
Import ceph 15.2.8
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / dashboard / health-pie / health-pie.component.spec.ts
index 25782502ca55b8d8fdd042a45ddda84c0d2bb29c..96331ff0a5beec2d2ea07fae6ee7a5549d18fab0 100644 (file)
@@ -55,6 +55,16 @@ describe('HealthPieComponent', () => {
     expect(component.chartConfig.dataset[0].data).toEqual(initialData);
   });
 
+  it('should set colors from css variables', () => {
+    const cssVar = '--my-color';
+    const cssVarColor = '#73c5c5';
+    component['getCssVar'] = (name: string) => (name === cssVar ? cssVarColor : '');
+    component.chartConfig.colors[0].backgroundColor = [cssVar, '#ffffff'];
+    fixture.detectChanges();
+
+    expect(component.chartConfig.colors[0].backgroundColor).toEqual([cssVarColor, '#ffffff']);
+  });
+
   describe('tooltip body', () => {
     const tooltipBody = ['text: 10000'];