feat: 发送支持群聊@成员

生命周期整理
清理残留整理
完善skill
This commit is contained in:
Wxw-Gu committed 2026-11-12 11:18:32 +08:00
1 parent 804466aad8
commit 5d4ba73771
28 files changed
+1214 -103

No files matched your search

+34
View File
@@ -202,6 +202,40 @@ describe('POST /api/v1/wechat/send', () => {
expect(action.content).toEqual({ type: 'text', text: '你好' })
})
it('验证并透传群聊原生 @ 成员映射', async () => {
const response = await post({
to: 'fixture-room@chatroom',
isGroup: true,
type: 'text',
text: '早上好',
at: { wxid_fixture_member: '测试成员' }
})
expect(response.status).toBe(200)
expect(lastAction().content).toEqual({
type: 'text',
text: '早上好',
at: { wxid_fixture_member: '测试成员' }
})
const invalid = await post({
to: 'fixture-room@chatroom',
type: 'text',
text: '早上好',
at: ['wxid_fixture_member']
})
expect(invalid.status).toBe(400)
})
it('拒绝格式错误的群聊 @ 成员映射', async () => {
const response = await post({
to: 'fixture-room@chatroom',
type: 'text',
text: '早上好',
at: ['wxid_fixture_member']
})
expect(response.status).toBe(400)
expect(execute).not.toHaveBeenCalled()
})
it('type 省略时按文本发送', async () => {
await post({ to: 'wxid_friend', text: 'hi' })
expect(lastAction().content).toEqual({ type: 'text', text: 'hi' })