feat(content): add action story hints and merge GameContent
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user