Skip to content

Commit c51cd3d

Browse files
committed
test(objectql): pin the scoped repository door onto the where shape refusal
Claude-Session: https://claude.ai/code/session_01Bvd69VPa6puiNzzPUroDBx Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6485915 commit c51cd3d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/objectql/src/engine-where-shape-refusal.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,19 @@ describe('an engine `where` that is not a filter is refused at the seam, before
227227
}
228228
}
229229

230+
// ── a door that forwards to the seam: the scoped repository ───────────────
231+
232+
it('createContext().object(): find and delete(multi) forward to the seam and are refused the same way', async () => {
233+
const repo = engine.createContext({ isSystem: true }).object('deal');
234+
235+
const read = await refusalOf(() => repo.find({ where: 'amount > 15' }));
236+
const write = await refusalOf(() => repo.delete({ where: 42, multi: true }));
237+
238+
expect([read.code, read.status, write.code, write.status]).toEqual(['INVALID_FILTER', 400, 'INVALID_FILTER', 400]);
239+
expect(calls).toEqual([]);
240+
expect(rows.size).toBe(3);
241+
});
242+
230243
// ── the accept set's edges: nothing that answered correctly is refused ────
231244

232245
it.each<[string, () => unknown, number]>([

0 commit comments

Comments
 (0)