Browse Source

🔧 debug(cancel-reason): 在取消原因对话框添加调试信息并更新测试文档

- 在CancelReasonDialog的handleReasonSelect函数中添加console.debug调试信息
- 更新CLAUDE.md中的测试调试说明,明确区分Vitest和Jest的参数差异
- 删除测试用的HTML文件

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 2 weeks ago
parent
commit
641ed46cec
2 changed files with 7 additions and 1 deletions
  1. 4 1
      CLAUDE.md
  2. 3 0
      mini/src/components/common/CancelReasonDialog/index.tsx

+ 4 - 1
CLAUDE.md

@@ -18,6 +18,9 @@
 - bmad-core dir is in .bmad-core
 - 必须用中文回答
 - **git提交**: 当遇到git锁文件冲突时,使用单条命令:`rm -f /mnt/code/184-172-template-6/.git/index.lock && git add <文件> && git commit -m "提交信息"`
-- **测试调试**: 使用 `pnpm test -t "测试名称"` 来运行特定测试查看详细信息
+- **测试调试**: 使用 `pnpm test --testNamePattern "测试名称"` 来运行特定测试查看详细信息 (mini使用Jest,其他包使用Vitest)
+  - **Vitest**: 支持 `-t` 或 `--testNamePattern`
+  - **Jest**: 只支持 `--testNamePattern`,mini是Jest
+  - **Mini测试**: 需要先进入mini目录再运行 `pnpm test --testNamePattern "测试名称"`
 - **表单调试**: 表单提交失败时,在表单form onsubmit=form.handleSubmit的第二个参数中加console.debug来看表单验证错误,例如:`form.handleSubmit(handleSubmit, (errors) => console.debug('表单验证错误:', errors))`
 - 类型检查 可以用 pnpm typecheck 加 grep来过滤要检查的 指定文件

+ 3 - 0
mini/src/components/common/CancelReasonDialog/index.tsx

@@ -47,9 +47,12 @@ export default function CancelReasonDialog({
 
   // 处理原因选择
   const handleReasonSelect = (reasonText: string) => {
+    console.debug('CancelReasonDialog: 点击取消原因选项:', reasonText)
+    console.debug('CancelReasonDialog: 当前选中状态:', selectedReason)
     setSelectedReason(reasonText)
     setReason(reasonText)
     if (error) setError('')
+    console.debug('CancelReasonDialog: 设置后选中状态:', reasonText)
   }
 
   // 处理自定义原因输入