Skip to content

test(shared): edgeEventMappers + queryKeys + upload 补 194 个单元测试(Lane D #1764 第五批) - #1772

Open
DeliciousBuding wants to merge 2 commits into
masterfrom
test/shared-edge-mappers-querykeys-upload-unit-tests
Open

test(shared): edgeEventMappers + queryKeys + upload 补 194 个单元测试(Lane D #1764 第五批)#1772
DeliciousBuding wants to merge 2 commits into
masterfrom
test/shared-edge-mappers-querykeys-upload-unit-tests

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

Summary

延续 #1765#1767,落地 Lane D 前端测试补债 (#1764) 第五批:给 4 个纯逻辑模块补 194 个单元测试。不改任何产品代码。

为什么选它

  • transcript/edgeEventMappers*.ts(424 行):Edge 事件 → TranscriptBlock 映射,WS 帧字段缺失/回退链的回归风险点。
  • stores/queryKeys.ts(188 行):TanStack Query key 工厂,空串/undefined/null 分支易错。
  • composer/upload.ts(217 行):XHR/fetch 双路径上传 + 真实 SHA-256 + 进度映射,100% 分支覆盖。

覆盖范围

  • edgeEventMappersAgents(+40):subagent/subtask/childAgent/route/contextUsage/agentResult/compactBoundary
  • edgeEventMappersRun(+44):runText/status/failed/cancelled/finished/outputText/outputBatch/agentText/thinking
  • queryKeys(+87):hub/edge 全部 key factory + isQueryKeyPrefix/rootPrefix 边界(空串折叠、undefined/null 槽位、引用同一性)
  • upload(+23):XHR/fetch 双路径、真实 SHA-256、进度 0→10→15–95→100、失败吞噬、ref 保持

Test plan

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

关联

…#1764 第五批)

- transcript/edgeEventMappersAgents.ts:+40(subagent/subtask/childAgent/route/contextUsage/agentResult/compactBoundary 全分支)
- transcript/edgeEventMappersRun.ts:+44(runText/status/failed/cancelled/finished/outputText/outputBatch/agentText/thinking)
- stores/queryKeys.ts:+87(hub/edge 全部 key factory + isQueryKeyPrefix/rootPrefix 边界)
- composer/upload.ts:+23(XHR/fetch 双路径、真实 SHA-256、进度映射,100% 分支覆盖)

不改任何产品代码。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: 47 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: 3f8f5c73-7cb0-431f-be9e-2799034f293d

📥 Commits

Reviewing files that changed from the base of the PR and between de446df and 50ced56.

📒 Files selected for processing (4)
  • app/shared/src/composer/upload.test.ts
  • app/shared/src/stores/queryKeys.test.ts
  • app/shared/src/transcript/edgeEventMappersAgents.test.ts
  • app/shared/src/transcript/edgeEventMappersRun.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.

… setup

beforeEach 里 vi.mocked(fetch).mockReset() 在 desktop 测试环境(fetch 为真实实现、
非 shared setup 注入的 vi.fn())抛 TypeError。fetch 回退用例本就各自 stubGlobal 显式
安装 mock,故此 reset 多余且有害,直接移除。Lane D #1764

Co-authored-by: Cursor <cursor@vectorcontrol.tech>
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