feat: 统一发送能力 接入退群通知与定时日报

This commit is contained in:
Wxw-Gu
2026-09-02 19:43:30 +08:00
parent e1f4ec79dd
commit 27f4108cf9
9 changed files with 150 additions and 54 deletions
+14
View File
@@ -205,6 +205,20 @@ describe('WechatActionGateway', () => {
expect(mocks.sender.send).not.toHaveBeenCalled()
})
it('用户主动发送只依赖微信发送能力', async () => {
const gateway = createGateway()
const result = await gateway.execute({
origin: 'user_tts',
purpose: 'tts_voice',
triggerType: 'user',
recipient: { type: 'contact', id: 'wxid_user' },
content: { type: 'text', text: '用户主动发送' }
})
expect(result).toMatchObject({ status: 'sent', decision: 'allow' })
expect(mocks.sender.send).toHaveBeenCalledOnce()
})
it('converts a transport throw into SEND_FAILED', async () => {
const gateway = createGateway()
mocks.sender.send.mockRejectedValueOnce(new Error('connector timeout'))