Skip to content

Commit f6f28b0

Browse files
committed
test(dogfood): the inbound-mail pool suite reads its fixture sets from the security catalog
Since D (#22900) no boot writes a sys_permission_set row for a set declared through defaultPermissionSets (ADR-0131 D3), so this suite's grant helper, which asserted the seeded row, failed on main's full battery. It now asserts the set the security catalog serves by name (catalogPermissionSet, the fixture helper T2 added); the grant row it writes is unchanged. Claude-Session: https://claude.ai/code/session_01ADzJtzYTLUfgrRZHxkagkX Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 121847a commit f6f28b0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/qa/dogfood/test/mail-message-pool-read-gate.dogfood.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { ADMIN_FULL_ACCESS_CAPABILITIES } from '@objectstack/spec';
3838
import { PermissionSetSchema, PLATFORM_CAPABILITIES } from '@objectstack/spec/security';
3939
import { bootShowcase } from './showcase-boot.js';
4040
import { assertArmed, armedWhen } from './armed.js';
41+
import { catalogPermissionSet } from './catalog-permission-set.js';
4142

4243
/** The capability under test, as `PLATFORM_CAPABILITIES` declares it. */
4344
const CAP = 'manage_mailboxes';
@@ -107,8 +108,10 @@ describe('[#22870] the inbound-mail pool is restricted to mailbox owners and adm
107108
const userIdOf = async (email: string) => String((await atRest('sys_user', { email }))[0]?.id ?? '');
108109
uid.admin = await userIdOf('admin@objectos.ai');
109110
const grant = async (who: Who, setName: string) => {
110-
const [set] = await atRest('sys_permission_set', { name: setName });
111-
expect(set?.id, `fixture permission set ${setName} seeded`).toBeTruthy();
111+
// [ADR-0131 D3] A set is served by name from the security catalog; no
112+
// boot writes a `sys_permission_set` row for it.
113+
const set = await catalogPermissionSet(ql, setName);
114+
expect(set, `fixture permission set ${setName} served by the security catalog`).toBeTruthy();
112115
await ql.insert('sys_user_permission_set', { user_id: uid[who], permission_set: set.name }, { context: { ...SYS } });
113116
};
114117
for (const who of ['reader', 'owner', 'holder', 'outsider'] as const) {

0 commit comments

Comments
 (0)