From 796309de6ff328ea174883e8713cc957c4742d37 Mon Sep 17 00:00:00 2001 From: Isaac Overacker Date: Thu, 23 Nov 2023 16:01:30 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Update=20current=20hp=20tests=20?= =?UTF-8?q?to=20expect=20trackers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/convert.currentHp.test.ts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/convert.currentHp.test.ts b/test/convert.currentHp.test.ts index 7626942..75050b8 100644 --- a/test/convert.currentHp.test.ts +++ b/test/convert.currentHp.test.ts @@ -1,5 +1,6 @@ import { beforeEach, describe, expect, test } from '@jest/globals'; import { convertCharacter } from '../src'; +import { AlchemyTrackerCategory } from '../src/alchemy.d'; import { DdbCharacter, DdbStatType } from '../src/ddb'; import { DeepPartial } from './test-helpers'; @@ -34,10 +35,14 @@ describe('Convert DDB current HP to Alchemy current HP', () => { ddbChar.overrideHitPoints = overrideHitPoints; const converted = convertCharacter(ddbChar as DdbCharacter, { - currentHp: true, + trackers: true, }); - expect(converted.currentHp).toEqual(overrideHitPoints); + expect( + converted.trackers?.find( + (t) => t.category === AlchemyTrackerCategory.Health, + )?.value, + ).toEqual(overrideHitPoints); }); test.each` @@ -74,10 +79,14 @@ describe('Convert DDB current HP to Alchemy current HP', () => { con; const converted = convertCharacter(ddbChar as DdbCharacter, { - currentHp: true, + trackers: true, }); - expect(converted.currentHp).toEqual(expected); + expect( + converted.trackers?.find( + (t) => t.category === AlchemyTrackerCategory.Health, + )?.value, + ).toEqual(expected); }, ); @@ -91,9 +100,13 @@ describe('Convert DDB current HP to Alchemy current HP', () => { ddbChar.classes.push({ level: 1 }); const converted = convertCharacter(ddbChar as DdbCharacter, { - currentHp: true, + trackers: true, }); - expect(converted.currentHp).toEqual(2); + expect( + converted.trackers?.find( + (t) => t.category === AlchemyTrackerCategory.Health, + )?.value, + ).toEqual(2); }); });