feat(content): add action story hints and merge GameContent

This commit is contained in:
ginnoir
2026-06-11 18:50:01 -05:00
parent a66a7db066
commit c7d1f3f51b
4 changed files with 41 additions and 3 deletions
+24
View File
@@ -124,3 +124,27 @@ describe('unlock conditions', () => {
expect(content.actionsById.forage.unlock).toBeUndefined();
});
});
describe('action narrative fields', () => {
it('accepts optional storyHint and storyTooltip', () => {
const actions = [
{
id: 'forage',
name: 'Forage',
durationMs: 3000,
yields: [{ resourceId: 'gold', amount: 1 }],
storyHint: 'Gather what the forest offers.',
storyTooltip: 'Your first step into the wild.',
},
];
const content = buildContent({ resources: validResources, actions });
expect(content.actionsById.forage.storyHint).toBe('Gather what the forest offers.');
expect(content.actionsById.forage.storyTooltip).toBe('Your first step into the wild.');
});
it('defaults storyHint and storyTooltip to undefined when omitted', () => {
const content = buildContent({ resources: validResources, actions: validActions });
expect(content.actionsById.forage.storyHint).toBeUndefined();
expect(content.actionsById.forage.storyTooltip).toBeUndefined();
});
});