test(web): 薄 Web 面加 RTL 组件测试 —— 补最大覆盖缺口 (P1)
完成度审计:web 端几乎零覆盖(仅3个 api 纯逻辑用例、无任何组件测试)——三前端里 最薄。补上 RTL 基建 + 入口流组件测试。 - 加 @testing-library/react+jest-dom+user-event,src/test/setup.ts, vitest setupFiles 接入。 - AuthPage.test.tsx(5 例,mock api 层):登录/注册态切换(名字字段显隐)、 邮箱密码空时按钮禁用、登录成功回调 onAuthed 且带对参数、登录失败显示后端 错误文案不回调、注册态走 authRegister 带名字。 web 测试 3→8。CI web 矩阵已跑 npm test,自动纳入关卡。 tsc + 三前端(desktop 68/admin 41/web 8)全绿。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
"react-router-dom": "^7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
|
||||
Reference in New Issue
Block a user