Updated unit test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-06-18 16:14:30 +02:00
parent a50eebfed4
commit a4f20daf17
1 changed files with 4 additions and 4 deletions

View File

@ -76,25 +76,25 @@ describe('Client', () => {
describe('stateColor()', () => {
it('should return "success" when the alertLevelCode property is "OK"', () => {
const result = controller.stateColor({alertLevelCode: 'OK'});
const result = controller.stateColor({ticketState: {code: 'OK'}});
expect(result).toEqual('success');
});
it('should return "notice" when the alertLevelCode property is "FREE"', () => {
const result = controller.stateColor({alertLevelCode: 'FREE'});
const result = controller.stateColor({ticketState: {code: 'FREE'}});
expect(result).toEqual('notice');
});
it('should return "warning" when the alertLevel property is "1', () => {
const result = controller.stateColor({alertLevel: 1});
const result = controller.stateColor({ticketState: {code: 'PACKING', alertLevel: 1}});
expect(result).toEqual('warning');
});
it('should return "alert" when the alertLevel property is "0"', () => {
const result = controller.stateColor({alertLevel: 0});
const result = controller.stateColor({ticketState: {code: 'FIXING', alertLevel: 0}});
expect(result).toEqual('alert');
});