fix(content): guard optional durationMs and cover loop validation

This commit is contained in:
ginnoir
2026-06-11 20:17:50 -05:00
parent c48e53cc7b
commit c1b38e36aa
4 changed files with 20 additions and 2 deletions
+17
View File
@@ -208,4 +208,21 @@ describe('action kind schema', () => {
});
expect(content.actionsById.rest.kind).toBe('loop');
});
it('rejects loop action without durationMs', () => {
expect(() =>
buildContent({
resources: [{ id: 'supplies', name: 'Supplies' }],
actions: [
{
id: 'broken_loop',
name: 'Broken loop',
kind: 'loop',
group: { id: 'camp', label: 'Camp' },
yields: [],
},
],
}),
).toThrow(/durationMs/);
});
});