fix(content): guard optional durationMs and cover loop validation
This commit is contained in:
@@ -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/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user