Skip to content

Commit d985d45

Browse files
committed
test(dogfood): pin the generic data door's refusal on sys_record_share by status and code
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
1 parent 76b6189 commit d985d45

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/qa/dogfood/test/direct-share-grant-is-manual.dogfood.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,16 @@ describe('[ADR-0111 D7] a share granted directly by a non-system caller is alway
122122
expect(await sharesOn(recordId)).toHaveLength(1);
123123
});
124124

125-
it('the generic data door does not write a share row for the caller', async () => {
125+
it('the generic data door on sys_record_share refuses the caller\'s create and writes no share row', async () => {
126126
const recordId = await newNote('dsm generic door');
127127
const res = await stack.apiAs(ownerToken, 'POST', '/data/sys_record_share', {
128128
object_name: OBJECT, record_id: recordId, recipient_type: 'user', recipient_id: recipientId,
129129
access_level: 'read', source: 'rule', source_id: 'srule_dsm',
130130
});
131-
expect(res.status, await res.clone().text()).toBeGreaterThanOrEqual(400);
132-
expect(res.status).toBeLessThan(500);
131+
const text = await res.text();
132+
// `enable.apiMethods` on `sys_record_share` grants no create (ADR-0103).
133+
expect(res.status, text).toBe(405);
134+
expect(text).toContain('OBJECT_API_METHOD_NOT_ALLOWED');
133135
expect(await sharesOn(recordId)).toHaveLength(0);
134136
});
135137
});

0 commit comments

Comments
 (0)