Skip to content

Commit fd12db8

Browse files
committed
test(plugin-sharing): type the recompute pins' logger as the service takes it
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXqXpuVf14Mqo1pznh
1 parent 38e1282 commit fd12db8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/plugins/plugin-sharing/src/queue-recipient.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ describe('[ADR-0142 D7] the queue recipient', () => {
158158
*/
159159
describe('[ADR-0142 D7] a failed queue-member read keeps the queue-recipient rule\'s grants (#29604)', () => {
160160
let engine: ReturnType<typeof makeEngine>;
161-
let warn: ReturnType<typeof vi.fn>;
161+
type Warn = (msg: string, meta?: Record<string, any>) => void;
162+
let warn: ReturnType<typeof vi.fn<Warn>>;
162163
let rules: SharingRuleService;
163164
const REFUSAL = /\[queue\] queue 'billing' in organization 'org_a' does not answer its members, because a read behind it failed/;
164165
const granteesOf = (recordId: string): string[] =>
@@ -183,14 +184,14 @@ describe('[ADR-0142 D7] a failed queue-member read keeps the queue-recipient rul
183184
{ id: 'qm_2', queue: 'billing', recipient_type: 'team', recipient_id: 't_night', organization_id: 'org_a' },
184185
]);
185186
engine.seed('sys_team_member', [{ id: 'tm_1', team_id: 't_night', user_id: 'u_d' }]);
186-
warn = vi.fn();
187-
const logger = { warn, info: vi.fn(), debug: vi.fn(), error: vi.fn() };
187+
warn = vi.fn<Warn>();
188+
const logger = { warn, info: vi.fn<Warn>() };
188189
const queues = new OwnershipQueueService({ engine: () => engine as any, logger });
189190
rules = new SharingRuleService({
190191
engine: engine as any,
191192
sharing: new SharingService({ engine: engine as any }),
192193
ownershipQueues: () => queues,
193-
logger: logger as any,
194+
logger,
194195
});
195196
await rules.evaluateRule(RULE, SYS);
196197
expect(granteesOf('inv1')).toEqual(['u_c', 'u_d']);

0 commit comments

Comments
 (0)