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:
@@ -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: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user