test(01-02): RED — skill-increase-cap spec
Task 2 RED phase: 9 failing tests covering PF2e skill-increase cap rule (VALIDATION.md rows 1-W1-06 to 1-W1-11). Implementation follows in next commit (GREEN). Verified failure: module './skill-increase-cap' not found.
This commit is contained in:
42
server/src/modules/leveling/lib/skill-increase-cap.spec.ts
Normal file
42
server/src/modules/leveling/lib/skill-increase-cap.spec.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
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]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user