Browse Source

📝 docs(stories): update testing strategy documentation

- add file paths for components in page analysis section
- add API endpoints specification for integration testing
- add form validation testing to integration test scope
- specify complete user workflow for E2E testing
- add data persistence testing to E2E test scope
- add test data requirements and environment specifications
- expand component list with additional UI elements
yourname 2 months ago
parent
commit
9b08d934f0
1 changed files with 11 additions and 6 deletions
  1. 11 6
      docs/stories/001.004.story.md

+ 11 - 6
docs/stories/001.004.story.md

@@ -43,26 +43,31 @@ Ready for Development
 
 ### 现有页面分析
 基于目录结构分析 [Source: src/client/admin/]:
-- **Dashboard.tsx**: 管理控制台主页,显示核心指标
-- **Users.tsx**: 用户管理页面,CRUD操作界面
-- **Login.tsx**: 登录认证页面
-- **布局组件**: MainLayout, ProtectedRoute等辅助组件
+- **Dashboard.tsx**: 管理控制台主页,显示核心指标 [路径: src/client/admin/pages/Dashboard.tsx]
+- **Users.tsx**: 用户管理页面,CRUD操作界面 [路径: src/client/admin/pages/Users.tsx]
+- **Login.tsx**: 登录认证页面 [路径: src/client/admin/pages/Login.tsx]
+- **布局组件**: MainLayout [路径: src/client/admin/layouts/MainLayout.tsx], ProtectedRoute [路径: src/client/admin/components/ProtectedRoute.tsx]
+- **其他组件**: DataTablePagination [路径: src/client/admin/components/DataTablePagination.tsx], AuthProvider [路径: src/client/admin/hooks/AuthProvider.tsx]
 
 ### 测试策略
 **集成测试重点**:
 - 组件交互和状态管理测试
-- API调用和数据处理验证
+- API调用和数据处理验证 [API端点: /api/users/*, /api/auth/login]
 - 用户界面行为测试
+- 表单验证和错误处理测试
 
 **E2E测试重点**:
-- 完整用户工作流测试
+- 完整用户工作流测试 (登录 → Dashboard → 用户管理)
 - 跨页面导航验证
 - 真实浏览器环境测试
+- 数据持久化和状态管理测试
 
 ### 技术约束
 - **测试框架**: Vitest + Testing Library (集成测试), Playwright (E2E测试)
 - **兼容性**: 保持现有功能不变
 - **性能**: 测试执行时间合理
+- **测试数据**: 使用现有测试数据工厂模式 [参考: 现有测试文件中的mock数据模式]
+- **环境要求**: 需要配置测试数据库连接和认证token
 
 ### 集成点
 - 现有Vitest配置