|
|
@@ -84,7 +84,6 @@ vi.mock('@d8d/allin-disability-person-management-ui', () => ({
|
|
|
phone: '13800138000'
|
|
|
};
|
|
|
onSelect(mode === 'multiple' ? [mockPerson] : mockPerson);
|
|
|
- console.debug('选择人员按钮点击,调用onSelect,准备调用onOpenChange(false)');
|
|
|
onOpenChange(false);
|
|
|
}}
|
|
|
style={{ pointerEvents: 'auto' }} // 确保按钮可以点击
|
|
|
@@ -826,57 +825,22 @@ describe('订单管理集成测试', () => {
|
|
|
|
|
|
// 点击选择残疾人按钮
|
|
|
const selectPersonsButton = screen.getByTestId('select-persons-button');
|
|
|
- console.debug('点击选择残疾人按钮前,按钮状态:', {
|
|
|
- disabled: selectPersonsButton.disabled,
|
|
|
- style: selectPersonsButton.style,
|
|
|
- outerHTML: selectPersonsButton.outerHTML
|
|
|
- });
|
|
|
await userEvent.click(selectPersonsButton);
|
|
|
|
|
|
- // 验证残疾人选择器打开 - 添加调试信息
|
|
|
+ // 验证残疾人选择器打开
|
|
|
await waitFor(() => {
|
|
|
- const selector = screen.getByTestId('disabled-person-selector-mock');
|
|
|
- expect(selector).toBeInTheDocument();
|
|
|
- console.debug('残疾人选择器已打开,DOM结构:', selector.outerHTML);
|
|
|
+ expect(screen.getByTestId('disabled-person-selector-mock')).toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
// 选择测试人员
|
|
|
const selectPersonButton = screen.getByTestId('select-person-button');
|
|
|
- console.debug('选择人员按钮:', selectPersonButton);
|
|
|
await userEvent.click(selectPersonButton);
|
|
|
|
|
|
- // 不手动关闭残疾人选择器,让handlePersonSelect中的setIsPersonSelectorOpen(false)处理
|
|
|
-
|
|
|
- // 验证人员被添加到列表 - 添加更灵活的查找方式
|
|
|
+ // 验证人员被添加到列表
|
|
|
await waitFor(() => {
|
|
|
- // 首先检查订单表单是否仍然打开
|
|
|
- const dialogTitle = screen.queryByTestId('create-order-dialog-title');
|
|
|
- console.debug('订单表单对话框状态:', {
|
|
|
- dialogTitle: dialogTitle?.textContent,
|
|
|
- dialogTitleExists: !!dialogTitle
|
|
|
- });
|
|
|
-
|
|
|
- // 检查人员选择区域是否存在
|
|
|
- const selectPersonsButton = screen.queryByTestId('select-persons-button');
|
|
|
- console.debug('人员选择按钮状态:', {
|
|
|
- selectPersonsButton: selectPersonsButton?.textContent,
|
|
|
- selectPersonsButtonExists: !!selectPersonsButton
|
|
|
- });
|
|
|
-
|
|
|
- // 尝试多种查找方式
|
|
|
- const personText = screen.queryByText('测试残疾人');
|
|
|
- const disabilityTypeText = screen.queryByText('肢体残疾');
|
|
|
- const disabilityLevelText = screen.queryByText('三级');
|
|
|
-
|
|
|
- console.debug('查找结果:', {
|
|
|
- personText: personText?.textContent,
|
|
|
- disabilityTypeText: disabilityTypeText?.textContent,
|
|
|
- disabilityLevelText: disabilityLevelText?.textContent
|
|
|
- });
|
|
|
-
|
|
|
- expect(personText).toBeInTheDocument();
|
|
|
- expect(disabilityTypeText).toBeInTheDocument();
|
|
|
- expect(disabilityLevelText).toBeInTheDocument();
|
|
|
+ expect(screen.getByText('测试残疾人')).toBeInTheDocument();
|
|
|
+ expect(screen.getByText('肢体残疾')).toBeInTheDocument();
|
|
|
+ expect(screen.getByText('三级')).toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
// 填写订单基本信息
|