import { describe, it, expect } from 'vitest';
import { NutritionTargetSchema } from './nutrition-target.schemas.js';

describe('NutritionTarget Schemas', () => {
  const validTarget = {
    dailyCalories: 2000,
    proteinG: 150,
    carbsG: 200,
    fatG: 70,
    isActive: true,
  };

  it('should validate a valid target', () => {
    const result = NutritionTargetSchema.safeParse(validTarget);
    expect(result.success).toBe(true);
  });

  it('should reject negative macros', () => {
    const invalidTarget = { ...validTarget, proteinG: -10 };
    const result = NutritionTargetSchema.safeParse(invalidTarget);
    expect(result.success).toBe(false);
  });

  it('should reject zero calories', () => {
    const invalidTarget = { ...validTarget, dailyCalories: 0 };
    const result = NutritionTargetSchema.safeParse(invalidTarget);
    expect(result.success).toBe(false);
  });
});
