- Unit : domain (GaugeCalculator, Enclos, Dragodinde, XpTable, Race, Tier...) - Unit : application (commands, queries, CommandBus) - Fonctionnel : breeding-workflow, enclos-management, timer-workflow - Régression : gauge-tier, gauge-recharge, xp-timer, level-target, breeding - E2E Playwright + Electron : navigation, timer, recharge jauge, accouplement, persistance des données Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
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
|
|
});
|
|
});
|