mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 03:27:00 +08:00
feat: 完善日报图片与公众号消息展示
修复日报图片读取格式与模型不支持时的友好降级 恢复话题关键词回退,确保词云在缺少顶层关键词时仍可展示 支持公众号多文章消息在聊天、日报、检索和 HTML 导出中完整呈现 迁移账号身份缓存并优化首次连接的账号占位信息 补充图片、词云、账号缓存与多文章消息回归测试
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { parseGroupDailyReport } from '../../src/renderer/src/utils/group-report'
|
||||
import type { GroupReportMetadata } from '../../src/shared/group-report'
|
||||
|
||||
const metadata: GroupReportMetadata = {
|
||||
groupName: '测试群',
|
||||
reportDate: '2026-08-06',
|
||||
dateRange: '今日',
|
||||
messageCount: 3,
|
||||
activeUsers: 2,
|
||||
timeSpan: '1 h',
|
||||
generatedAt: '2026/8/6 12:00:00',
|
||||
recordNote: 'fixture',
|
||||
footerNote: '',
|
||||
heroParticipants: [],
|
||||
reportMode: 'full'
|
||||
}
|
||||
|
||||
const media = {
|
||||
gallery: [],
|
||||
voiceHighlights: [],
|
||||
funBadges: []
|
||||
}
|
||||
|
||||
describe('group report parsing', () => {
|
||||
it('falls back to topic keywords when the model omits top-level keywords', () => {
|
||||
const report = parseGroupDailyReport(
|
||||
JSON.stringify({
|
||||
topics: [
|
||||
{
|
||||
title: '健身安排',
|
||||
summary: '讨论训练时间和肌酸。',
|
||||
keywords: ['肌酸', '训练']
|
||||
}
|
||||
]
|
||||
}),
|
||||
[],
|
||||
'',
|
||||
[],
|
||||
metadata,
|
||||
media
|
||||
)
|
||||
|
||||
expect(report.keywords).toEqual(['肌酸', '训练', '健身安排'])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user