mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 19:47:08 +08:00
feat: 完善日报图片与公众号消息展示
修复日报图片读取格式与模型不支持时的友好降级 恢复话题关键词回退,确保词云在缺少顶层关键词时仍可展示 支持公众号多文章消息在聊天、日报、检索和 HTML 导出中完整呈现 迁移账号身份缓存并优化首次连接的账号占位信息 补充图片、词云、账号缓存与多文章消息回归测试
This commit is contained in:
@@ -72,3 +72,34 @@ describe('ImageBubble', () => {
|
||||
expect(await screen.findByAltText('图片')).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
describe('RichMessageBubble', () => {
|
||||
it('renders every article in a public-account bundle', async () => {
|
||||
const open = vi.spyOn(window, 'open').mockImplementation(() => null)
|
||||
|
||||
render(
|
||||
<RichMessageBubble
|
||||
contentData={{
|
||||
type: 'share',
|
||||
title: 'Article one',
|
||||
url: 'https://example.test/one',
|
||||
appname: 'Fixture Publisher',
|
||||
articles: [
|
||||
{ title: 'Article one', url: 'https://example.test/one' },
|
||||
{ title: 'Article two', url: 'https://example.test/two' },
|
||||
{ title: 'Article three', url: 'https://example.test/three' }
|
||||
]
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
expect(screen.getByText('Fixture Publisher')).toBeVisible()
|
||||
expect(screen.getByRole('button', { name: 'Article one' })).toBeVisible()
|
||||
expect(screen.getByRole('button', { name: 'Article two' })).toBeVisible()
|
||||
expect(screen.getByRole('button', { name: 'Article three' })).toBeVisible()
|
||||
|
||||
await userEvent.click(screen.getByRole('button', { name: 'Article three' }))
|
||||
expect(open).toHaveBeenCalledWith('https://example.test/three', '_blank')
|
||||
open.mockRestore()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user