1 import styles from '~/styles.scss';
2 import { HealthColorPipe } from './health-color.pipe';
4 describe('HealthColorPipe', () => {
5 const pipe = new HealthColorPipe();
7 it('create an instance', () => {
8 expect(pipe).toBeTruthy();
11 it('transforms "HEALTH_OK"', () => {
12 expect(pipe.transform('HEALTH_OK')).toEqual({ color: styles.healthColorHealthy });
15 it('transforms "HEALTH_WARN"', () => {
16 expect(pipe.transform('HEALTH_WARN')).toEqual({ color: styles.healthColorWarning });
19 it('transforms "HEALTH_ERR"', () => {
20 expect(pipe.transform('HEALTH_ERR')).toEqual({ color: styles.healthColorError });
23 it('transforms others', () => {
24 expect(pipe.transform('abc')).toBe(null);