接入私聊消息通知和联系人免打扰

This commit is contained in:
xhgit committed 2026-11-15 22:27:58 +08:00
1 parent 5c882ac855
commit 7e165ba9b4
23 files changed
+286 -97

No files matched your search

+6 -6
View File
@@ -176,10 +176,10 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
await owner.getByRole('heading', { name: group }).waitFor()
await invite(owner, windows, names[1], group)
await invite(owner, removed, names[2], group)
const webToggle = removed.getByRole('button', { name: '群消息系统通知', exact: true })
const webToggle = removed.getByRole('button', { name: '消息系统通知', exact: true })
assert.equal(await webToggle.getAttribute('aria-pressed'), 'false')
await webToggle.click()
await removed.getByText('已在本设备启用群消息系统通知', { exact: true }).waitFor()
await removed.getByText('已在本设备启用消息系统通知', { exact: true }).waitFor()
const settings = (page, name) => page.getByRole('button', { name, exact: true })
await settings(removed, '群聊免打扰').click()
await removed.getByRole('button', { name: '群聊免打扰', pressed: true }).waitFor()
@@ -691,10 +691,10 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
await owner.getByRole('link', { name: new RegExp(group) }).click()
await chat(owner).getByRole('button', { name: '启用本机群聊' }).click()
await chat(owner).getByText('群加密已建立', { exact: true }).waitFor()
const windowsToggle = windows.getByRole('button', { name: '群消息系统通知', exact: true })
const windowsToggle = windows.getByRole('button', { name: '消息系统通知', exact: true })
assert.equal(await windowsToggle.getAttribute('aria-pressed'), 'false')
await windowsToggle.click()
await windows.getByText('已在本设备启用群消息系统通知', { exact: true }).waitFor()
await windows.getByText('已在本设备启用消息系统通知', { exact: true }).waitFor()
await desktop.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].minimize())
await send(owner, 'Windows 后台群消息 ' + id())
const restoreWindow = async () => desktop.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].restore())
@@ -709,8 +709,8 @@ test('Windows 与 Web 加密群聊支持消息操作、附件、语音和成员
} finally {
await restoreWindow()
}
await windows.getByRole('button', { name: '群消息系统通知', pressed: true }).click()
await windows.getByText('已在本设备关闭群消息系统通知', { exact: true }).waitFor()
await windows.getByRole('button', { name: '消息系统通知', pressed: true }).click()
await windows.getByText('已在本设备关闭消息系统通知', { exact: true }).waitFor()
} catch (error) {
const status = await Promise.all(pages.map((page) => page.locator('[role=alert], .group-chat [role=status]').allTextContents()))
throw new Error(JSON.stringify(status), { cause: error })