import { canIncreaseSkill, SKILL_INCREASE_LEVELS } from './skill-increase-cap';

describe('canIncreaseSkill', () => {
  it('rejects TRAINED → EXPERT at level 2 (T→E requires L3+)', () => {
    expect(canIncreaseSkill('TRAINED', 2)).toBe(false);
  });

  it('allows TRAINED → EXPERT at level 3', () => {
    expect(canIncreaseSkill('TRAINED', 3)).toBe(true);
  });

  it('rejects EXPERT → MASTER at level 6 (E→M requires L7+)', () => {
    expect(canIncreaseSkill('EXPERT', 6)).toBe(false);
  });

  it('allows EXPERT → MASTER at level 7', () => {
    expect(canIncreaseSkill('EXPERT', 7)).toBe(true);
  });

  it('rejects MASTER → LEGENDARY at level 14 (M→L requires L15+)', () => {
    expect(canIncreaseSkill('MASTER', 14)).toBe(false);
  });

  it('allows MASTER → LEGENDARY at level 15', () => {
    expect(canIncreaseSkill('MASTER', 15)).toBe(true);
  });

  it('rejects LEGENDARY at any level (already maxed)', () => {
    expect(canIncreaseSkill('LEGENDARY', 20)).toBe(false);
  });

  it('allows UNTRAINED → TRAINED at any level >= 1 (no cap on first training)', () => {
    expect(canIncreaseSkill('UNTRAINED', 1)).toBe(true);
    expect(canIncreaseSkill('UNTRAINED', 20)).toBe(true);
  });
});

describe('SKILL_INCREASE_LEVELS', () => {
  it('exposes the PF2e skill-increase level list', () => {
    expect(SKILL_INCREASE_LEVELS).toEqual([3, 5, 7, 9, 11, 13, 15, 17, 19]);
  });
});
