feat: add current-device logout
This commit is contained in:
@@ -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"')
|
||||
|
||||
Reference in New Issue
Block a user