import { BookingStatus, ContainerType, ExportFormat } from '@/types/booking';

describe('BookingStatus enum', () => {
  it('has DRAFT value', () => {
    expect(BookingStatus.DRAFT).toBe('draft');
  });

  it('has CONFIRMED value', () => {
    expect(BookingStatus.CONFIRMED).toBe('confirmed');
  });

  it('has IN_PROGRESS value', () => {
    expect(BookingStatus.IN_PROGRESS).toBe('in_progress');
  });

  it('has COMPLETED value', () => {
    expect(BookingStatus.COMPLETED).toBe('completed');
  });

  it('has CANCELLED value', () => {
    expect(BookingStatus.CANCELLED).toBe('cancelled');
  });

  it('has exactly 5 statuses', () => {
    const values = Object.values(BookingStatus);
    expect(values).toHaveLength(5);
  });

  it('all values are lowercase strings', () => {
    Object.values(BookingStatus).forEach(v => {
      expect(v).toBe(v.toLowerCase());
    });
  });
});

describe('ContainerType enum', () => {
  it('has DRY_20 value', () => {
    expect(ContainerType.DRY_20).toBe('20ft');
  });

  it('has DRY_40 value', () => {
    expect(ContainerType.DRY_40).toBe('40ft');
  });

  it('has HIGH_CUBE_40 value', () => {
    expect(ContainerType.HIGH_CUBE_40).toBe('40ft HC');
  });

  it('has REEFER_20 value', () => {
    expect(ContainerType.REEFER_20).toBe('20ft Reefer');
  });

  it('has REEFER_40 value', () => {
    expect(ContainerType.REEFER_40).toBe('40ft Reefer');
  });

  it('has exactly 5 container types', () => {
    expect(Object.values(ContainerType)).toHaveLength(5);
  });

  it('all standard (non-reefer) values start with a size prefix', () => {
    expect(ContainerType.DRY_20).toMatch(/^\d+ft/);
    expect(ContainerType.DRY_40).toMatch(/^\d+ft/);
    expect(ContainerType.HIGH_CUBE_40).toMatch(/^\d+ft/);
  });
});

describe('ExportFormat enum', () => {
  it('has CSV value', () => {
    expect(ExportFormat.CSV).toBe('csv');
  });

  it('has EXCEL value', () => {
    expect(ExportFormat.EXCEL).toBe('excel');
  });

  it('has JSON value', () => {
    expect(ExportFormat.JSON).toBe('json');
  });

  it('has exactly 3 formats', () => {
    expect(Object.values(ExportFormat)).toHaveLength(3);
  });

  it('all values are lowercase', () => {
    Object.values(ExportFormat).forEach(v => {
      expect(v).toBe(v.toLowerCase());
    });
  });
});
