import { describe, it, expect } from 'vitest';
import { ProductCategory, ServingUnit, ProductSource } from './product.enums.js';

describe(ProductCategory.name, () => {
  it('has expected values', () => {
    expect(ProductCategory.DAIRY).toBe('dairy');
    expect(ProductCategory.MEAT).toBe('meat');
    expect(ProductCategory.VEGETABLES).toBe('vegetables');
    expect(ProductCategory.OTHER).toBe('other');
  });

  it('has 20 categories', () => {
    expect(Object.values(ProductCategory)).toHaveLength(20);
  });
});

describe(ServingUnit.name, () => {
  it('has metric and discrete units only', () => {
    expect(ServingUnit.GRAMS).toBe('g');
    expect(ServingUnit.MILLILITERS).toBe('ml');
    expect(ServingUnit.PIECES).toBe('piece');
    expect(ServingUnit.SLICES).toBe('slice');
  });

  it('has exactly 4 units (no imperial)', () => {
    expect(Object.values(ServingUnit)).toHaveLength(4);
    expect(Object.values(ServingUnit)).not.toContain('oz');
    expect(Object.values(ServingUnit)).not.toContain('cup');
    expect(Object.values(ServingUnit)).not.toContain('tbsp');
    expect(Object.values(ServingUnit)).not.toContain('tsp');
  });
});

describe(ProductSource.name, () => {
  it('has expected values', () => {
    expect(ProductSource.MANUAL).toBe('manual');
    expect(ProductSource.BARCODE_LOOKUP).toBe('barcode_lookup');
    expect(ProductSource.LLM).toBe('llm');
    expect(ProductSource.IMPORT).toBe('import');
  });
});
