test(api): make equip() re-anchor test exercise the overflow scenario

The re-anchor test in equipment.service.spec.ts anchored hpRegenSince
at null, which meant currentHp already equaled the old maxHp and
nothing in equip() could change it whether settle() ran correctly, was
a no-op, or read the wrong (post-change) maxHp. Anchor currentHp at 90
with hpRegenSince 600s before the harness's fixed clock so settle()
must actually cap accumulated regen at the OLD maxHp for the assertion
to hold, catching both failure modes the original fixture missed.
This commit is contained in:
Bastian Wagner
2026-08-21 15:46:28 +02:00
parent dd204db4b3
commit 52178ba79d

View File

@@ -431,7 +431,12 @@ describe('EquipmentService', () => {
weaponDamage: 0, weaponDamage: 0,
}); });
const { state, service } = createHarness({ const { state, service } = createHarness({
characters: [character({ currentHp: 100, hpRegenSince: null })], characters: [
character({
currentHp: 90,
hpRegenSince: new Date('2026-08-18T08:50:00.000Z'),
}),
],
itemDefinitions: [bonusHpHelm], itemDefinitions: [bonusHpHelm],
characterItems: [ characterItems: [
{ {