Ready for Review
作为系统开发人员, 我希望在server包中创建史诗012新增路由的连通性集成测试, 以便验证这些路由在server包中注册的正确性和系统集成性,确保API端点可正常访问。
从史诗文件复制的验收标准编号列表
将故事分解为实施所需的具体任务和子任务。 在相关处引用适用的验收标准编号。
src/index.ts中史诗012新增的路由注册:
enterpriseAuthApiRoutes (/api/v1/yongren/auth)enterpriseCompanyApiRoutes (/api/v1/yongren/company)enterpriseDisabilityApiRoutes (/api/v1/yongren/disability-person)orderApiRoutes注册)packages/server/tests/integration/目录创建epic012-routes-connectivity.integration.test.ts文件describe、it、expect from 'vitest'testClient from 'hono/testing'enterpriseAuthApiRoutes、enterpriseCompanyApiRoutes、enterpriseDisabilityApiRoutes、orderApiRoutes from '../../src/index'POST /api/v1/yongren/auth/login端点连通性POST /api/v1/yongren/auth/logout端点连通性GET /api/v1/yongren/auth/me端点连通性GET /api/v1/yongren/company/overview端点连通性GET /api/v1/yongren/company/{id}/talents端点连通性(使用测试ID)/api/v1/yongren/company正确应用GET /api/v1/yongren/disability-person/{id}/work-history端点连通性GET /api/v1/yongren/disability-person/{id}/salary-history端点连通性GET /api/v1/yongren/disability-person/{id}/credit-info端点连通性GET /api/v1/yongren/disability-person/{id}/videos端点连通性/api/v1/yongren/disability-person正确应用GET /api/v1/order/checkin-statistics端点连通性GET /api/v1/order/video-statistics端点连通性GET /api/v1/order/company-orders端点连通性GET /api/v1/order/company-videos端点连通性POST /api/v1/order/batch-download端点连通性PUT /api/v1/order/videos/{id}/status端点连通性orderApiRoutes正确注册cd packages/server && pnpm test --testNamePattern "史诗012"cd packages/server && pnpm test@d8d/server) 及其路由注册allin-modules.integration.test.ts)packages/server/src/index.ts:路由注册入口packages/server/tests/integration/:集成测试目录/api/v1/yongren前缀正确应用于史诗012新增路由testClient调用端点,验证响应状态码(200或401)仅填充从docs文件夹中的实际工件提取的相关信息,与此故事相关:
史诗013中已有故事013.001和013.002完成类型错误修复。本故事关注测试覆盖而非类型修复。
基于史诗012实现和server包路由注册分析:
企业用户认证路由 (enterpriseAuthApiRoutes):
/api/v1/yongren/authPOST /login、POST /logout、GET /meenterpriseAuthMiddleware(企业用户认证)企业统计路由 (enterpriseCompanyApiRoutes):
/api/v1/yongren/companyGET /overview、GET /{id}/talentsenterpriseAuthMiddleware残疾人扩展路由 (enterpriseDisabilityApiRoutes):
/api/v1/yongren/disability-personGET /{id}/work-history、GET /{id}/salary-history、GET /{id}/credit-info、GET /{id}/videosenterpriseAuthMiddleware订单模块企业功能:
orderApiRoutes注册,路径:/api/v1/order/checkin-statistics、/video-statistics、/company-orders、/company-videos、/batch-download、/videos/{id}/statusenterpriseAuthMiddlewaretestClient调用端点,验证返回200(已认证)或401(未认证)docs/prd/epic-012-api-supplement-for-employer-mini-program.mddocs/prd/epic-013-type-error-fixes.mddocs/architecture/docs/architecture/coding-standards.mddocs/architecture/coding-standards.md#测试框架packages/server/tests/integration/epic012-routes-connectivity.integration.test.ts - 史诗012新增路由连通性集成测试packages/server/tests/integration/epic012-routes-connectivity.integration.test.tsReady for Review