mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 19:47:08 +08:00
修复日报图片读取格式与模型不支持时的友好降级 恢复话题关键词回退,确保词云在缺少顶层关键词时仍可展示 支持公众号多文章消息在聊天、日报、检索和 HTML 导出中完整呈现 迁移账号身份缓存并优化首次连接的账号占位信息 补充图片、词云、账号缓存与多文章消息回归测试
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
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(['肌酸', '训练', '健身安排'])
|
|
})
|
|
})
|