import { describe, it, expect } from 'vitest';
import { GaugeType, GAUGE_DEFS, STAT_DEFS, DEFAULT_TARGETS, targetRange } from '@domain/value-objects/GaugeType';

describe('GaugeType', () => {
  it('should have 6 gauge types', () => {
    const types: GaugeType[] = ['baffeur', 'caresseur', 'foudroyeur', 'abreuvoir', 'dragofesse', 'mangeoire'];
    expect(types).toHaveLength(6);
    types.forEach(t => expect(GAUGE_DEFS[t]).toBeDefined());
  });

  it('baffeur decreases serenite', () => {
    expect(GAUGE_DEFS.baffeur.stat).toBe('serenite');
    expect(GAUGE_DEFS.baffeur.dir).toBe(-1);
  });

  it('caresseur increases serenite', () => {
    expect(GAUGE_DEFS.caresseur.stat).toBe('serenite');
    expect(GAUGE_DEFS.caresseur.dir).toBe(1);
  });

  it('mangeoire is XP type', () => {
    expect(GAUGE_DEFS.mangeoire.isXp).toBe(true);
    expect(GAUGE_DEFS.mangeoire.stat).toBe('xp');
  });

  it('STAT_DEFS has 5 stats', () => {
    expect(Object.keys(STAT_DEFS)).toHaveLength(5);
  });

  it('targetRange for baffeur returns min:-5000 max:0', () => {
    expect(targetRange('baffeur')).toEqual({ min: -5000, max: 0 });
  });

  it('targetRange for caresseur returns min:0 max:5000', () => {
    expect(targetRange('caresseur')).toEqual({ min: 0, max: 5000 });
  });

  it('targetRange for mangeoire returns min:1 max:200', () => {
    expect(targetRange('mangeoire')).toEqual({ min: 1, max: 200 });
  });

  it('targetRange for foudroyeur returns min:0 max:20000', () => {
    expect(targetRange('foudroyeur')).toEqual({ min: 0, max: 20000 });
  });
});
