浏览代码

📝 docs(stories): 更新测试文档中的路径和命令

- 修改集成测试重点部分的路径,从`src/client/admin/__integration_tests__/`改为`src/client/__integration_tests__/admin/`
- 更新API端点路径,添加v1版本前缀,从`/api/users/*`改为`/api/v1/users/*`,从`/api/auth/login`改为`/api/v1/auth/login`
- 调整测试位置说明中的集成测试路径
- 添加新的测试命令示例,包括users.test.tsx、users.spec.ts和login.spec.ts测试文件的运行命令
yourname 2 月之前
父节点
当前提交
7aee896e51
共有 1 个文件被更改,包括 9 次插入4 次删除
  1. 9 4
      docs/stories/001.004.story.md

+ 9 - 4
docs/stories/001.004.story.md

@@ -52,9 +52,9 @@ Ready for Development
 - **其他组件**: DataTablePagination [路径: src/client/admin/components/DataTablePagination.tsx], AuthProvider [路径: src/client/admin/hooks/AuthProvider.tsx]
 
 ### 测试策略
-**集成测试重点** (`src/client/admin/__integration_tests__/`):
+**集成测试重点** (`src/client/__integration_tests__/admin/`):
 - 使用 `hono/testing` 的 `testClient` 进行类型安全的API集成测试
-- 组件与真实API集成测试 [API端点: /api/users/*, /api/auth/login]
+- 组件与真实API集成测试 [API端点: /api/v1/users/*, /api/v1/auth/login]
 - 用户界面行为和数据流测试
 - 表单验证和错误处理测试
 - 路由和导航集成测试
@@ -128,7 +128,7 @@ describe('UsersPage 集成测试', () => {
 });
 ```
 - **测试位置**:
-  - 集成测试: `src/client/admin/__integration_tests__/*.test.tsx` (使用 `.test.tsx` 后缀以匹配现有配置)
+  - 集成测试: `src/client/__integration_tests__/admin/*.test.tsx` (使用 `.test.tsx` 后缀以匹配现有配置)
   - E2E测试: `tests/e2e/specs/admin/*.spec.ts`
   - 现有单元测试: `src/client/admin/**/__tests__/*.test.tsx` (保持不变)
 - **测试模式**: 集成测试推荐使用 `hono/testing` 的 `testClient` 以获得更好的类型安全和维护性
@@ -177,10 +177,15 @@ npm run test:e2e
 npm run test
 
 # 运行特定组件测试文件
-npm run test:components -- src/client/admin/__integration_tests__/dashboard.test.tsx
+npm run test:components -- src/client/__integration_tests__/admin/dashboard.test.tsx
+
+# 运行特定组件测试文件
+npm run test:components -- src/client/__integration_tests__/admin/users.test.tsx
 
 # 运行特定E2E测试文件
 npm run test:e2e -- tests/e2e/specs/admin/dashboard.spec.ts
+npm run test:e2e -- tests/e2e/specs/admin/users.spec.ts
+npm run test:e2e -- tests/e2e/specs/admin/login.spec.ts
 
 # 生成覆盖率报告
 npm run test:components:coverage