Fix new template disappearing after save
- Update TemplateManage save flows to use the current in-memory template list instead of stale localStorage as the source of truth. - Merge current templates back into the compatibility cache so newly created backend templates are not dropped on content save. - Add an accessible label for the new-template button to support reliable E2E coverage. - Add template list merge unit tests covering stale-cache replacement and newly created templates. - Add Playwright coverage for creating a template, saving template content, and confirming it remains visible and persisted. - Update feature, progress, testing, and AGENTS documentation for the template management fix.
This commit is contained in:
@@ -43,6 +43,7 @@ npm run build
|
||||
| E2E 权限过滤 | Playwright 验证超级管理员、管理员、医生在报告管理页的可见范围。 |
|
||||
| E2E 报告修订 | Playwright 验证已完成报告再次完成保存后 `revision` 递增并保留历史。 |
|
||||
| E2E 个人模板 | Playwright 验证医生可保存个人模板且模板仅归属本人。 |
|
||||
| E2E 模板管理 | Playwright 验证管理员新增模板后点击保存内容,模板仍保留在列表且后端可查询。 |
|
||||
| E2E 路由守卫和审计日志 | Playwright 验证医生不能直进管理页,超级管理员可查看审计日志。 |
|
||||
| 后端权限策略 | Vitest 验证报告、模板、用户和管理员创建权限策略。 |
|
||||
|
||||
@@ -81,10 +82,12 @@ AI 第三方接口、讯飞语音上游 WebSocket、麦克风权限和真实视
|
||||
| 默认报告模板结构 | 已覆盖 | `defaultContent.test.ts` |
|
||||
| 默认字段和 AI Provider | 已覆盖 | `defaultContent.test.ts` |
|
||||
| 打印导出入口 | 已覆盖 | `print.test.ts` |
|
||||
| 模板列表合并工具 | 已覆盖 | `templateList.test.ts`,防止新增模板被旧本地缓存覆盖。 |
|
||||
| 默认快捷登录 | 已覆盖 | `e2e/login.spec.ts` |
|
||||
| 报告权限 E2E | 已覆盖 | `e2e/report-permissions.spec.ts` |
|
||||
| 报告修订版本 E2E | 已覆盖 | `e2e/report-revision.spec.ts` |
|
||||
| 医生个人模板 E2E | 已覆盖 | `e2e/personal-template.spec.ts` |
|
||||
| 模板管理新增保存 E2E | 已覆盖 | `e2e/template-management.spec.ts` |
|
||||
| 路由守卫和审计日志 E2E | 已覆盖 | `e2e/audit-and-route-guards.spec.ts` |
|
||||
| 后端报告/模板/用户权限策略 | 已覆盖 | `server/src/permissions/permissions.policy.test.ts` |
|
||||
| 后端报告 schema | 已覆盖 | `server/src/reports/reports.schemas.test.ts` |
|
||||
|
||||
Reference in New Issue
Block a user