feat: 修复定时日报错误通知微信机器人功能

增加定时日报debug
修复定时日报历史头像显示并区分定时日报标题
This commit is contained in:
Wxw-Gu
2026-09-02 15:01:03 +08:00
parent 1c8bbae1f0
commit 7c8b45a24a
32 changed files with 2975 additions and 213 deletions
+35
View File
@@ -782,6 +782,41 @@ describe('daily report controls', () => {
expect(deleteTrigger).toHaveFocus()
})
it('labels scheduled reports and uses the hydrated contact avatar as a fallback', () => {
const report: GeneratedReportRecord = {
id: 'scheduled-report-history',
contactId: groupContact.md5,
contactName: groupContact.m_nsNickName,
source: 'scheduled',
dateRange: '昨日',
messageCount: 10,
generatedAt: '2026-08-17T10:00:00.000Z',
reportDate: '2026-08-16',
htmlStatus: 'ready',
pngStatus: 'ready'
}
render(
<ReportHistorySidebar
reports={[report]}
contacts={[{ ...groupContact, avatar: 'data:image/png;base64,avatar' }]}
selectedReportId={report.id}
selfInfo={null}
dbReady
onSelectReport={vi.fn()}
onCreateReport={vi.fn()}
onDeleteReport={vi.fn(async () => ({ success: true }))}
onOpenSettings={vi.fn()}
/>
)
expect(screen.getByText('测试群的定时日报')).toBeVisible()
expect(screen.getByRole('img', { name: '测试群的定时日报' })).toHaveAttribute(
'src',
'data:image/png;base64,avatar'
)
})
it('prevents duplicate report deletion, keeps failures open, and closes after success', async () => {
const user = userEvent.setup()
const report: GeneratedReportRecord = {