[verified] move trash restore into action menu
ci / gitleaks (push) Successful in 1m9s
ci / docker (push) Successful in 5m49s

This commit is contained in:
2026-09-21 10:22:46 +08:00
parent 927e15cf17
commit 7f8b435164
5 changed files with 39 additions and 16 deletions
+5 -3
View File
@@ -50,7 +50,7 @@ test('Trash uses compact deadline groups without exposing child-level actions',
for (const title of [overdueTitle, futureTitle, undatedTitle]) {
const row = page.locator('.task-row--trash').filter({ hasText: title })
await expect(row).toHaveCount(1)
await expect(row.getByRole('button', { name: '恢复' })).toBeVisible()
await expect(row.getByRole('button', { name: '恢复' })).toHaveCount(0)
await expect(row.getByRole('button', { name: '打开任务操作' })).toBeVisible()
expect(await row.locator('.task-check').count()).toBe(0)
}
@@ -62,10 +62,12 @@ test('Trash uses compact deadline groups without exposing child-level actions',
await actionTrigger.press('Enter')
const menu = page.getByRole('menu', { name: '回收站任务操作' })
await expect(menu).toBeVisible()
await expect(menu.getByRole('menuitem', { name: '永久删除' })).toBeFocused()
await menu.getByRole('menuitem', { name: '永久删除' }).press('Tab')
await expect(menu.getByRole('menuitem', { name: '恢复', exact: true })).toBeFocused()
await menu.getByRole('menuitem', { name: '恢复', exact: true }).press('Tab')
await expect(menu.getByRole('menuitem', { name: '永久删除' })).toBeFocused()
await menu.getByRole('menuitem', { name: '永久删除' }).press('Shift+Tab')
await expect(menu.getByRole('menuitem', { name: '恢复', exact: true })).toBeFocused()
await menu.getByRole('menuitem', { name: '恢复', exact: true }).press('ArrowUp')
await expect(menu.getByRole('menuitem', { name: '永久删除' })).toBeFocused()
await menu.getByRole('menuitem', { name: '永久删除' }).press('Escape')
await expect(menu).toBeHidden()