Keep AI mechanic capabilities in sync
This commit is contained in:
@@ -263,6 +263,22 @@ describe('conditional mechanic authoring payload', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('rejects outcome fields that are absent from the canonical capability manifest', () => {
|
||||
const unsupported = draft();
|
||||
(unsupported.clauses[0].outcomes[0] as unknown as Record<string, unknown>).cadence =
|
||||
'continuous';
|
||||
const result = parseConditionalMechanicDraft(unsupported, {
|
||||
variantKeys: ['I', 'II'],
|
||||
allowedAttributeIds: new Set(['weapon-damage'])
|
||||
});
|
||||
expect(result.ok).toBe(false);
|
||||
if (!result.ok) {
|
||||
expect(result.errors).toContain(
|
||||
'Clause 1 outcome 1 contains unsupported field "cadence".'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('requires the exact configured variants and returns validation errors without throwing', () => {
|
||||
const invalid = draft();
|
||||
invalid.clauses[0].outcomes[0].variants = {
|
||||
|
||||
Reference in New Issue
Block a user