Skip to content

Commit

Permalink
馃И Update current hp tests to expect trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
voidrender committed Nov 24, 2023
1 parent 7ce63e5 commit 796309d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions test/convert.currentHp.test.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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);
},
);

Expand All @@ -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);
});
});

0 comments on commit 796309d

Please sign in to comment.