fix: 优化微信发送日志展示

This commit is contained in:
Wxw-Gu
2026-09-13 11:22:47 +08:00
parent cef1ad493c
commit e5bd162a01
12 changed files with 253 additions and 39 deletions
+20
View File
@@ -143,6 +143,26 @@ test('NAV-01 NAV-02 every top-level page is unique and switchable', async () =>
}
})
test('LOGS-01 shows Action Gateway audit details and filters by date', async () => {
const fixture = await launchTestApp({ now: Date.parse('2026-09-12T10:00:00+08:00') })
try {
await fixture.page.getByRole('navigation', { name: '一级导航' }).getByRole('button', { name: '设置' }).click()
await fixture.page.getByRole('button', { name: '发送日志' }).click()
await expect(fixture.page.getByRole('heading', { name: '日志', exact: true })).toBeVisible()
await expect(
fixture.page.locator('article').filter({ hasText: '产品测试群' })
).toBeVisible()
await fixture.page.getByText('查看详情').first().click()
await expect(fixture.page.getByText('fixture-execution', { exact: true })).toBeVisible()
await expect(fixture.page.getByText(/自动化 · 定时日报/)).toBeVisible()
await fixture.page.getByLabel('开始日期').fill('2026-09-13')
await expect(fixture.page.getByText('没有匹配的日志')).toBeVisible()
} finally {
await fixture.close()
}
})
test('NAV-03 exit monitor page shows a member departure event and stays within the viewport', async () => {
const fixture = await launchTestApp()
const pageErrors: Error[] = []
+18
View File
@@ -701,6 +701,24 @@ handle('db:getContactAvatars', (usernames) =>
.map((contact) => [contact.m_nsUsrName, contact.avatar])
)
)
handle('wechat-action-log:list', () => [
{
id: 'fixture-action-log',
category: 'wechat_send',
source: 'scheduled_report',
purpose: 'scheduled_report',
triggerType: 'automation',
timestamp: new Date(fixtureNowMs - 60_000).toISOString(),
recipientType: 'group',
recipientId: 'group_regular@chatroom',
recipientName: '产品测试群',
contentType: 'image',
contentPreview: 'fixture-report.png',
status: 'sent',
executionId: 'fixture-execution',
idempotencyKey: 'scheduled_report:fixture-execution'
}
])
handle('settings:getSelf', () => ({ ready: true, info: fixture.self }))
handle('db:getCachedMessages', (md5) => fixture.messages[md5] || [])
handle('db:getCachedMessagePage', (md5) => ({