支持本机删除群消息和打开群链接

This commit is contained in:
xhgit committed 2026-11-15 18:06:42 +08:00
1 parent 5ec9c81f90
commit fef421bd4b
7 files changed
+134 -40

No files matched your search

+31
View File
@@ -432,6 +432,37 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
await chat(owner).getByRole('button', { name: '下载 ' + dropped, exact: true }).waitFor()
assert.equal(await chat(owner).getByRole('button', { name: '下载 ' + rejected, exact: true }).count(), 0)
const link = base + '/healthz'
assert.equal(await send(owner, link), epoch)
const webLink = chat(owner).getByRole('link', { name: link, exact: true })
assert.equal(await webLink.getAttribute('rel'), 'noopener noreferrer')
const popup = owner.waitForEvent('popup')
await webLink.click()
const webTab = await popup
await webTab.waitForURL(link)
assert.equal(await webTab.evaluate(() => window.opener === null), true)
await webTab.close()
const opened = desktop.waitForEvent('window')
await chat(windows).getByRole('button', { name: link, exact: true }).click()
const browserTab = await opened
await browserTab.waitForFunction((expected) => document.querySelector('#address')?.value === expected, link)
await browserTab.close()
await historyView(windows, '群文件').click()
const localFile = chat(windows).getByRole('list', { name: '群文件' }).getByRole('listitem').filter({ hasText: firstBatch })
await localFile.getByRole('button', { name: '收藏', exact: true }).click()
await localFile.getByRole('button', { name: '取消收藏', exact: true }).waitFor()
await localFile.getByRole('button', { name: '从本机删除', exact: true }).click()
await chat(windows).getByRole('button', { name: '确认删除群消息', exact: true }).click()
await localFile.waitFor({ state: 'detached' })
assert.equal(await chat(owner).getByRole('button', { name: '下载 ' + firstBatch, exact: true }).count(), 1)
await work(windows).getByRole('link', { name: '联系人' }).click()
await work(windows).getByRole('link', { name: '群组' }).click()
await windows.getByRole('link', { name: new RegExp(group) }).click()
await chat(windows).getByRole('button', { name: '启用本机群聊' }).click()
await chat(windows).getByText('群加密已建立', { exact: true }).waitFor()
assert.equal(await chat(windows).getByRole('button', { name: '下载 ' + firstBatch, exact: true }).count(), 0)
const voiceUploads = []
windows.on('request', (request) => {
if (request.method() === 'POST' && request.url().includes('/attachments/')) voiceUploads.push(request.url())