Skip to content

Commit 9ecf41b

Browse files
committed
test(plugin-approvals): sweep the token object beside others, scoped
Claude-Session: https://claude.ai/code/session_013j5gkUCpqQiti4GgPqqmnt Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7a21137 commit 9ecf41b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/plugins/plugin-approvals/src/sys-approval-token-generic-door.integration.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,16 @@ describe('the cross-object search, on a real engine with token rows present', ()
196196
expect(rig.links).toHaveLength(2);
197197
});
198198

199-
it('serves no token row to any caller — by the bound slot, by the request, scoped to the object or not', async () => {
199+
it('serves no token row to any caller — by the bound slot, by the request, alone or swept with other objects', async () => {
200200
const rig = await boot();
201201
for (const ctx of [asUser(MEMBER), ADMIN]) {
202202
for (const q of [APPROVER, rig.requestId]) {
203203
const scoped = await rig.protocol.searchAll({ q, objects: [TOKEN], context: ctx });
204204
expect(scoped.hits, `${ctx.userId} ${q} scoped`).toEqual([]);
205-
const all = await rig.protocol.searchAll({ q, context: ctx });
206-
expect(all.hits.filter((h: any) => h.object === TOKEN), `${ctx.userId} ${q}`).toEqual([]);
205+
// Swept beside other objects. (A sweep naming no object also searches
206+
// the page store, which this engine-only rig does not provision.)
207+
const swept = await rig.protocol.searchAll({ q, objects: [OBJECT, 'sys_approval_request', TOKEN], context: ctx });
208+
expect(swept.hits.filter((h: any) => h.object === TOKEN), `${ctx.userId} ${q} swept`).toEqual([]);
207209
}
208210
}
209211
});

0 commit comments

Comments
 (0)