feat(combat): validate potions, persist telegraph state, and expose both on the combat DTO

Also updates the pre-existing exact-equality playerState assertion in
combat-equipment-integration.spec.ts, which broke from the new
potionsRemaining field but wasn't listed in the task brief's file scope.
This commit is contained in:
Bastian Wagner
2026-08-20 21:48:51 +02:00
parent 43d2085d2c
commit c7b9601eb4
3 changed files with 65 additions and 3 deletions

View File

@@ -369,7 +369,12 @@ describe('equipping Räuberklinge increases combat damage (spec §45, §60)', ()
// The finished combat's playerState snapshot (written once at startCombat)
// must not be retroactively rewritten by equipping after the fight ends.
expect(state.combats[0].playerState).toEqual({ attack: 6, weaponDamage: 8, armor: 0 });
expect(state.combats[0].playerState).toEqual({
attack: 6,
weaponDamage: 8,
armor: 0,
potionsRemaining: 2,
});
const reloaded = await combatService.getCombat(CHARACTER_ID, combat.id);
expect(reloaded.status).toBe(result.status);