import { describe, it, expect } from 'vitest';
import { CabinetEventType, CabinetEventSourceType } from './cabinet-event.enums.js';

describe(CabinetEventType.name, () => {
  it('has exactly 6 values', () => {
    expect(Object.values(CabinetEventType)).toHaveLength(6);
  });

  it.each([
    ['PURCHASED', 'purchased'],
    ['CONSUMED', 'consumed'],
    ['ADJUSTED', 'adjusted'],
    ['DISCARDED', 'discarded'],
    ['RESTORED', 'restored'],
    ['DELETED', 'deleted'],
  ])('%s = %s', (key, value) => {
    expect(CabinetEventType[key as keyof typeof CabinetEventType]).toBe(value);
  });
});

describe(CabinetEventSourceType.name, () => {
  it('has exactly 4 values', () => {
    expect(Object.values(CabinetEventSourceType)).toHaveLength(4);
  });

  it.each([
    ['MANUAL', 'manual'],
    ['ORGANIZER_FILL', 'organizer_fill'],
    ['ORGANIZER_UNDO', 'organizer_undo'],
    ['REFILL_LIST', 'refill_list'],
  ])('%s = %s', (key, value) => {
    expect(CabinetEventSourceType[key as keyof typeof CabinetEventSourceType]).toBe(value);
  });
});
