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
+15 -2
View File
@@ -1,5 +1,5 @@
import type { Page } from '@playwright/test'
import { expect, test } from './fixtures'
import { allowExpectedError, expect, test } from './fixtures'
function bottomTab(page: Page, name: string) {
return page.getByRole('navigation', { name: '主要导航' }).getByRole('button', { name, exact: true })
@@ -202,8 +202,21 @@ test('settings match the approved paper-ledger geometry and action hierarchy', a
const box = await target.boundingBox()
expect(box).not.toBeNull()
expect(box!.width).toBeGreaterThanOrEqual(44)
expect(box!.height).toBeGreaterThanOrEqual(44)
expect(box!.height).toBeGreaterThanOrEqual(isMobileContract ? 44 : 40)
}
const logout = page.getByRole('button', { name: '退出登录', exact: true })
await expect(logout).toBeVisible()
await expect(logout).toBeEnabled()
const logoutBox = await logout.boundingBox()
expect(logoutBox).not.toBeNull()
expect(logoutBox!.width).toBeGreaterThanOrEqual(88)
expect(logoutBox!.height).toBeGreaterThanOrEqual(isMobileContract ? 44 : 40)
allowExpectedError(page, 'requestfailed: POST http://127.0.0.1:5173/api/v1/auth/logout net::ERR_ABORTED')
await logout.click()
await expect(page.getByRole('button', { name: '登录', exact: true })).toBeVisible()
await expect(page.getByText('欢迎回来,继续把生活理顺。')).toBeVisible()
expect(await page.request.get('/api/v1/me')).not.toBeOK()
})
test('task, habit, countdown, memo, action and confirmation overlays share the modal contract', async ({ page }, testInfo) => {