feat(ECR-010): Ops-E 系统运营;修复登出解绑;P2 Complete
落地管理员 RBAC/封禁/推送任务 stub,logout 解绑 device 并统一各页 ensureAccount,同时收口 P2 生日生成与状态文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,6 +14,14 @@ test('star / rhythm / cards pages render with mocked API', async ({ page }) => {
|
||||
const url = route.request().url()
|
||||
const method = route.request().method()
|
||||
|
||||
if (url.includes('/auth/me')) {
|
||||
await route.fulfill(ok({ id: 'u1', phone: '13800000000' }))
|
||||
return
|
||||
}
|
||||
if (url.includes('/profiles') && method === 'GET') {
|
||||
await route.fulfill(ok({ items: [] }))
|
||||
return
|
||||
}
|
||||
if (url.includes('/profiles') && method === 'POST') {
|
||||
await route.fulfill(ok({
|
||||
id: 'prof-e2e',
|
||||
|
||||
@@ -7,6 +7,28 @@ test('home birth form opens portrait with summary and deep CTA', async ({ page }
|
||||
const url = req.url()
|
||||
const method = req.method()
|
||||
|
||||
if (url.includes('/auth/me')) {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: { id: 'u1', phone: '13800000000' },
|
||||
}),
|
||||
headers: { 'X-Device-Key': 'e2e-device' },
|
||||
})
|
||||
return
|
||||
}
|
||||
if (url.includes('/profiles') && method === 'GET') {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({ code: 0, message: 'success', data: { items: [] } }),
|
||||
headers: { 'X-Device-Key': 'e2e-device' },
|
||||
})
|
||||
return
|
||||
}
|
||||
if (url.includes('/profiles') && method === 'POST') {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
@@ -64,7 +86,7 @@ test('home birth form opens portrait with summary and deep CTA', async ({ page }
|
||||
|
||||
await page.goto('/psy/portrait?y=1990&m=5&d=12')
|
||||
await expect(page.getByRole('navigation', { name: '主导航' })).toBeVisible()
|
||||
await expect(page.getByRole('heading', { name: '愈心解码' })).toBeVisible()
|
||||
await expect(page.getByRole('heading', { name: '愈心解码', level: 1 })).toBeVisible()
|
||||
await expect(page.getByText('模拟摘要').first()).toBeVisible()
|
||||
await expect(page.getByRole('link', { name: /在报告页打开/ })).toBeVisible()
|
||||
await expect(page.getByRole('button', { name: /解锁完整分析/ }).first()).toBeVisible()
|
||||
|
||||
Reference in New Issue
Block a user