支持收藏标签和批量取消

This commit is contained in:
xhgit committed 2026-11-15 22:55:17 +08:00
1 parent e08c990cc7
commit f923b0ca7b
7 files changed
+218 -39

No files matched your search

+29 -1
View File
@@ -420,8 +420,21 @@ test('Web 与 Windows 安全码校验、加密互发、离线接收和状态恢
assert.deepEqual(await readFile(await (await favoriteDownload).path()), Buffer.from(remainingFile))
await webFavorites.getByRole('button', { name: '取消收藏', exact: true }).click()
await web.getByText('没有匹配的收藏。', { exact: true }).waitFor()
await web.getByLabel('内容类型').selectOption('link')
await webFavorites.getByRole('button', { name: '编辑标签', exact: true }).click()
await web.getByLabel('收藏标签').fill('验收资料,DOC,Doc')
await webFavorites.getByRole('button', { name: '保存标签', exact: true }).click()
await webFavorites.getByRole('button', { name: '验收资料', exact: true }).waitFor()
assert.equal(await webFavorites.locator('.favorite-tags button').count(), 2)
await web.getByLabel('标签筛选', { exact: true }).selectOption('doc')
await search.fill('dOc')
await webFavorites.getByRole('link', { name: link, exact: true }).waitFor()
await work(web).getByRole('link', { name: '联系人', exact: true }).click()
await work(web).getByRole('link', { name: '收藏', exact: true }).click()
await webFavorites.getByRole('button', { name: '验收资料', exact: true }).waitFor()
web.off('request', trackFavorites)
assert.ok(tracked.every(([url, method, body]) => method === 'GET' && !body && !url.includes(encodeURIComponent(marker))))
assert.ok(tracked.every(([url, method, body]) => method === 'GET' && !body &&
!url.includes(encodeURIComponent(marker)) && !url.includes(encodeURIComponent('验收资料'))))
await windows.getByLabel('内容类型').selectOption('image')
await windowsFavorites.getByRole('button', { name: '预览 加密预览.png', exact: true }).click()
@@ -430,6 +443,21 @@ test('Web 与 Windows 安全码校验、加密互发、离线接收和状态恢
await windowsFavorites.getByRole('button', { name: '播放语音', exact: true }).click()
await windows.waitForFunction(() => document.querySelector('.favorite-card audio')?.currentTime > 0)
assert.equal(await windowsFavorites.getByRole('link', { name: link, exact: true }).count(), 0)
await windows.getByLabel('内容类型').selectOption('all')
await windows.getByRole('button', { name: '批量管理', exact: true }).click()
await windows.getByRole('button', { name: '选择当前列表', exact: true }).click()
const bulk = windows.getByRole('button', { name: '取消所选收藏(2)', exact: true })
await bulk.click()
const confirmation = windows.getByRole('region', { name: '确认取消收藏' })
await confirmation.getByRole('button', { name: '返回', exact: true }).click()
assert.equal(await windowsFavorites.getByRole('listitem').count(), 2)
await bulk.click()
await confirmation.getByRole('button', { name: '确认取消收藏', exact: true }).click()
await windows.getByText('本机还没有收藏。', { exact: true }).waitFor()
await windows.evaluate((url) => { location.hash = new URL(url).hash }, windowsChat)
await enable(windows)
await windows.getByRole('button', { name: '预览 加密预览.png', exact: true }).waitFor()
await windows.getByRole('button', { name: '播放语音', exact: true }).waitFor()
} finally {
await desktop?.close()
await browser.close()