Skip to content

test(ui): 报价卡测试结束后恢复原有 locale - #363

Merged
helsome merged 1 commit into
mainfrom
maint/quote-card-test-locale-cleanup
Oct 22, 2026
Merged

helsome merged 1 commit into
mainfrom
maint/quote-card-test-locale-cleanup

Conversation

@helsome

@helsome helsome commented Oct 22, 2026

Copy link
Copy Markdown
Owner

问题与结果

#325 的报价卡测试在 beforeAll 固定全局 locale 为 en-US,afterAll 只恢复 DOM;同进程后续测试会继承 locale。本变更保存进入用例前的 locale,并在 afterAll 恢复。只改测试清理,不改变币种实现或增加 UI 范围。

验证

环境:Linux x64 / Bun 1.4.2。

  • 独立生命周期探针:先设 zh-CN,再导入并执行实际 QuoteCard 测试,最后检查 locale;修补前 16 pass / 1 fail,最终 en-US;修补后 16 pass / 0 fail,最终 zh-CN。探针位于本次验收产物 quote-locale-cleanup.test.ts。
  • bun test packages/ui/src/components/agent/structured/QuoteCard.test.tsx packages/ui/src/lib/money.test.ts --isolate:19 pass / 0 fail。
  • bun test packages/ui --isolate:407 pass / 0 fail。
  • bun test --isolate:2062 pass / 7 skip / 0 fail。
  • bun run typecheck:五个工作区全部 exit 0。
  • bun run build、git diff --check、高信号 secret scan(无命中)通过。

上述全仓检查在精确集成 tree 8f8838cc035a056b87a80eb1fce2f897adb34d00 执行;远端分支会核对相同 tree 后合并。仓库规定的 --isolate 测试在 #325 原实现上也通过,本 PR 修补共享进程的测试清理质量。无可见 UI 变化。未运行付费或真实模型评测,未主动 rerun Actions;不把无 CI 记录称为 CI 通过。

@helsome
helsome merged commit 9afa460 into main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant