Files
heroui-vue/tests
maoyingjie 53e76f676d fix(demos): restore form, overlay and toast demos to the pinned cn baseline
HD-02 scope, all against heroui ce90ea3 cn sources:

- card: add the text-primary class to the coin icons (source parity);
  card-with-form drops the added required validation and inline business
  note, restores the plain href="#" forgot-password link and the baseline
  alert("表单提交成功!") submit feedback (autocomplete kept: no visible
  impact, allowed by the task card)
- input-group-with-textarea: restore the four Tooltips and the Enter Kbd
  hint; drop the stale "Tooltip 组件尚未迁移" note from input-group.md
- alert-dialog: restore the h-px top light line in custom-styles and the
  truncated/missing description text in sizes/custom-portal/
  custom-animations (+ controlled); align the fluid-slide icon with the
  modal mapping (IconArrowBarUp for gravity-ui:arrow-up-from-line)
- toast: restore the upstream demo layout shells (variants/simple/
  custom-indicator/custom-queue) and the action button default variant:
  ToastActionButton now falls back to the Button defaults (primary/md)
  like upstream ToastActionButton, so variants' actions render primary,
  danger stays danger and default stays tertiary; toast.md defaults fixed
- submit demos: restore baseline feedback and structure — alert() for
  card/fieldset/form/checkbox/checkbox-group/switch/select/combo-box/
  autocomplete and console.log for search/number/time field form examples;
  modal-with-form returns to the close-only footer (no submit/result row);
  drop the added inline status/result rows and the max-w-full/
  max-sm:min-w-0 width guards from the restored demos
- radio-group-validation: add the missing text-muted to the result line;
  label.md invalid example gives the real control its invalid state and
  matches the baseline input shape

Tests re-pinned to the baseline contracts (alert/console/close behavior,
four tooltips + Kbd, positional modal footer); full suite 110 files /
1617 tests, typecheck, build:docs and the m35-m36 tarball contract pass.
2026-10-28 14:10:10 +08:00
..

验证入口

测试按风险选择,不要求每次局部修改遍历全库。当前仅支持浏览器客户端使用,暂不支持SSR、服务端水合或Nuxt服务端渲染。除用户明确重新启用外,不开发、不修复、不新增也不运行相关专项;历史通过记录不构成支持承诺。SSR遗留文件和混合案例已删除,仅从Git查询,客户端回归保留。

日常修改

先选组件与共享依赖的明确测试。例如修改ComboBox/Autocomplete:

pnpm exec vitest run tests/combo-box.test.ts tests/autocomplete.test.ts tests/b02-public-integration.test.ts tests/regressions/collection/picker-public-contracts.test.ts
pnpm typecheck

修改字段、集合、弹层等共享协议时,加入其基础测试和使用者。用rg '组件名|协议文件' tests找回归,不要求阅读所有历史报告。文档代码、样式和公共导出分别补相应的demo/构建/产物验证。

辅助选择命令:

pnpm test:related packages/vue/src/components/combo-box/ComboBox.vue

这是Vitest静态依赖图筛选,包根导入可能扩大范围,CSS/动态依赖可能漏选;只作辅助,不能代替任务卡列出的行为场景。无关联测试会失败,不能解释为组件已验收。

集成检查

命令 范围
pnpm test / pnpm test:unit 全部现存客户端回归,没有SSR排除或skip配置
pnpm test:related <源文件> 同一客户端范围下的静态依赖辅助筛选
pnpm typecheck 源码/工作区类型,不代替发布类型
pnpm build:docs 库、样式与文档站静态构建,保留文档渲染要求,不视为组件SSR支持
pnpm build:playground 浏览器验证入口生产构建

现有97个测试文件包含1415项客户端用例,默认全部运行;不再维护SSR排除规则或相关命令。逐像素自动对比、完整读屏矩阵、真机矩阵、Nuxt集成暂不投入。

不新增普遍服务端、无document运行、ID水合稳定、Teleport服务端、Nuxt服务端适配等验收要求。NodeNext是发布类型解析模式,不代表要求SSR支持。

真浏览器与产物

  • 弹层/拖动/滚动/动画/布局:真实打开公开组合,确认面板可见、可点、选择生效、焦点与关闭正确。aria-expanded或jsdom挂载不是可见性证据。
  • 同次变更先验核心路径,再验受控/禁用/表单/动态更新等适用边界;不要求逐个点击所有文档页面。
  • 公开API/导出/打包变动:用最终tarball独立安装,执行相关 消费契约,包含NodeNext/bundler正反类型;不使用源码alias。
  • SSR/水合/Nuxt服务端不支持、不执行。读屏/逐像素等没做的专项写清楚,不自动扩大范围。

新增与整理测试

先检查同一行为是否已有断言。修复时优先补到对应组件或基础协议套件;独立且有必要的场景才新建文件,以能力命名,不按“review-第几轮”新增。历史probe逐步随组件维护归并;删除前必须给出等价覆盖位置,不能通过减少期望、skip或删除反例掩盖客户端回归。用户已明确移出范围的SSR历史代码已删除,不作为客户端覆盖要求。共享夹具只在真实重复已确认时提取,不建立另一层测试框架。

返修回归位置

20份历史review/probe/takeover/fidelity套件已按能力移入tests/regressions:toast-table、menu-dropdown、collection、overlay、color、toolbar、button-toggle、navigation-otp。文件以行为命名;断言原样保留,未来修复优先补到对应能力目录。不因减少文件数量而合并隔离的cleanup生命周期,不把本轮归组描述为重复断言已删除。