import { getColorForTask } from './get-color-for-task.helper';

describe('getColorForTask', () => {
  it('should return green if status is Completed', () => {
    expect(
      getColorForTask({
        status: 'Completed',
      })
    ).toBe('green');
  });

  it('should return yellow if status is InProgess', () => {
    expect(
      getColorForTask({
        status: 'InProgress',
      })
    ).toBe('yellow');
  });

  it('should return lightgrey if status is Open', () => {
    expect(
      getColorForTask({
        status: 'Open',
      })
    ).toBe('lightgrey');
  });

  it('should return red if status is Overdue', () => {
    expect(
      getColorForTask({
        status: 'Overdue',
      })
    ).toBe('red');
  });

  it('should return undefined if status is empty', () => {
    expect(
      getColorForTask({
        status: '' as any,
      })
    ).toBeUndefined();
  });

  it('should return undefined if task is undefined', () => {
    expect(getColorForTask(undefined)).toBeUndefined();
  });
});
