feat: add current-device logout
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 3m40s

This commit is contained in:
2026-09-20 08:20:12 +08:00
parent 7f11d0ba78
commit 8ecc3e265f
5 changed files with 58 additions and 5 deletions
+14
View File
@@ -203,6 +203,20 @@ describe('approved Settings 01 paper ledger', () => {
})
describe('settings sessions and audit activity', () => {
it('offers a current-device logout action that returns the app to login', () => {
expect(mvpPanel).toContain("import { ArchiveRestore, Check, ChevronRight, Download, GripVertical, LogOut, Pencil, Trash2, X } from 'lucide-vue-next'")
expect(mvpPanel).toContain("logout: []")
expect(mvpPanel).toContain("await request('/auth/logout', { method: 'POST' })")
expect(mvpPanel).toContain("emit('logout')")
expect(mvpPanel).toContain('class="settings-row settings-logout-row"')
expect(mvpPanel).toContain('<b>退出登录</b><small>仅退出当前设备,不影响其他设备</small>')
expect(mvpPanel).toContain('class="danger-text settings-logout-button"')
expect(mvpPanel).toContain("{{ logoutBusy ? '正在退出…' : '退出登录' }}")
expect(app).toContain('@logout="completeLogout"')
expect(app).toContain('function completeLogout()')
expect(css).toContain('.settings-logout-button{min-width:88px;display:inline-flex;align-items:center;justify-content:center;gap:6px}')
})
it('renders readable session metadata, local time, and an accessible revoke action', () => {
expect(mvpPanel).toContain('class="session-copy"')
expect(mvpPanel).toContain('class="session-title"')