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