]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.spec.ts
0039cf90eb7730435ef0097094f0fa7c38eb38e2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / health-color.pipe.spec.ts
1 import styles from '~/styles.scss';
2 import { HealthColorPipe } from './health-color.pipe';
3
4 describe('HealthColorPipe', () => {
5 const pipe = new HealthColorPipe();
6
7 it('create an instance', () => {
8 expect(pipe).toBeTruthy();
9 });
10
11 it('transforms "HEALTH_OK"', () => {
12 expect(pipe.transform('HEALTH_OK')).toEqual({ color: styles.healthColorHealthy });
13 });
14
15 it('transforms "HEALTH_WARN"', () => {
16 expect(pipe.transform('HEALTH_WARN')).toEqual({ color: styles.healthColorWarning });
17 });
18
19 it('transforms "HEALTH_ERR"', () => {
20 expect(pipe.transform('HEALTH_ERR')).toEqual({ color: styles.healthColorError });
21 });
22
23 it('transforms others', () => {
24 expect(pipe.transform('abc')).toBe(null);
25 });
26 });