支持跨端加密消息编辑与撤回

This commit is contained in:
xhgit committed 2026-11-13 19:26:17 +08:00
1 parent 9b8c2026ea
commit f5f116a266
6 files changed
+140 -23

No files matched your search

+10
View File
@@ -107,6 +107,16 @@ test('Web 与 Windows 安全码校验、加密互发、离线接收和状态恢
await send(windows, reply)
await web.getByText(reply, { exact: true }).waitFor()
await web.getByRole('listitem').filter({ hasText: reply }).locator('blockquote').getByText(text, { exact: true }).waitFor()
assert.equal(await web.getByRole('listitem').filter({ hasText: reply }).getByRole('button', { name: '编辑', exact: true }).count(), 0)
const edited = '编辑后 ' + randomBytes(8).toString('hex')
await windows.getByRole('listitem').filter({ hasText: reply }).getByRole('button', { name: '编辑', exact: true }).click()
await windows.getByRole('textbox', { name: '消息', exact: true }).fill(edited)
await windows.getByRole('button', { name: '保存编辑', exact: true }).click()
await web.getByRole('listitem').filter({ hasText: edited }).getByText('已编辑', { exact: true }).waitFor()
await windows.getByRole('listitem').filter({ hasText: edited }).getByRole('button', { name: '撤回', exact: true }).click()
await windows.getByRole('button', { name: '确认撤回', exact: true }).click()
await web.getByText('消息已撤回', { exact: true }).waitFor()
assert.equal(await web.getByText(edited, { exact: true }).count(), 0)
const original = web.getByRole('listitem').filter({ has: web.getByText(text, { exact: true }) }).filter({ hasNot: web.locator('blockquote') })
await original.getByRole('button', { name: '收藏', exact: true }).click()
await original.getByRole('button', { name: '取消收藏' }).waitFor()