1 import { CssHelper } from '~/app/shared/classes/css-helper';
2 import { HealthColorPipe } from '~/app/shared/pipes/health-color.pipe';
4 class CssHelperStub extends CssHelper {
5 propertyValue(propertyName: string) {
6 if (propertyName === 'health-color-healthy') {
9 if (propertyName === 'health-color-warning') {
12 if (propertyName === 'health-color-error') {
19 describe('HealthColorPipe', () => {
20 const pipe = new HealthColorPipe(new CssHelperStub());
22 it('create an instance', () => {
23 expect(pipe).toBeTruthy();
26 it('transforms "HEALTH_OK"', () => {
27 expect(pipe.transform('HEALTH_OK')).toEqual({
32 it('transforms "HEALTH_WARN"', () => {
33 expect(pipe.transform('HEALTH_WARN')).toEqual({
38 it('transforms "HEALTH_ERR"', () => {
39 expect(pipe.transform('HEALTH_ERR')).toEqual({
44 it('transforms others', () => {
45 expect(pipe.transform('abc')).toBe(null);