docs: Web 测试基建(#27)变更记录与开发交接记录
This commit is contained in:
@@ -251,6 +251,13 @@
|
||||
- 部署与踩坑(2026-08-13 第二次发布):①Gin 路由 `/rooms/:id/health-profile` 与已有 `/rooms/:id` 冲突导致启动 panic → 改独立路径 `/health-profiles/:roomId`;②`RegisterHealthRoutes` 曾重复注册 panic;③新增 health.go 时覆盖了原 `/health` 路由导致 health 404 → 恢复原函数并拆分 `RegisterHealthProfileRoutes`;④handler 参数名由 `id` 改为 `roomId` 修正 404。最终冒烟:蚕房1# score=96 优(risk 黄 1)
|
||||
- 回滚点见服务器 README(后端 `server-go-linux.old-20260813-6`、web `dist.old-20260813-3`)
|
||||
|
||||
### Web 测试基建(计划 #27)
|
||||
|
||||
- `web` 引入 Vitest + jsdom + @testing-library/react/jest-dom;新增 `npm test`(`vitest run`),`vite.config.ts` 增加 `test` 配置(jsdom)
|
||||
- 新增公共格式化函数 `web/src/utils/format.ts`(`aiClassLabel`/`riskLevelLabel`)+ 首批 3 个单测(TDD 红→绿);巡检记录页接入公共函数(删除内联映射)
|
||||
- 验证:`npm test` 3/3、`npm run lint`、`npm run build` 全过;无后端/schema 变更,Web 已同步部署(`dist.old-20260813-4` 为回滚点)
|
||||
- 说明:Go 测试骨架此前已随各模块落地;后续新增 Web 纯逻辑/工具函数时按 TDD 补充单测
|
||||
|
||||
## 2026-07-17 安全与界面优化整改
|
||||
|
||||
### 变更背景
|
||||
|
||||
Reference in New Issue
Block a user