Ready for Review
As a 测试工程师 I want 残疾人管理的新增和编辑功能的集成测试能够覆盖完整流程 so that 确保相关功能的质量和稳定性
allin-packages/disability-person-management-ui/tests/integration/disability-person.integration.test.tsxcreateAggregatedDisabledPerson和updateAggregatedDisabledPersonallin-packages/disability-person-management-ui/tests/integration/disability-person.integration.test.tsx [Source: docs/prd/epic-010-system-bug-fixes.md#技术说明]allin-packages/目录下,测试文件与源码并列在tests/目录中 [Source: architecture/source-tree.md#集成指南]基于架构文档中的测试用例编写规范,必须遵循以下原则:
根据残疾人管理模块移植故事,实际使用的API端点包括:
POST /disability-persons/aggregated/create - 创建聚合残疾人信息 [Source: docs/stories/007.004.transplant-disability-management-module.story.md#API端点]GET /disability-persons/aggregated/:personId - 查询聚合残疾人信息 [Source: docs/stories/007.004.transplant-disability-management-module.story.md#API端点]POST /disability-persons - 创建残疾人基本信息GET /disability-persons/:id - 根据ID获取残疾人信息GET /disability-persons - 获取所有残疾人信息(分页+条件查询)PUT /disability-persons/:id - 更新残疾人信息DELETE /disability-persons/:id - 删除残疾人信息注意: 当前测试文件mock了createDisabledPerson和updateDisabledPerson,但实际UI组件可能使用聚合API createAggregatedDisabledPerson和updateAggregatedDisabledPerson,需要检查并修正。
残疾人管理涉及多个关联实体:
DisabledPerson - 残疾人基本信息DisabledBankCard - 银行卡信息DisabledPhoto - 照片信息(通过fileId引用File实体)DisabledRemark - 备注信息DisabledVisit - 回访记录信息聚合API返回包含所有关联数据的完整结构。
@d8d/file-management-ui的FileSelector组件@d8d/area-management-ui的区域选择器组件(省份→城市→区县三级联动)@d8d/allin-enums包中的残疾类型、残疾等级等枚举故事010.006(修复省信息编辑功能)的经验:
parentId转换错误(null || 0导致验证失败)这些经验表明在修复测试时需要注意数据转换和实际值使用。
| Date | Version | Description | Author |
|---|---|---|---|
| 2025-12-12 | 1.0 | 故事创建,基于史诗010-07需求 | Bob (Scrum Master) |
| 2025-12-12 | 1.1 | 完成故事:修复API mock不匹配、地区选择器数据加载、测试断言等问题,12个集成测试全部通过 | Claude Sonnet 4.5 |
| 2025-12-12 | 1.2 | 完善测试:添加字段格式验证、长度限制验证、备注管理、回访记录子组件测试,16个集成测试全部通过 | Claude Sonnet 4.5 |
Claude Sonnet 4.5 (model ID: claude-sonnet-4-5-20250929)
测试执行问题(2025-12-12):
createDisabledPerson和updateDisabledPerson,但实际UI组件调用聚合API createAggregatedDisabledPerson和updateAggregatedDisabledPerson
createAggregatedDisabledPerson和updateAggregatedDisabledPerson mock,更新断言检查聚合API调用index.$get属性,确保地区API返回正确的数据结构,将选择器值从名称改为ID('1'而非'北京市')completeRadixSelectFlow内部使用act时产生警告
/支持的照片格式/和/文件大小限制/)call[0].json但实际数据结构为{ personInfo: {...}, bankCards: [] }
call[0].json.personInfo,匹配聚合API数据结构已完成工作:
createAggregatedDisabledPerson和updateAggregatedDisabledPerson)getByTestId('province-select-form')等改为使用completeRadixSelectFlow('area-select-province', '1')(使用ID而非名称)console.debug和console.log输出,保留必要的调试信息@d8d/allin-enums的mock,使用真实的枚举包index.$get属性,确保地区数据正确加载call[0].json.personInfo而非call[0].json,匹配聚合API数据结构queryByText改为queryAllByText避免MultipleElementsFoundError,提高测试健壮性剩余问题:
修改的文件:
allin-packages/disability-person-management-ui/tests/integration/disability-person.integration.test.tsx
completeRadixSelectFlowqueryByText改为queryAllByText避免MultipleElementsFoundError错误检查的文件:
allin-packages/disability-module/src/routes/aggregated.routes.ts - 确认聚合API端点allin-packages/disability-person-management-ui/src/components/DisabilityPersonManagement.tsx - 确认UI组件API调用packages/area-management-ui/src/components/areas/composite/AreaSelectForm.tsx - 确认地区选择器test-idpackages/shared-ui-components/tests/utils/radix-select.ts - 确认completeRadixSelectFlow用法This section will be populated by the QA agent during review