Skip to content

Commit 0f4c443

Browse files
committed
test(objectql): assert the wrapped rule's refusal on its envelope, field and message
Claude-Session: https://claude.ai/code/session_01Bvd69VPa6puiNzzPUroDBx Co-authored-by: Claude <noreply@anthropic.com>
1 parent f206248 commit 0f4c443

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/objectql/src/engine-predicate-relationship.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,9 @@ describe('#20007 — an optional lookup guarded in a traversing rule', () => {
846846
const err = await insert({ id: 'o_secret', line: 'line_secret' });
847847
expect(err?.code).toBe('VALIDATION_FAILED');
848848
expect(err.fields).toHaveLength(1);
849-
expect(err.fields[0]).toMatchObject({ code: 'rule_violation' });
849+
// The nested rule's own verdict: a violation, not an unevaluable fault.
850+
expect(err.fields[0]).toMatchObject({ field: '_record', code: 'rule_violation', message: SECRET_MESSAGE });
851+
expect(err.fields[0].constraint?.reason).toBeUndefined();
850852
expect(err.message).toBe(SECRET_MESSAGE);
851853
expect(d.storeFor('qa_order').has('o_secret')).toBe(false);
852854
// The UPDATE door: repointing an empty order at a secret line is refused,

0 commit comments

Comments
 (0)