import { describe, it, expect } from 'vitest';
import { DosageFrequency, TimeOfDay, OrganizerFillStatus } from './regimen.enums.js';

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

  it.each([
    ['DAILY', 'daily'],
    ['TWICE_DAILY', 'twice_daily'],
    ['THREE_TIMES_DAILY', 'three_times_daily'],
    ['WEEKLY', 'weekly'],
    ['EVERY_OTHER_DAY', 'every_other_day'],
    ['AS_NEEDED', 'as_needed'],
    ['CUSTOM', 'custom'],
  ])('%s = %s', (key, value) => {
    expect(DosageFrequency[key as keyof typeof DosageFrequency]).toBe(value);
  });
});

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

  it.each([
    ['MORNING', 'morning'],
    ['AFTERNOON', 'afternoon'],
    ['EVENING', 'evening'],
    ['BEDTIME', 'bedtime'],
  ])('%s = %s', (key, value) => {
    expect(TimeOfDay[key as keyof typeof TimeOfDay]).toBe(value);
  });
});

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

  it.each([
    ['COMPLETED', 'completed'],
    ['PARTIAL', 'partial'],
    ['REVERSED', 'reversed'],
  ])('%s = %s', (key, value) => {
    expect(OrganizerFillStatus[key as keyof typeof OrganizerFillStatus]).toBe(value);
  });
});
