Add some testing for Enums

This commit is contained in:
James Skemp 2020-09-07 00:57:31 -05:00
parent e45625c935
commit ef778c8198
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,25 @@
import { attackPreferenceToText, AttackType, desireToText, Desire, partyStateToText, PartyState } from "@/utilities/Enums";
describe('Verify all attack preferences/types', () => {
test('Attack type magic', () => {
expect(attackPreferenceToText(AttackType.Magic)).toEqual('Magic');
});
test('Attack type melee', () => {
expect(attackPreferenceToText(AttackType.Melee)).toEqual('Melee');
});
test('Attack type range', () => {
expect(attackPreferenceToText(AttackType.Range)).toEqual('Range');
});
});
describe('Verify all desires', () => {
test('Desire rest', () => {
expect(desireToText(Desire.Rest)).toEqual('Rest');
});
});
describe('Verify all party states', () => {
test('Party at town', () => {
expect(partyStateToText(PartyState.AtLocationTown)).toEqual('At Town');
});
});

View File

@ -1,5 +1,5 @@
/**
* Character attack preferences.
* Character attack types/preferences.
*/
export enum AttackType {
Melee,