feat(content): add M1 stub resource and action pack

This commit is contained in:
ginnoir
2026-06-11 18:20:26 -05:00
parent 964e9260fa
commit 7625e081fd
2 changed files with 33 additions and 14 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest';
import { createGameState, enqueueAction, tickGame } from '../../engine/game';
import { content } from '../index';
describe('M1 stub content pack', () => {
it('defines two resources and four to five actions with costs and unlocks', () => {
expect(content.resources).toHaveLength(2);
expect(content.actions.length).toBeGreaterThanOrEqual(4);
expect(content.actions.length).toBeLessThanOrEqual(5);
const withCosts = content.actions.filter((a) => a.costs.length > 0);
const withUnlocks = content.actions.filter((a) => a.unlock !== undefined);
expect(withCosts.length).toBeGreaterThanOrEqual(2);
expect(withUnlocks.length).toBeGreaterThanOrEqual(1);
});
it('can simulate a costed action without throwing', () => {
const state = createGameState(content);
const trade = content.actions.find((a) => a.costs.length > 0);
expect(trade).toBeDefined();
enqueueAction(state, content, trade!.id);
tickGame(state, content, trade!.durationMs);
expect(state.activeActionId).toBeNull();
});
});