Skip to content

test(shared): edgeEventEvidence + composer/attachments + i18n resources 补 153 个单元测试(Lane D #1764 第十二批) - #1781

Merged
DeliciousBuding merged 1 commit into
masterfrom
test/shared-evidence-attachments-i18n-unit-tests
Aug 19, 2026
Merged

test(shared): edgeEventEvidence + composer/attachments + i18n resources 补 153 个单元测试(Lane D #1764 第十二批)#1781
DeliciousBuding merged 1 commit into
masterfrom
test/shared-evidence-attachments-i18n-unit-tests

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

Summary

延续 #1765#1780,落地 Lane D 前端测试补债 (#1764) 第十二批:给 3 个模块补 153 个单元测试。不改任何产品代码。

为什么选它

  • transcript/edgeEventEvidence.ts(215 行):Edge 事件证据构建/作者推导,mapper 的直接依赖,此前零覆盖。
  • composer/attachments.ts(133 行):附件哈希/格式化核心;既有 13 用例合并升级为 73(超集,100% 行/分支/函数覆盖)。
  • chatview/i18n/resources.ts(1208 行):zh/en 键集奇偶校验 + 复数约定 + 值卫生——i18n 翻译漂移的防线。

覆盖范围

  • edgeEventEvidence(+68):AGENT/EDGE_AUTHOR、agentAuthorFromEvent 回退链、blockBase、runEvidence/toolEvidence/approvalEvidence/approvalHubContext/fileEvidence、eventRunId、状态/风险/fileAction 归一化
  • attachments(+73):真实 SHA-256(hello/空串/abc/unicode/二进制)、9 导出全量、12000 字符预览边界、CRLF 归一化、扩展名大小写、.env/Dockerfile 拒绝
  • i18n resources(+12):zh/en 键集相等(复数感知)、非空值、复数约定锁定、点分键格式、占位符名称一致性

调查发现(无缺口,供知悉)

  • zh 511 键 / en 513 键——唯一差异是有意的 i18next 复数约定(en _one/_other,zh 裸键)
  • 值中混用 {{name}} 与单大括号 {name} 占位符(zh/en 逐键一致);单大括号 i18next 原生不插值,建议确认应用侧有自定义插值处理
  • normalizeEvidenceStatus 大小写敏感(不 lowercase),'PENDING' 会落到默认值——潜在缺陷,未在本批修(test-only 范围)

Test plan

  • vitest run 新文件 — 153/153 通过
  • tsc --noEmit 全包 0 错误
  • CI 前端测试 job 通过

关联

…es 补 153 个单元测试(Lane D #1764 第十二批)

- transcript/edgeEventEvidence.ts:+68(全部导出:作者推导/证据构建/状态与风险归一化)
- composer/attachments.ts:+73(9 导出全量、真实 SHA-256、100% 覆盖;合并既有 13 用例为超集)
- chatview/i18n/resources.ts:+12(zh/en 键集奇偶校验、复数约定、值卫生、占位符一致性;未发现缺口)

不改任何产品代码。Lane D #1764

Co-authored-by: Cursor <cursor@vectorcontrol.tech>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DeliciousBuding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 791c0f44-33d2-4416-8cb6-92710ca97241

📥 Commits

Reviewing files that changed from the base of the PR and between 827087f and 6cfbffc.

📒 Files selected for processing (3)
  • app/shared/src/chatview/i18n/resources.test.ts
  • app/shared/src/composer/attachments.test.ts
  • app/shared/src/transcript/edgeEventEvidence.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DeliciousBuding
DeliciousBuding merged commit 3737cdd into master Aug 19, 2026
34 checks passed
@DeliciousBuding
DeliciousBuding deleted the test/shared-evidence-attachments-i18n-unit-tests branch August 19, 2026 15:47
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