refactor: add more effect
This commit is contained in:
@@ -26,6 +26,7 @@ describe('heroItemFighter1.csv import', () => {
|
||||
expect(item).toHaveProperty('costCount');
|
||||
expect(item).toHaveProperty('targetType');
|
||||
expect(item).toHaveProperty('desc');
|
||||
expect(item).toHaveProperty('effects');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,6 +76,17 @@ describe('heroItemFighter1.csv import', () => {
|
||||
expect(typeCounts['consumable']).toBe(6);
|
||||
expect(typeCounts['tool']).toBe(6);
|
||||
});
|
||||
|
||||
it('should have effects with target, effect ref, and value', () => {
|
||||
for (const item of heroItemFighter1Data) {
|
||||
expect(Array.isArray(item.effects)).toBe(true);
|
||||
for (const [target, effect, value] of item.effects) {
|
||||
expect(target === 'self' || target === 'target' || target === 'all' || target === 'random').toBe(true);
|
||||
expect(typeof effect === 'string' || typeof effect === 'object').toBe(true);
|
||||
expect(typeof value).toBe('number');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('encounterDesert.csv import', () => {
|
||||
@@ -135,7 +147,7 @@ describe('effectDesert.csv import', () => {
|
||||
});
|
||||
|
||||
it('should have expected number of effects', () => {
|
||||
expect(effectDesertData.length).toBe(19);
|
||||
expect(effectDesertData.length).toBe(34);
|
||||
});
|
||||
|
||||
it('should have correct fields for each effect', () => {
|
||||
@@ -148,7 +160,7 @@ describe('effectDesert.csv import', () => {
|
||||
});
|
||||
|
||||
it('should have valid timing values', () => {
|
||||
const validTimings = ['instant', 'temporary', 'lingering', 'permanent', 'posture', 'card', 'cardDraw', 'cardHand'];
|
||||
const validTimings = ['instant', 'temporary', 'lingering', 'permanent', 'posture', 'card', 'cardDraw', 'cardHand', 'item', 'itemUntilPlayed'];
|
||||
for (const effect of effectDesertData) {
|
||||
expect(validTimings).toContain(effect.timing);
|
||||
}
|
||||
@@ -160,6 +172,9 @@ describe('effectDesert.csv import', () => {
|
||||
expect(ids).toContain('defend');
|
||||
expect(ids).toContain('spike');
|
||||
expect(ids).toContain('venom');
|
||||
expect(ids).toContain('draw');
|
||||
expect(ids).toContain('removeWound');
|
||||
expect(ids).toContain('gainEnergy');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user