import { describe, it, expect } from 'vitest';
import { BreedingService } from '@domain/services/BreedingService';
import { BREEDING_RECIPES } from '@domain/value-objects/Race';
import { createAccouplement } from '@domain/entities/Accouplement';

describe('Regression: Breeding deduction', () => {
  const svc = new BreedingService();

  it('bidirectional parent order produces same baby', () => {
    // For ALL recipes, both orderings must work
    for (const [baby, [pA, pB]] of Object.entries(BREEDING_RECIPES)) {
      const resultAB = svc.deduceBaby(pA, pB);
      const resultBA = svc.deduceBaby(pB, pA);
      expect(resultAB).toBe(baby);
      expect(resultBA).toBe(baby);
    }
  });

  it('babies from breeding are gender-neutral', () => {
    // Bug v1.1.4: babies were assigned male/female arbitrarily instead of neutral
    // Verify domain doesn't assign gender in Accouplement
    const acc = createAccouplement('Rousse', 'Dorée', 'Dorée et Rousse', 2, 5, 3);
    // Accouplement doesn't track baby gender — babies are neutral by design
    expect(acc.baby).toBe('Dorée et Rousse');
    // No gender field on Accouplement — that's correct
  });
});
