Skip to content

Commit 5bd3515

Browse files
committed
test(plugin-approvals): main's two new lean fixture engines hold a Default Organization
Claude-Session: https://claude.ai/code/session_018EszgtA3V2KXBX5tf59Hi4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 97f5296 commit 5bd3515

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎packages/plugins/plugin-approvals/src/later-step-original-submitter.integration.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import type { EngineQueryOptions } from '@objectstack/spec/data';
5151
import { ApprovalService } from './approval-service.js';
5252
import { ApprovalsServicePlugin } from './approvals-plugin.js';
5353
import { registerApprovalNode } from './approval-node.js';
54+
import { installDefaultOrganization } from './default-organization.testkit.js';
5455

5556
const SYSTEM = { isSystem: true, positions: [], permissions: [] } as any;
5657
const asUser = (userId: string) => ({ userId, positions: [], permissions: [] }) as any;
@@ -250,6 +251,9 @@ describe('every step of an approval run names the run\'s original submitter (#24
250251
engine.registry.registerObject(def as any, 'approvals-test', 'approvals-test');
251252
}
252253
await engine.syncSchemas();
254+
// A real `single` install's Default Organization: the system writes below
255+
// derive it (ADR-0131 D9), as a fresh NOT NULL tenant column requires (D1).
256+
await installDefaultOrganization(engine);
253257
for (const u of USERS) await engine.insert('sys_user', u, { context: SYSTEM } as any);
254258

255259
automation = new AutomationEngine(silent);

‎packages/plugins/plugin-approvals/src/remind-notified-per-person.integration.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import type { EngineQueryOptions } from '@objectstack/spec/data';
4646
import { ApprovalService } from './approval-service.js';
4747
import { ApprovalsServicePlugin } from './approvals-plugin.js';
4848
import { registerApprovalNode } from './approval-node.js';
49+
import { installDefaultOrganization } from './default-organization.testkit.js';
4950

5051
const SYSTEM = { isSystem: true, positions: [], permissions: [] } as any;
5152
const asUser = (userId: string) => ({ userId, positions: [], permissions: [] }) as any;
@@ -180,6 +181,9 @@ describe('a reminder counts the reminders it hands over, one per distinct approv
180181
engine.registry.registerObject(def as any, 'approvals-test', 'approvals-test');
181182
}
182183
await engine.syncSchemas();
184+
// A real `single` install's Default Organization: the system writes below
185+
// derive it (ADR-0131 D9), as a fresh NOT NULL tenant column requires (D1).
186+
await installDefaultOrganization(engine);
183187
for (const u of USERS) await engine.insert('sys_user', u, { context: SYSTEM } as any);
184188

185189
automation = new AutomationEngine(silent);

0 commit comments

Comments
 (0)